OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [newlib-1.18.0/] [newlib-1.18.0-or32-1.0rc1/] [newlib/] [libc/] [include/] [sys/] [types.h] - Diff between revs 207 and 345

Only display areas with differences | Details | Blame | View Log

Rev 207 Rev 345
/* unified sys/types.h:
/* unified sys/types.h:
   start with sef's sysvi386 version.
   start with sef's sysvi386 version.
   merge go32 version -- a few ifdefs.
   merge go32 version -- a few ifdefs.
   h8300hms, h8300xray, and sysvnecv70 disagree on the following types:
   h8300hms, h8300xray, and sysvnecv70 disagree on the following types:
 
 
   typedef int gid_t;
   typedef int gid_t;
   typedef int uid_t;
   typedef int uid_t;
   typedef int dev_t;
   typedef int dev_t;
   typedef int ino_t;
   typedef int ino_t;
   typedef int mode_t;
   typedef int mode_t;
   typedef int caddr_t;
   typedef int caddr_t;
 
 
   however, these aren't "reasonable" values, the sysvi386 ones make far
   however, these aren't "reasonable" values, the sysvi386 ones make far
   more sense, and should work sufficiently well (in particular, h8300
   more sense, and should work sufficiently well (in particular, h8300
   doesn't have a stat, and the necv70 doesn't matter.) -- eichin
   doesn't have a stat, and the necv70 doesn't matter.) -- eichin
 */
 */
 
 
#ifndef _SYS_TYPES_H
#ifndef _SYS_TYPES_H
 
 
#include <_ansi.h>
#include <_ansi.h>
 
 
#ifndef __INTTYPES_DEFINED__
#ifndef __INTTYPES_DEFINED__
#define __INTTYPES_DEFINED__
#define __INTTYPES_DEFINED__
 
 
#include <machine/_types.h>
#include <machine/_types.h>
 
 
#if defined(__rtems__) || defined(__XMK__)
#if defined(__rtems__) || defined(__XMK__)
/*
/*
 *  The following section is RTEMS specific and is needed to more
 *  The following section is RTEMS specific and is needed to more
 *  closely match the types defined in the BSD sys/types.h.
 *  closely match the types defined in the BSD sys/types.h.
 *  This is needed to let the RTEMS/BSD TCP/IP stack compile.
 *  This is needed to let the RTEMS/BSD TCP/IP stack compile.
 */
 */
 
 
/* deprecated */
/* deprecated */
#if ___int8_t_defined
#if ___int8_t_defined
typedef __uint8_t       u_int8_t;
typedef __uint8_t       u_int8_t;
#endif
#endif
#if ___int16_t_defined
#if ___int16_t_defined
typedef __uint16_t      u_int16_t;
typedef __uint16_t      u_int16_t;
#endif 
#endif 
#if ___int32_t_defined
#if ___int32_t_defined
typedef __uint32_t      u_int32_t;
typedef __uint32_t      u_int32_t;
#endif
#endif
 
 
#if ___int64_t_defined
#if ___int64_t_defined
typedef __uint64_t      u_int64_t;
typedef __uint64_t      u_int64_t;
 
 
/* deprecated */
/* deprecated */
typedef __uint64_t      u_quad_t;
typedef __uint64_t      u_quad_t;
typedef __int64_t       quad_t;
typedef __int64_t       quad_t;
typedef quad_t *        qaddr_t;
typedef quad_t *        qaddr_t;
#endif
#endif
 
 
#endif
#endif
 
 
#endif /* ! __INTTYPES_DEFINED */
#endif /* ! __INTTYPES_DEFINED */
 
 
#ifndef __need_inttypes
#ifndef __need_inttypes
 
 
#define _SYS_TYPES_H
#define _SYS_TYPES_H
#include <sys/_types.h>
#include <sys/_types.h>
 
 
#ifdef __i386__
#ifdef __i386__
#if defined (GO32) || defined (__MSDOS__)
#if defined (GO32) || defined (__MSDOS__)
#define __MS_types__
#define __MS_types__
#endif
#endif
#endif
#endif
 
 
# include <stddef.h>
# include <stddef.h>
# include <machine/types.h>
# include <machine/types.h>
 
 
/* To ensure the stat struct's layout doesn't change when sizeof(int), etc.
/* To ensure the stat struct's layout doesn't change when sizeof(int), etc.
   changes, we assume sizeof short and long never change and have all types
   changes, we assume sizeof short and long never change and have all types
   used to define struct stat use them and not int where possible.
   used to define struct stat use them and not int where possible.
   Where not possible, _ST_INTxx are used.  It would be preferable to not have
   Where not possible, _ST_INTxx are used.  It would be preferable to not have
   such assumptions, but until the extra fluff is necessary, it's avoided.
   such assumptions, but until the extra fluff is necessary, it's avoided.
   No 64 bit targets use stat yet.  What to do about them is postponed
   No 64 bit targets use stat yet.  What to do about them is postponed
   until necessary.  */
   until necessary.  */
