EDK2 doxygen online documents - Firmware Encoding Index 1
EDK2 doxygen online documents - Firmware Encoding Index

StdLib/Include/sys/types.h

Go to the documentation of this file.
00001 
00043 #ifndef _SYS_TYPES_H_
00044 #define _SYS_TYPES_H_
00045 
00046 #include  <sys/EfiCdefs.h>
00047 
00048 /* Machine type dependent parameters. */
00049 #include  <machine/types.h>
00050 
00051 #include  <machine/ansi.h>
00052 #include  <machine/int_types.h>
00053 
00054 
00055 #include  <sys/ansi.h>
00056 
00057 #ifndef int8_t
00058   typedef __int8_t  int8_t;
00059   #define int8_t    __int8_t
00060 #endif
00061 
00062 #ifndef uint8_t
00063   typedef __uint8_t uint8_t;
00064   #define uint8_t   __uint8_t
00065 #endif
00066 
00067 #ifndef int16_t
00068   typedef __int16_t int16_t;
00069   #define int16_t   __int16_t
00070 #endif
00071 
00072 #ifndef uint16_t
00073   typedef __uint16_t  uint16_t;
00074   #define uint16_t  __uint16_t
00075 #endif
00076 
00077 #ifndef int32_t
00078   typedef __int32_t int32_t;
00079   #define int32_t   __int32_t
00080 #endif
00081 
00082 #ifndef uint32_t
00083   typedef __uint32_t  uint32_t;
00084   #define uint32_t  __uint32_t
00085 #endif
00086 
00087 #ifndef int64_t
00088   typedef __int64_t int64_t;
00089   #define int64_t   __int64_t
00090 #endif
00091 
00092 #ifndef uint64_t
00093   typedef __uint64_t  uint64_t;
00094   #define uint64_t  __uint64_t
00095 #endif
00096 
00097 typedef uint8_t   u_int8_t;
00098 typedef uint16_t  u_int16_t;
00099 typedef uint32_t  u_int32_t;
00100 typedef uint64_t  u_int64_t;
00101 
00102 #include <machine/endian.h>
00103 
00104 #if defined(_NETBSD_SOURCE)
00105   typedef UINT8   u_char;
00106   typedef UINT16  u_short;
00107   typedef UINTN   u_int;
00108   typedef ULONGN  u_long;
00109 
00110   typedef UINT8   unchar;   /* Sys V compatibility */
00111   typedef UINT16  ushort;   /* Sys V compatibility */
00112   typedef UINTN   uint;     /* Sys V compatibility */
00113   typedef ULONGN  ulong;    /* Sys V compatibility */
00114 
00115   typedef u_long    cpuid_t;
00116 #endif
00117 
00118 typedef uint64_t  u_quad_t; /* quads */
00119 typedef int64_t   quad_t;
00120 typedef quad_t *  qaddr_t;
00121 
00122 /*
00123  * The types longlong_t and u_longlong_t exist for use with the
00124  * Sun-derived XDR routines involving these types, and their usage
00125  * in other contexts is discouraged.  Further note that these types
00126  * may not be equivalent to "long long" and "unsigned long long",
00127  * they are only guaranteed to be signed and unsigned 64-bit types
00128  * respectively.  Portable programs that need 64-bit types should use
00129  * the C99 types int64_t and uint64_t instead.
00130  */
00131 
00132 typedef int64_t   longlong_t; /* for XDR */
00133 typedef uint64_t  u_longlong_t; /* for XDR */
00134 
00135 typedef int64_t   blkcnt_t; /* fs block count */
00136 typedef uint32_t  blksize_t;  /* fs optimal block size */
00137 
00138 #ifndef fsblkcnt_t
00139   typedef __fsblkcnt_t  fsblkcnt_t; /* fs block count (statvfs) */
00140   #define fsblkcnt_t  __fsblkcnt_t
00141 #endif
00142 
00143 #ifndef fsfilcnt_t
00144   typedef __fsfilcnt_t  fsfilcnt_t; /* fs file count */
00145   #define fsfilcnt_t  __fsfilcnt_t
00146 #endif
00147 
00148 #ifndef caddr_t
00149   typedef __caddr_t caddr_t;  /* core address */
00150   #define caddr_t   __caddr_t
00151 #endif
00152 
00153 #ifdef __daddr_t
00154   typedef __daddr_t daddr_t;  /* disk address */
00155   #undef __daddr_t
00156 #else
00157   typedef int64_t   daddr_t;  /* disk address */
00158 #endif
00159 
00160 typedef uint32_t  dev_t;    /* device number */
00161 typedef uint32_t  fixpt_t;  /* fixed point number */
00162 
00163 #ifndef gid_t
00164   typedef __gid_t   gid_t;    /* group id */
00165   #define gid_t   __gid_t
00166 #endif
00167 
00168 typedef uint32_t  id_t;   /* group id, process id or user id */
00169 typedef uint64_t  ino_t;    /* inode number */
00170 typedef EFI_LONG_T    key_t;    /* IPC key (for Sys V IPC) */
00171 
00172 #ifndef mode_t
00173   typedef __mode_t  mode_t;   /* permissions */
00174   #define mode_t    __mode_t
00175 #endif
00176 
00177 typedef uint32_t  nlink_t;  /* link count */
00178 
00179 #ifndef off_t
00180   typedef __off_t   off_t;    /* file offset */
00181   #define off_t   __off_t
00182 #endif
00183 
00184 #ifndef pid_t
00185   typedef __pid_t   pid_t;    /* process id */
00186   #define pid_t   __pid_t
00187 #endif
00188 typedef int32_t   lwpid_t;  /* LWP id */
00189 typedef quad_t    rlim_t;   /* resource limit */
00190 typedef int32_t   segsz_t;  /* segment size */
00191 typedef int32_t   swblk_t;  /* swap offset */
00192 
00193 #ifndef uid_t
00194   typedef __uid_t   uid_t;    /* user id */
00195   #define uid_t   __uid_t
00196 #endif
00197 
00198 typedef int64_t   dtime_t;  /* on-disk time_t */
00199 
00200 #if defined(_LIBC)
00201   /*
00202    * semctl(2)'s argument structure.  This is here for the benefit of
00203    * <sys/syscallargs.h>.  It is not in the user's namespace in SUSv2.
00204    * The SUSv2 semctl(2) takes variable arguments.
00205    */
00206   union __semun {
00207     int   val;    /* value for SETVAL */
00208     struct semid_ds *buf;   /* buffer for IPC_STAT & IPC_SET */
00209     unsigned short  *array;   /* array for GETALL & SETALL */
00210   };
00211   /* For the same reason as above */
00212   #include <sys/stdint.h>
00213   typedef intptr_t semid_t;
00214 #endif /* _LIBC */
00215 
00216 /*
00217  * These belong in EfiSysCall.h, but are also placed here to ensure that
00218  * long arguments will be promoted to off_t if the program fails to
00219  * include that header or explicitly cast them to off_t.
00220  */
00221 #ifndef __OFF_T_SYSCALLS_DECLARED
00222   #define __OFF_T_SYSCALLS_DECLARED
00223   __BEGIN_DECLS
00224   extern off_t    lseek     (int, off_t, int);
00225   extern int      truncate  (const char *, off_t);
00226   extern int      ftruncate (int, off_t);
00227   __END_DECLS
00228 #endif /* __OFF_T_SYSCALLS_DECLARED */
00229 
00230 #if defined(_NETBSD_SOURCE)
00231   /* Major, minor numbers, dev_t's. */
00232   #define major(x)  ((int32_t)((((x) & 0x000fff00) >>  8)))
00233   #define minor(x)  ((int32_t)((((x) & 0xfff00000) >> 12) | \
00234              (((x) & 0x000000ff) >>  0)))
00235   #define makedev(x,y)  ((dev_t)((((x) <<  8) & 0x000fff00) | \
00236            (((y) << 12) & 0xfff00000) | \
00237            (((y) <<  0) & 0x000000ff)))
00238 #endif
00239 
00240 #if   defined(_BSD_CLOCK_T_) && defined(_EFI_CLOCK_T)
00241   typedef _BSD_CLOCK_T_     clock_t;
00242   #undef  _BSD_CLOCK_T_
00243   #undef  _EFI_CLOCK_T
00244 #endif
00245 
00246 #ifdef  _EFI_SIZE_T_
00247   typedef _EFI_SIZE_T_      size_t;
00248   #define _SIZE_T
00249   #undef  _BSD_SIZE_T_
00250   #undef  _EFI_SIZE_T_
00251 #endif
00252 
00253 #ifdef  _BSD_SSIZE_T_
00254   typedef _BSD_SSIZE_T_   ssize_t;
00255   #undef  _BSD_SSIZE_T_
00256 #endif
00257 
00258 #if   defined(_BSD_TIME_T_) && defined(_EFI_TIME_T)
00259   typedef _BSD_TIME_T_    time_t;
00260   #undef  _BSD_TIME_T_
00261   #undef  _EFI_TIME_T
00262 #endif
00263 
00264 #ifdef  _BSD_CLOCKID_T_
00265   typedef _BSD_CLOCKID_T_   clockid_t;
00266   #undef  _BSD_CLOCKID_T_
00267 #endif
00268 
00269 #ifdef  _BSD_TIMER_T_
00270   typedef _BSD_TIMER_T_   timer_t;
00271   #undef  _BSD_TIMER_T_
00272 #endif
00273 
00274 #ifdef  _BSD_SUSECONDS_T_
00275   typedef _BSD_SUSECONDS_T_ suseconds_t;
00276   #undef  _BSD_SUSECONDS_T_
00277 #endif
00278 
00279 #ifdef  _BSD_USECONDS_T_
00280   typedef _BSD_USECONDS_T_  useconds_t;
00281   #undef  _BSD_USECONDS_T_
00282 #endif
00283 
00284 #ifdef _NETBSD_SOURCE
00285   #include <sys/fd_set.h>
00286   #define NBBY  __NBBY
00287 
00288   typedef struct kauth_cred *kauth_cred_t;
00289 
00290 #endif
00291 
00292 #if 0
00293   #if !defined(_KERNEL) && !defined(_STANDALONE)
00294     #if (_POSIX_C_SOURCE - 0L) >= 199506L || (_XOPEN_SOURCE - 0) >= 500 || \
00295          defined(_NETBSD_SOURCE)
00296       #include <pthread_types.h>
00297     #endif
00298   #endif
00299 #endif  /* if 0 */
00300 
00301 #endif /* !_SYS_TYPES_H_ */
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Defines