Fx_port.h
上传用户:super_houu
上传日期:2008-09-21
资源大小:4099k
文件大小:14k
- /**************************************************************************/
- /* */
- /* Copyright (c) 1996-2002 by Express Logic Inc. */
- /* */
- /* This software is copyrighted by and is the sole property of Express */
- /* Logic, Inc. All rights, title, ownership, or other interests */
- /* in the software remain the property of Express Logic, Inc. This */
- /* software may only be used in accordance with the corresponding */
- /* license agreement. Any unauthorized use, duplication, transmission, */
- /* distribution, or disclosure of this software is expressly forbidden. */
- /* */
- /* This Copyright notice may not be removed or modified without prior */
- /* written consent of Express Logic, Inc. */
- /* */
- /* Express Logic, Inc. reserves the right to modify this software */
- /* without notice. */
- /* */
- /* Express Logic, Inc. info@expresslogic.com */
- /* 11423 West Bernardo Court http://www.expresslogic.com */
- /* San Diego, CA 92127 */
- /* */
- /**************************************************************************/
- /**************************************************************************/
- /**************************************************************************/
- /** */
- /** FileX Component */
- /** */
- /** Port Specific */
- /** */
- /**************************************************************************/
- /**************************************************************************/
- /**************************************************************************/
- /* */
- /* PORT SPECIFIC C INFORMATION RELEASE */
- /* */
- /* fx_port.h LX4180/Green Hills */
- /* 3.0 */
- /* */
- /* AUTHOR */
- /* */
- /* William E. Lamie, Express Logic, Inc. */
- /* */
- /* DESCRIPTION */
- /* */
- /* This file contains data type definitions that make the FileX MS-DOS */
- /* compatible file system function identically on a variety of */
- /* different processor architectures. For example, the byte offset of */
- /* various entries in the boot record, and directory entries are */
- /* defined in this file. */
- /* */
- /* RELEASE HISTORY */
- /* */
- /* DATE NAME DESCRIPTION */
- /* */
- /* 01-28-2001 William E. Lamie Initial LX4180/Green Hills */
- /* Support Version 2.0 */
- /* 03-01-2002 William E. Lamie Modified comment(s), added */
- /* FAT32 constants, and */
- /* changed version string, */
- /* resulting in version 3.0. */
- /* */
- /**************************************************************************/
- #ifndef FX_PORT
- #define FX_PORT
- #include "Includesysdefs.h"
- /* Definitions of types used throughout the FileX lib */
- #define USHORT UINT16
- #define UCHAR_PTR PBYTE
- #define CHAR_PTR LPSTR
- #define UCHAR BYTE
- #define PCHAR LPSTR
- #define VOID void
- #define PULONG ULONG*
- /*
- #define FX_NO_LOCAL_PATH
- #define FX_NO_TIMER
- */
- /* Define various constants for the port. */
- /**************************************************************************/
- /* */
- /* Define constants for the MS-DOS master boot record, */
- /* which is defined as follows: */
- /* */
- /* Byte Offset Meaning Size */
- /* */
- /* 0x000 Reserved 446 */
- /* 0x1BE Boot indicator 0 1 */
- /* 0x1BF Start CHS 0 3 */
- /* 0x1C2 Partition type 0 1 */
- /* 0x1C3 End CHS 0 3 */
- /* 0x1C6 Partition start 0 4 */
- /* 0x1CA Partition size 0 4 */
- /* 0x1CE Boot indicator 1 1 */
- /* 0x1CF Start CHS 1 3 */
- /* 0x1D2 Partition type 1 1 */
- /* 0x1D3 End CHS 1 3 */
- /* 0x1D6 Partition start 1 4 */
- /* 0x1DA Partition size 1 4 */
- /* 0x1DE Boot indicator 2 1 */
- /* 0x1DF Start CHS 2 3 */
- /* 0x1E2 Partition type 2 1 */
- /* 0x1E3 End CHS 2 3 */
- /* 0x1E6 Partition start 2 4 */
- /* 0x1EA Partition size 2 4 */
- /* 0x1EE Boot indicator 3 1 */
- /* 0x1EF Start CHS 3 3 */
- /* 0x1F2 Partition type 3 1 */
- /* 0x1F3 End CHS 3 3 */
- /* 0x1F6 Partition start 3 4 */
- /* 0x1FA Partition size 3 4 */
- /* 0x1FE Signature (0x55aa) 2 */
- /* */
- /**************************************************************************/
- #define FX_JUMP_INSTR 0x000
- #define FX_OEM_NAME 0x003
- #define FX_BYTES_SECTOR 0x00B
- #define FX_SECTORS_CLUSTER 0x00D
- #define FX_RESERVED_SECTORS 0x00E
- #define FX_NUMBER_OF_FATS 0x010
- #define FX_ROOT_DIR_ENTRIES 0x011
- #define FX_SECTORS 0x013
- #define FX_MEDIA_TYPE 0x015
- #define FX_SECTORS_PER_FAT 0x016
- #define FX_SECTORS_PER_TRK 0x018
- #define FX_HEADS 0x01A
- #define FX_HIDDEN_SECTORS 0x01C
- #define FX_HUGE_SECTORS 0x020
- #define FX_DRIVE_NUMBER 0x024
- #define FX_RESERVED 0x025
- #define FX_BOOT_SIG 0x026
- #define FX_VOLUME_ID 0x027
- #define FX_VOLUME_LABEL 0x02B
- #define FX_FILE_SYSTEM_TYPE 0x036
- #define FX_SIG_OFFSET 0x1FE
- #define FX_ROOT_CLUS_32 0x02C
- #define FX_SECTORS_PER_FAT_32 0x024
- #define FX_SIG_BYTE_1 0x55
- #define FX_SIG_BYTE_2 0xAA
- #define FX_PARTITION_SIG_OFFSET 0x1FE
- /**************************************************************************/
- /* */
- /* Define constants for the MS-DOS boot record, */
- /* which is defined as follows: */
- /* */
- /* Byte Offset Meaning Size */
- /* */
- /* 0x000 Jump Instructions 3 */
- /* 0x003 OEM Name 8 */
- /* 0x00B Bytes per Sector 2 */
- /* 0x00D Sectors per Cluster 1 */
- /* 0x00E Reserved Sectors 2 */
- /* 0x010 Number of FATs 1 */
- /* 0x011 Max Root Dir Entries 2 */
- /* 0x013 Number of Sectors 2 */
- /* 0x015 Media Type 1 */
- /* 0x016 Sectors per FAT 2 */
- /* 0x018 Sectors per Track 2 */
- /* 0x01A Number of Heads 2 */
- /* 0x01C Hidden Sectors 4 */
- /* 0x020 Huge Sectors 4 */
- /* 0x024 Drive Number 1 */
- /* 0x025 Reserved 1 */
- /* 0x026 Boot Signature 1 */
- /* 0x027 Volume ID 4 */
- /* 0x02B Volume Label 11 */
- /* 0x036 File System Type 8 */
- /* ... ... ... */
- /* 0x1FE Signature (0x55aa) 2 */
- /* */
- /**************************************************************************/
- /* Define FAT constants. */
- #define FX_MAX_12BIT_CLUST 0x0FF0
- #define FX_SIGN_EXTEND 0xF000
- /* Define FileX internal protection macros. If FX_SINGLE_THREAD is defined,
- these protection macros are effectively disabled. However, for non-single
- threaded uses, the macros are setup to utilize ThreadX semaphores for
- multiple thread access control into an open media. */
- #ifdef FX_SINGLE_THREAD
- #define FX_PROTECT
- #define FX_UNPROTECT
- #else
- #define FX_PROTECT os_semaphore_obtain(&(media_ptr -> fx_media_protect),1);
- #define FX_UNPROTECT os_semaphore_release(&(media_ptr -> fx_media_protect));
- #endif
- #ifndef WIN32
- /* Define interrupt lockout constructs to protect the system date/time from being updated
- while they are being read. */
- #define FX_INT_SAVE_AREA unsigned int old_interrupt_posture;
- #define FX_DISABLE_INTS
- #define FX_RESTORE_INTS
- /* Define the error checking logic to determine if there is a caller error in the FileX API.
- The default definitions assume ThreadX is being used. This code can be completely turned
- off by just defining these macros to white space. */
- #define FX_CALLER_CHECKING_EXTERNS
- #define FX_CALLER_CHECKING_CODE
- #else
- /* Define interrupt lockout constructs to protect the system date/time from being updated
- while they are being read. */
- #define FX_INT_SAVE_AREA
- #define FX_DISABLE_INTS
- #define FX_RESTORE_INTS
- /* Define the error checking logic to determine if there is a caller error in the FileX API.
- The default definitions assume ThreadX is being used. This code can be completely turned
- off by just defining these macros to white space. */
- #define FX_CALLER_CHECKING_EXTERNS
- #define FX_CALLER_CHECKING_CODE
- #endif
- /* Define the update rate of the system timer. These values may also be defined at the command
- line when compiling the fx_si.c module in the FileX library build. Alternatively, they can
- be modified in this file. Note: the update rate must be an even number of seconds greater
- than or equal to 2, which is the minimal update rate for MS-DOS time. */
- #ifndef FX_UPDATE_RATE_IN_SECONDS
- #define FX_UPDATE_RATE_IN_SECONDS 10 /* Update time at 10 second intervals */
- #endif
- #ifndef FX_UPDATE_RATE_IN_TICKS
- #define FX_UPDATE_RATE_IN_TICKS 180 /* Same update rate, but in ticks */
- #endif
- #endif