#ifdef __GNUC__
#ifdef __GNUC__
#define _ST_INT32 __attribute__ ((__mode__ (__SI__)))
#define _ST_INT32 __attribute__ ((__mode__ (__SI__)))
#else
#else
#define _ST_INT32
#define _ST_INT32
#endif
#endif
 
 
# ifndef        _POSIX_SOURCE
# ifndef        _POSIX_SOURCE
 
 
#  define       physadr         physadr_t
#  define       physadr         physadr_t
#  define       quad            quad_t
#  define       quad            quad_t
 
 
#ifndef _BSDTYPES_DEFINED
#ifndef _BSDTYPES_DEFINED
/* also defined in mingw/gmon.h and in w32api/winsock[2].h */
/* also defined in mingw/gmon.h and in w32api/winsock[2].h */
typedef unsigned char   u_char;
typedef unsigned char   u_char;
typedef unsigned short  u_short;
typedef unsigned short  u_short;
typedef unsigned int    u_int;
typedef unsigned int    u_int;
typedef unsigned long   u_long;
typedef unsigned long   u_long;
#define _BSDTYPES_DEFINED
#define _BSDTYPES_DEFINED
#endif
#endif
 
 
typedef unsigned short  ushort;         /* System V compatibility */
typedef unsigned short  ushort;         /* System V compatibility */
typedef unsigned int    uint;           /* System V compatibility */
typedef unsigned int    uint;           /* System V compatibility */
# endif /*!_POSIX_SOURCE */
# endif /*!_POSIX_SOURCE */
 
 
#ifndef __clock_t_defined
#ifndef __clock_t_defined
typedef _CLOCK_T_ clock_t;
typedef _CLOCK_T_ clock_t;
#define __clock_t_defined
#define __clock_t_defined
#endif
#endif
 
 
#ifndef __time_t_defined
#ifndef __time_t_defined
typedef _TIME_T_ time_t;
typedef _TIME_T_ time_t;
#define __time_t_defined
#define __time_t_defined
 
 
/* Time Value Specification Structures, P1003.1b-1993, p. 261 */
/* Time Value Specification Structures, P1003.1b-1993, p. 261 */
 
 
struct timespec {
struct timespec {
  time_t  tv_sec;   /* Seconds */
  time_t  tv_sec;   /* Seconds */
  long    tv_nsec;  /* Nanoseconds */
  long    tv_nsec;  /* Nanoseconds */
};
};
 
 
struct itimerspec {
struct itimerspec {
  struct timespec  it_interval;  /* Timer period */
  struct timespec  it_interval;  /* Timer period */
  struct timespec  it_value;     /* Timer expiration */
  struct timespec  it_value;     /* Timer expiration */
};
};
#endif
#endif
 
 
typedef long    daddr_t;
typedef long    daddr_t;
typedef char *  caddr_t;
typedef char *  caddr_t;
 
 
#ifndef __CYGWIN__
#ifndef __CYGWIN__
#if defined(__MS_types__) || defined(__rtems__) || \
#if defined(__MS_types__) || defined(__rtems__) || \
    defined(__sparc__) || defined(__SPU__)
    defined(__sparc__) || defined(__SPU__)
typedef unsigned long   ino_t;
typedef unsigned long   ino_t;
#else
#else
typedef unsigned short  ino_t;
typedef unsigned short  ino_t;
#endif
#endif
#endif /*__CYGWIN__*/
#endif /*__CYGWIN__*/
 
 
#ifdef __MS_types__
#ifdef __MS_types__
typedef unsigned long vm_offset_t;
typedef unsigned long vm_offset_t;
typedef unsigned long vm_size_t;
typedef unsigned long vm_size_t;
 
 
#define __BIT_TYPES_DEFINED__
#define __BIT_TYPES_DEFINED__
 
 
typedef signed char int8_t;
typedef signed char int8_t;
typedef unsigned char u_int8_t;
typedef unsigned char u_int8_t;
typedef short int16_t;
typedef short int16_t;
typedef unsigned short u_int16_t;
typedef unsigned short u_int16_t;
typedef int int32_t;
typedef int int32_t;
typedef unsigned int u_int32_t;
typedef unsigned int u_int32_t;
typedef long long int64_t;
typedef long long int64_t;
typedef unsigned long long u_int64_t;
typedef unsigned long long u_int64_t;
typedef int32_t register_t;
typedef int32_t register_t;
#endif /* __MS_types__ */
#endif /* __MS_types__ */
 
 
/*
/*
 * All these should be machine specific - right now they are all broken.
 * All these should be machine specific - right now they are all broken.
 * However, for all of Cygnus' embedded targets, we want them to all be
 * However, for all of Cygnus' embedded targets, we want them to all be
 * the same.  Otherwise things like sizeof (struct stat) might depend on
 * the same.  Otherwise things like sizeof (struct stat) might depend on
 * how the file was compiled (e.g. -mint16 vs -mint32, etc.).
 * how the file was compiled (e.g. -mint16 vs -mint32, etc.).
 */
 */
 
 
#ifndef __CYGWIN__      /* which defines these types in it's own types.h. */
#ifndef __CYGWIN__      /* which defines these types in it's own types.h. */
typedef _off_t  off_t;
typedef _off_t  off_t;
typedef __dev_t dev_t;
typedef __dev_t dev_t;
typedef __uid_t uid_t;
typedef __uid_t uid_t;
typedef __gid_t gid_t;
typedef __gid_t gid_t;
#endif
#endif
 
 
#if defined(__XMK__)
#if defined(__XMK__)
typedef signed char pid_t;
typedef signed char pid_t;
#else
#else
typedef int pid_t;
typedef int pid_t;
#endif
#endif
 
 
#ifndef __CYGWIN__
#ifndef __CYGWIN__
typedef long key_t;
typedef long key_t;
#endif
#endif
typedef _ssize_t ssize_t;
typedef _ssize_t ssize_t;
 
 
#ifndef __CYGWIN__
#ifndef __CYGWIN__
#ifdef __MS_types__
#ifdef __MS_types__
typedef char *  addr_t;
typedef char *  addr_t;
typedef int mode_t;
typedef int mode_t;
#else
#else
#if defined (__sparc__) && !defined (__sparc_v9__)
#if defined (__sparc__) && !defined (__sparc_v9__)
#ifdef __svr4__
#ifdef __svr4__
typedef unsigned long mode_t;
typedef unsigned long mode_t;
#else
#else
typedef unsigned short mode_t;
typedef unsigned short mode_t;
#endif
#endif
#else
#else
typedef unsigned int mode_t _ST_INT32;
typedef unsigned int mode_t _ST_INT32;
#endif
#endif
#endif /* ! __MS_types__ */
#endif /* ! __MS_types__ */
#endif /*__CYGWIN__*/
#endif /*__CYGWIN__*/
 
 
typedef unsigned short nlink_t;
typedef unsigned short nlink_t;
 
 
/* We don't define fd_set and friends if we are compiling POSIX
/* We don't define fd_set and friends if we are compiling POSIX
   source, or if we have included (or may include as indicated
   source, or if we have included (or may include as indicated
   by __USE_W32_SOCKETS) the W32api winsock[2].h header which
   by __USE_W32_SOCKETS) the W32api winsock[2].h header which
   defines Windows versions of them.   Note that a program which
   defines Windows versions of them.   Note that a program which
   includes the W32api winsock[2].h header must know what it is doing;
   includes the W32api winsock[2].h header must know what it is doing;
   it must not call the cygwin32 select function.
   it must not call the cygwin32 select function.
*/
*/
# if !(defined (_POSIX_SOURCE) || defined (_WINSOCK_H) || defined (__USE_W32_SOCKETS)) 
# if !(defined (_POSIX_SOURCE) || defined (_WINSOCK_H) || defined (__USE_W32_SOCKETS)) 
#  define _SYS_TYPES_FD_SET
#  define _SYS_TYPES_FD_SET
#  define       NBBY    8               /* number of bits in a byte */
#  define       NBBY    8               /* number of bits in a byte */
/*
/*
 * Select uses bit masks of file descriptors in longs.
 * Select uses bit masks of file descriptors in longs.
 * These macros manipulate such bit fields (the filesystem macros use chars).
 * These macros manipulate such bit fields (the filesystem macros use chars).
 * FD_SETSIZE may be defined by the user, but the default here
 * FD_SETSIZE may be defined by the user, but the default here
 * should be >= NOFILE (param.h).
 * should be >= NOFILE (param.h).
 */
 */
#  ifndef       FD_SETSIZE
#  ifndef       FD_SETSIZE
#       define  FD_SETSIZE      64
#       define  FD_SETSIZE      64
#  endif
#  endif
 
 
typedef long    fd_mask;
typedef long    fd_mask;
#  define       NFDBITS (sizeof (fd_mask) * NBBY)       /* bits per mask */
#  define       NFDBITS (sizeof (fd_mask) * NBBY)       /* bits per mask */
#  ifndef       howmany
#  ifndef       howmany
#       define  howmany(x,y)    (((x)+((y)-1))/(y))
#       define  howmany(x,y)    (((x)+((y)-1))/(y))
#  endif
#  endif
 
 
/* We use a macro for fd_set so that including Sockets.h afterwards
/* We use a macro for fd_set so that including Sockets.h afterwards
   can work.  */
   can work.  */
typedef struct _types_fd_set {
typedef struct _types_fd_set {
        fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)];
        fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)];
} _types_fd_set;
} _types_fd_set;
 
 
#define fd_set _types_fd_set
#define fd_set _types_fd_set
 
 
#  define       FD_SET(n, p)    ((p)->fds_bits[(n)/NFDBITS] |= (1L << ((n) % NFDBITS)))
#  define       FD_SET(n, p)    ((p)->fds_bits[(n)/NFDBITS] |= (1L << ((n) % NFDBITS)))
#  define       FD_CLR(n, p)    ((p)->fds_bits[(n)/NFDBITS] &= ~(1L << ((n) % NFDBITS)))
#  define       FD_CLR(n, p)    ((p)->fds_bits[(n)/NFDBITS] &= ~(1L << ((n) % NFDBITS)))
#  define       FD_ISSET(n, p)  ((p)->fds_bits[(n)/NFDBITS] & (1L << ((n) % NFDBITS)))
#  define       FD_ISSET(n, p)  ((p)->fds_bits[(n)/NFDBITS] & (1L << ((n) % NFDBITS)))
#  define       FD_ZERO(p)      (__extension__ (void)({ \
#  define       FD_ZERO(p)      (__extension__ (void)({ \
     size_t __i; \
     size_t __i; \
     char *__tmp = (char *)p; \
     char *__tmp = (char *)p; \
     for (__i = 0; __i < sizeof (*(p)); ++__i) \
     for (__i = 0; __i < sizeof (*(p)); ++__i) \
       *__tmp++ = 0; \
       *__tmp++ = 0; \
}))
}))
 
 
# endif /* !(defined (_POSIX_SOURCE) || defined (_WINSOCK_H) || defined (__USE_W32_SOCKETS)) */
# endif /* !(defined (_POSIX_SOURCE) || defined (_WINSOCK_H) || defined (__USE_W32_SOCKETS)) */
 
 
#undef __MS_types__
#undef __MS_types__
#undef _ST_INT32
#undef _ST_INT32
 
 
 
 
#ifndef __clockid_t_defined
#ifndef __clockid_t_defined
typedef _CLOCKID_T_ clockid_t;
typedef _CLOCKID_T_ clockid_t;
#define __clockid_t_defined
#define __clockid_t_defined
#endif
#endif
 
 
#ifndef __timer_t_defined
#ifndef __timer_t_defined
typedef _TIMER_T_ timer_t;
typedef _TIMER_T_ timer_t;
#define __timer_t_defined
#define __timer_t_defined
#endif
#endif
 
 
typedef unsigned long useconds_t;
typedef unsigned long useconds_t;
typedef long suseconds_t;
typedef long suseconds_t;
 
 
#include <sys/features.h>
#include <sys/features.h>
 
 
 
 
/* Cygwin will probably never have full posix compliance due to little things
/* Cygwin will probably never have full posix compliance due to little things
 * like an inability to set the stackaddress. Cygwin is also using void *
 * like an inability to set the stackaddress. Cygwin is also using void *
 * pointers rather than structs to ensure maximum binary compatability with
 * pointers rather than structs to ensure maximum binary compatability with
 * previous releases.
 * previous releases.
 * This means that we don't use the types defined here, but rather in
 * This means that we don't use the types defined here, but rather in
 * <cygwin/types.h>
 * <cygwin/types.h>
 */
 */
#if defined(_POSIX_THREADS) && !defined(__CYGWIN__)
#if defined(_POSIX_THREADS) && !defined(__CYGWIN__)
 
 
#include <sys/sched.h>
#include <sys/sched.h>
 
 
/*
/*
 *  2.5 Primitive System Data Types,  P1003.1c/D10, p. 19.
 *  2.5 Primitive System Data Types,  P1003.1c/D10, p. 19.
 */
 */
 
 
#if defined(__XMK__)
#if defined(__XMK__)
typedef unsigned int pthread_t;          /* identify a thread */
typedef unsigned int pthread_t;          /* identify a thread */
#else
#else
typedef __uint32_t pthread_t;            /* identify a thread */
typedef __uint32_t pthread_t;            /* identify a thread */
#endif
#endif
 
 
/* P1003.1c/D10, p. 118-119 */
/* P1003.1c/D10, p. 118-119 */
#define PTHREAD_SCOPE_PROCESS 0
#define PTHREAD_SCOPE_PROCESS 0
#define PTHREAD_SCOPE_SYSTEM  1
#define PTHREAD_SCOPE_SYSTEM  1
 
 
/* P1003.1c/D10, p. 111 */
/* P1003.1c/D10, p. 111 */
#define PTHREAD_INHERIT_SCHED  1      /* scheduling policy and associated */
#define PTHREAD_INHERIT_SCHED  1      /* scheduling policy and associated */
                                      /*   attributes are inherited from */
                                      /*   attributes are inherited from */
                                      /*   the calling thread. */
                                      /*   the calling thread. */
#define PTHREAD_EXPLICIT_SCHED 2      /* set from provided attribute object */
#define PTHREAD_EXPLICIT_SCHED 2      /* set from provided attribute object */
 
 
/* P1003.1c/D10, p. 141 */
/* P1003.1c/D10, p. 141 */
#define PTHREAD_CREATE_DETACHED 0
#define PTHREAD_CREATE_DETACHED 0
#define PTHREAD_CREATE_JOINABLE  1
#define PTHREAD_CREATE_JOINABLE  1
 
 
#if defined(__XMK__) || defined(__rtems__)
#if defined(__XMK__) || defined(__rtems__)
/* The following defines are part of the X/Open System Interface (XSI). */
/* The following defines are part of the X/Open System Interface (XSI). */
 
 
/* This type of mutex does not detect deadlock. A thread attempting to relock this mutex without first unlocking
/* This type of mutex does not detect deadlock. A thread attempting to relock this mutex without first unlocking
 * it shall deadlock. Attempting to unlock a mutex locked by a different thread results in undefined behavior.
 * it shall deadlock. Attempting to unlock a mutex locked by a different thread results in undefined behavior.
 * Attempting to unlock an unlocked mutex results in undefined behavior.
 * Attempting to unlock an unlocked mutex results in undefined behavior.
 */
 */
#define PTHREAD_MUTEX_NORMAL  1
#define PTHREAD_MUTEX_NORMAL  1
 
 
/*
/*
 * This type of mutex provides error checking. A thread attempting to relock this mutex without first unlocking
 * This type of mutex provides error checking. A thread attempting to relock this mutex without first unlocking
 * it shall return with an error. A thread attempting to unlock a mutex which another thread has locked shall return
 * it shall return with an error. A thread attempting to unlock a mutex which another thread has locked shall return
 * with an error. A thread attempting to unlock an unlocked mutex shall return with an error.
 * with an error. A thread attempting to unlock an unlocked mutex shall return with an error.
 */
 */
#define PTHREAD_MUTEX_ERRORCHECK  2 
#define PTHREAD_MUTEX_ERRORCHECK  2 
 
 
/* A thread attempting to relock this mutex without first unlocking it shall succeed in locking the mutex.
/* A thread attempting to relock this mutex without first unlocking it shall succeed in locking the mutex.
 * The relocking deadlock which can occur with mutexes of type PTHREAD_MUTEX_NORMAL cannot occur with this type of mutex.
 * The relocking deadlock which can occur with mutexes of type PTHREAD_MUTEX_NORMAL cannot occur with this type of mutex.
 * Multiple locks of this mutex shall require the same number of unlocks to release the mutex before another thread can
 * Multiple locks of this mutex shall require the same number of unlocks to release the mutex before another thread can
 * acquire the mutex. A thread attempting to unlock a mutex which another thread has locked shall return with an error.
 * acquire the mutex. A thread attempting to unlock a mutex which another thread has locked shall return with an error.
 * A thread attempting to unlock an unlocked mutex shall return with an error.
 * A thread attempting to unlock an unlocked mutex shall return with an error.
 */
 */
#define PTHREAD_MUTEX_RECURSIVE  3
#define PTHREAD_MUTEX_RECURSIVE  3
 
 
/* Attempting to recursively lock a mutex of this type results in undefined behavior. Attempting to unlock a
/* Attempting to recursively lock a mutex of this type results in undefined behavior. Attempting to unlock a
 * mutex of this type which was not locked by the calling thread results in undefined behavior. Attempting to
 * mutex of this type which was not locked by the calling thread results in undefined behavior. Attempting to
 * unlock a mutex of this type which is not locked results in undefined behavior. An implementation may map this
 * unlock a mutex of this type which is not locked results in undefined behavior. An implementation may map this
 * mutex to one of the other mutex types.
 * mutex to one of the other mutex types.
 */
 */
#define PTHREAD_MUTEX_DEFAULT  4 
#define PTHREAD_MUTEX_DEFAULT  4 
 
 
#endif /* defined(__XMK__) || defined(__rtems__) */
#endif /* defined(__XMK__) || defined(__rtems__) */
 
 
#if defined(__XMK__)
#if defined(__XMK__)
typedef struct pthread_attr_s {
typedef struct pthread_attr_s {
  int contentionscope;
  int contentionscope;
  struct sched_param schedparam;
  struct sched_param schedparam;
  int  detachstate;
  int  detachstate;
  void *stackaddr;
  void *stackaddr;
  size_t stacksize;
  size_t stacksize;
} pthread_attr_t;
} pthread_attr_t;
 
 
#define PTHREAD_STACK_MIN       200
#define PTHREAD_STACK_MIN       200
 
 
#else /* !defined(__XMK__) */
#else /* !defined(__XMK__) */
typedef struct {
typedef struct {
  int is_initialized;
  int is_initialized;
  void *stackaddr;
  void *stackaddr;
  int stacksize;
  int stacksize;
  int contentionscope;
  int contentionscope;
  int inheritsched;
  int inheritsched;
  int schedpolicy;
  int schedpolicy;
  struct sched_param schedparam;
  struct sched_param schedparam;
#endif /* !defined(__XMK__) */
#endif /* !defined(__XMK__) */
 
 
  /* P1003.4b/D8, p. 54 adds cputime_clock_allowed attribute.  */
  /* P1003.4b/D8, p. 54 adds cputime_clock_allowed attribute.  */
#if defined(_POSIX_THREAD_CPUTIME)
#if defined(_POSIX_THREAD_CPUTIME)
  int  cputime_clock_allowed;  /* see time.h */
  int  cputime_clock_allowed;  /* see time.h */
#endif
#endif
  int  detachstate;
  int  detachstate;
 
 
} pthread_attr_t;
} pthread_attr_t;
 
 
#if defined(_POSIX_THREAD_PROCESS_SHARED)
#if defined(_POSIX_THREAD_PROCESS_SHARED)
/* NOTE: P1003.1c/D10, p. 81 defines following values for process_shared.  */
/* NOTE: P1003.1c/D10, p. 81 defines following values for process_shared.  */
 
 
#define PTHREAD_PROCESS_PRIVATE 0 /* visible within only the creating process */
#define PTHREAD_PROCESS_PRIVATE 0 /* visible within only the creating process */
#define PTHREAD_PROCESS_SHARED  1 /* visible too all processes with access to */
#define PTHREAD_PROCESS_SHARED  1 /* visible too all processes with access to */
                                  /*   the memory where the resource is */
                                  /*   the memory where the resource is */
                                  /*   located */
                                  /*   located */
#endif
#endif
 
 
#if defined(_POSIX_THREAD_PRIO_PROTECT)
#if defined(_POSIX_THREAD_PRIO_PROTECT)
/* Mutexes */
/* Mutexes */
 
 
/* Values for blocking protocol. */
/* Values for blocking protocol. */
 
 
#define PTHREAD_PRIO_NONE    0
#define PTHREAD_PRIO_NONE    0
#define PTHREAD_PRIO_INHERIT 1
#define PTHREAD_PRIO_INHERIT 1
#define PTHREAD_PRIO_PROTECT 2
#define PTHREAD_PRIO_PROTECT 2
#endif
#endif
 
 
#if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES)
#if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES)
 
 
/* Values for mutex type */
/* Values for mutex type */
 
 
#define PTHREAD_MUTEX_NORMAL     0
#define PTHREAD_MUTEX_NORMAL     0
#define PTHREAD_MUTEX_RECURSIVE  1
#define PTHREAD_MUTEX_RECURSIVE  1
#define PTHREAD_MUTEX_ERRORCHECK 2
#define PTHREAD_MUTEX_ERRORCHECK 2
#define PTHREAD_MUTEX_DEFAULT    3
#define PTHREAD_MUTEX_DEFAULT    3
 
 
#endif
#endif
 
 
#if defined(__XMK__)
#if defined(__XMK__)
typedef unsigned int pthread_mutex_t;    /* identify a mutex */
typedef unsigned int pthread_mutex_t;    /* identify a mutex */
 
 
typedef struct {
typedef struct {
  int type;
  int type;
} pthread_mutexattr_t;
} pthread_mutexattr_t;
 
 
 
 
#if defined(__XMK__)
#if defined(__XMK__)
/* The following defines are part of the X/Open System Interface (XSI). */
/* The following defines are part of the X/Open System Interface (XSI). */
 
 
/* This type of mutex does not detect deadlock. A thread attempting to
/* This type of mutex does not detect deadlock. A thread attempting to
 * relock this mutex without first unlocking it shall deadlock. Attempting
 * relock this mutex without first unlocking it shall deadlock. Attempting
 * to unlock a mutex locked by a different thread results in undefined
 * to unlock a mutex locked by a different thread results in undefined
 * behavior.  Attempting to unlock an unlocked mutex results in undefined
 * behavior.  Attempting to unlock an unlocked mutex results in undefined
 * behavior.
 * behavior.
 */
 */
#define PTHREAD_MUTEX_NORMAL  1
#define PTHREAD_MUTEX_NORMAL  1
 
 
/*
/*
 * This type of mutex provides error checking. A thread attempting to
 * This type of mutex provides error checking. A thread attempting to
 * relock this mutex without first unlocking it shall return with an error.
 * relock this mutex without first unlocking it shall return with an error.
 * A thread attempting to unlock a mutex which another thread has locked
 * A thread attempting to unlock a mutex which another thread has locked
 * shall return with an error. A thread attempting to unlock an unlocked
 * shall return with an error. A thread attempting to unlock an unlocked
 * mutex shall return with an error.
 * mutex shall return with an error.
 */
 */
#define PTHREAD_MUTEX_ERRORCHECK  2 
#define PTHREAD_MUTEX_ERRORCHECK  2 
 
 
/* A thread attempting to relock this mutex without first unlocking it
/* A thread attempting to relock this mutex without first unlocking it
 * shall succeed in locking the mutex.  The relocking deadlock which can
 * shall succeed in locking the mutex.  The relocking deadlock which can
 * occur with mutexes of type PTHREAD_MUTEX_NORMAL cannot occur with this
 * occur with mutexes of type PTHREAD_MUTEX_NORMAL cannot occur with this
 * type of mutex.  Multiple locks of this mutex shall require the same
 * type of mutex.  Multiple locks of this mutex shall require the same
 * number of unlocks to release the mutex before another thread can
 * number of unlocks to release the mutex before another thread can
 * acquire the mutex. A thread attempting to unlock a mutex which another
 * acquire the mutex. A thread attempting to unlock a mutex which another
 * thread has locked shall return with an error.  A thread attempting to
 * thread has locked shall return with an error.  A thread attempting to
 * unlock an unlocked mutex shall return with an error.
 * unlock an unlocked mutex shall return with an error.
 */
 */
#define PTHREAD_MUTEX_RECURSIVE  3
#define PTHREAD_MUTEX_RECURSIVE  3
 
 
/* Attempting to recursively lock a mutex of this type results in
/* Attempting to recursively lock a mutex of this type results in
 * undefined behavior. Attempting to unlock a mutex of this type which was
 * undefined behavior. Attempting to unlock a mutex of this type which was
 * not locked by the calling thread results in undefined behavior.
 * not locked by the calling thread results in undefined behavior.
 * Attempting to unlock a mutex of this type which is not locked results
 * Attempting to unlock a mutex of this type which is not locked results
 * in undefined behavior. An implementation may map this mutex to one of
 * in undefined behavior. An implementation may map this mutex to one of
 * the other mutex types.
 * the other mutex types.
 */
 */
#define PTHREAD_MUTEX_DEFAULT  4 
#define PTHREAD_MUTEX_DEFAULT  4 
 
 
typedef struct pthread_attr_s {
typedef struct pthread_attr_s {
  int contentionscope;
  int contentionscope;
  struct sched_param schedparam;
  struct sched_param schedparam;
  int  detachstate;
  int  detachstate;
  void *stackaddr;
  void *stackaddr;
  size_t stacksize;
  size_t stacksize;
} pthread_attr_t;
} pthread_attr_t;
 
 
#define PTHREAD_STACK_MIN       200
#define PTHREAD_STACK_MIN       200
 
 
#endif /* defined(__XMK__) */
#endif /* defined(__XMK__) */
 
 
typedef struct {
typedef struct {
    int type;
    int type;
} pthread_mutexattr_t;
} pthread_mutexattr_t;
#else /* !defined(__XMK__) */
#else /* !defined(__XMK__) */
typedef __uint32_t pthread_mutex_t;      /* identify a mutex */
typedef __uint32_t pthread_mutex_t;      /* identify a mutex */
 
 
typedef struct {
typedef struct {
  int   is_initialized;
  int   is_initialized;
#if defined(_POSIX_THREAD_PROCESS_SHARED)
#if defined(_POSIX_THREAD_PROCESS_SHARED)
  int   process_shared;  /* allow mutex to be shared amongst processes */
  int   process_shared;  /* allow mutex to be shared amongst processes */
#endif
#endif
#if defined(_POSIX_THREAD_PRIO_PROTECT)
#if defined(_POSIX_THREAD_PRIO_PROTECT)
  int   prio_ceiling;
  int   prio_ceiling;
  int   protocol;
  int   protocol;
#endif
#endif
#if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES)
#if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES)
  int type;
  int type;
#endif
#endif
  int   recursive;
  int   recursive;
} pthread_mutexattr_t;
} pthread_mutexattr_t;
#endif /* !defined(__XMK__) */
#endif /* !defined(__XMK__) */
 
 
/* Condition Variables */
/* Condition Variables */
 
 
typedef __uint32_t pthread_cond_t;       /* identify a condition variable */
typedef __uint32_t pthread_cond_t;       /* identify a condition variable */
 
 
typedef struct {
typedef struct {
  int   is_initialized;
  int   is_initialized;
#if defined(_POSIX_THREAD_PROCESS_SHARED)
#if defined(_POSIX_THREAD_PROCESS_SHARED)
  int   process_shared;       /* allow this to be shared amongst processes */
  int   process_shared;       /* allow this to be shared amongst processes */
#endif
#endif
} pthread_condattr_t;         /* a condition attribute object */
} pthread_condattr_t;         /* a condition attribute object */
 
 
/* Keys */
/* Keys */
 
 
typedef __uint32_t pthread_key_t;        /* thread-specific data keys */
typedef __uint32_t pthread_key_t;        /* thread-specific data keys */
 
 
typedef struct {
typedef struct {
  int   is_initialized;  /* is this structure initialized? */
  int   is_initialized;  /* is this structure initialized? */
  int   init_executed;   /* has the initialization routine been run? */
  int   init_executed;   /* has the initialization routine been run? */
} pthread_once_t;       /* dynamic package initialization */
} pthread_once_t;       /* dynamic package initialization */
#else
#else
#if defined (__CYGWIN__)
#if defined (__CYGWIN__)
#include <cygwin/types.h>
#include <cygwin/types.h>
#endif
#endif
#endif /* defined(_POSIX_THREADS) */
#endif /* defined(_POSIX_THREADS) */
 
 
/* POSIX Barrier Types */
/* POSIX Barrier Types */
 
 
#if defined(_POSIX_BARRIERS)
#if defined(_POSIX_BARRIERS)
typedef __uint32_t pthread_barrier_t;        /* POSIX Barrier Object */
typedef __uint32_t pthread_barrier_t;        /* POSIX Barrier Object */
typedef struct {
typedef struct {
  int   is_initialized;  /* is this structure initialized? */
  int   is_initialized;  /* is this structure initialized? */
#if defined(_POSIX_THREAD_PROCESS_SHARED)
#if defined(_POSIX_THREAD_PROCESS_SHARED)
  int   process_shared;       /* allow this to be shared amongst processes */
  int   process_shared;       /* allow this to be shared amongst processes */
#endif
#endif
} pthread_barrierattr_t;
} pthread_barrierattr_t;
#endif /* defined(_POSIX_BARRIERS) */
#endif /* defined(_POSIX_BARRIERS) */
 
 
/* POSIX Spin Lock Types */
/* POSIX Spin Lock Types */
 
 
#if defined(_POSIX_SPIN_LOCKS)
#if defined(_POSIX_SPIN_LOCKS)
typedef __uint32_t pthread_spinlock_t;        /* POSIX Spin Lock Object */
typedef __uint32_t pthread_spinlock_t;        /* POSIX Spin Lock Object */
#endif /* defined(_POSIX_SPIN_LOCKS) */
#endif /* defined(_POSIX_SPIN_LOCKS) */
 
 
/* POSIX Reader/Writer Lock Types */
/* POSIX Reader/Writer Lock Types */
 
 
#if !defined (__CYGWIN__)
#if !defined (__CYGWIN__)
#if defined(_POSIX_READER_WRITER_LOCKS)
#if defined(_POSIX_READER_WRITER_LOCKS)
typedef __uint32_t pthread_rwlock_t;         /* POSIX RWLock Object */
typedef __uint32_t pthread_rwlock_t;         /* POSIX RWLock Object */
typedef struct {
typedef struct {
  int   is_initialized;       /* is this structure initialized? */
  int   is_initialized;       /* is this structure initialized? */
#if defined(_POSIX_THREAD_PROCESS_SHARED)
#if defined(_POSIX_THREAD_PROCESS_SHARED)
  int   process_shared;       /* allow this to be shared amongst processes */
  int   process_shared;       /* allow this to be shared amongst processes */
#endif
#endif
} pthread_rwlockattr_t;
} pthread_rwlockattr_t;
#endif /* defined(_POSIX_READER_WRITER_LOCKS) */
#endif /* defined(_POSIX_READER_WRITER_LOCKS) */
#endif /* __CYGWIN__ */
#endif /* __CYGWIN__ */
 
 
#endif  /* !__need_inttypes */
#endif  /* !__need_inttypes */
 
 
#undef __need_inttypes
#undef __need_inttypes
 
 
#endif  /* _SYS_TYPES_H */
#endif  /* _SYS_TYPES_H */
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.