The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/include/asm-alpha/posix_types.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 #ifndef _ALPHA_POSIX_TYPES_H
    2 #define _ALPHA_POSIX_TYPES_H
    3 
    4 /*
    5  * This file is generally used by user-level software, so you need to
    6  * be a little careful about namespace pollution etc.  Also, we cannot
    7  * assume GCC is being used.
    8  */
    9 
   10 typedef unsigned int    __kernel_dev_t;
   11 typedef unsigned int    __kernel_ino_t;
   12 typedef unsigned int    __kernel_mode_t;
   13 typedef unsigned int    __kernel_nlink_t;
   14 typedef long            __kernel_off_t;
   15 typedef long            __kernel_loff_t;
   16 typedef int             __kernel_pid_t;
   17 typedef int             __kernel_ipc_pid_t;
   18 typedef unsigned int    __kernel_uid_t;
   19 typedef unsigned int    __kernel_gid_t;
   20 typedef unsigned long   __kernel_size_t;
   21 typedef long            __kernel_ssize_t;
   22 typedef long            __kernel_ptrdiff_t;
   23 typedef long            __kernel_time_t;
   24 typedef long            __kernel_suseconds_t;
   25 typedef long            __kernel_clock_t;
   26 typedef int             __kernel_daddr_t;
   27 typedef char *          __kernel_caddr_t;
   28 typedef unsigned long   __kernel_sigset_t;      /* at least 32 bits */
   29 typedef unsigned short  __kernel_uid16_t;
   30 typedef unsigned short  __kernel_gid16_t;
   31 
   32 typedef struct {
   33         int     val[2];
   34 } __kernel_fsid_t;
   35 
   36 typedef __kernel_uid_t __kernel_old_uid_t;
   37 typedef __kernel_gid_t __kernel_old_gid_t;
   38 typedef __kernel_uid_t __kernel_uid32_t;
   39 typedef __kernel_gid_t __kernel_gid32_t;
   40 
   41 #ifdef __KERNEL__
   42 
   43 #ifndef __GNUC__
   44 
   45 #define __FD_SET(d, set)        ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d))
   46 #define __FD_CLR(d, set)        ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d))
   47 #define __FD_ISSET(d, set)      (((set)->fds_bits[__FDELT(d)] & __FDMASK(d)) != 0)
   48 #define __FD_ZERO(set)  \
   49   ((void) memset ((__ptr_t) (set), 0, sizeof (__kernel_fd_set)))
   50 
   51 #else /* __GNUC__ */
   52 
   53 /* With GNU C, use inline functions instead so args are evaluated only once: */
   54 
   55 #undef __FD_SET
   56 static __inline__ void __FD_SET(unsigned long fd, __kernel_fd_set *fdsetp)
   57 {
   58         unsigned long _tmp = fd / __NFDBITS;
   59         unsigned long _rem = fd % __NFDBITS;
   60         fdsetp->fds_bits[_tmp] |= (1UL<<_rem);
   61 }
   62 
   63 #undef __FD_CLR
   64 static __inline__ void __FD_CLR(unsigned long fd, __kernel_fd_set *fdsetp)
   65 {
   66         unsigned long _tmp = fd / __NFDBITS;
   67         unsigned long _rem = fd % __NFDBITS;
   68         fdsetp->fds_bits[_tmp] &= ~(1UL<<_rem);
   69 }
   70 
   71 #undef __FD_ISSET
   72 static __inline__ int __FD_ISSET(unsigned long fd, const __kernel_fd_set *p)
   73 { 
   74         unsigned long _tmp = fd / __NFDBITS;
   75         unsigned long _rem = fd % __NFDBITS;
   76         return (p->fds_bits[_tmp] & (1UL<<_rem)) != 0;
   77 }
   78 
   79 /*
   80  * This will unroll the loop for the normal constant case (8 ints,
   81  * for a 256-bit fd_set)
   82  */
   83 #undef __FD_ZERO
   84 static __inline__ void __FD_ZERO(__kernel_fd_set *p)
   85 {
   86         unsigned long *tmp = p->fds_bits;
   87         int i;
   88 
   89         if (__builtin_constant_p(__FDSET_LONGS)) {
   90                 switch (__FDSET_LONGS) {
   91                       case 16:
   92                         tmp[ 0] = 0; tmp[ 1] = 0; tmp[ 2] = 0; tmp[ 3] = 0;
   93                         tmp[ 4] = 0; tmp[ 5] = 0; tmp[ 6] = 0; tmp[ 7] = 0;
   94                         tmp[ 8] = 0; tmp[ 9] = 0; tmp[10] = 0; tmp[11] = 0;
   95                         tmp[12] = 0; tmp[13] = 0; tmp[14] = 0; tmp[15] = 0;
   96                         return;
   97 
   98                       case 8:
   99                         tmp[ 0] = 0; tmp[ 1] = 0; tmp[ 2] = 0; tmp[ 3] = 0;
  100                         tmp[ 4] = 0; tmp[ 5] = 0; tmp[ 6] = 0; tmp[ 7] = 0;
  101                         return;
  102 
  103                       case 4:
  104                         tmp[ 0] = 0; tmp[ 1] = 0; tmp[ 2] = 0; tmp[ 3] = 0;
  105                         return;
  106                 }
  107         }
  108         i = __FDSET_LONGS;
  109         while (i) {
  110                 i--;
  111                 *tmp = 0;
  112                 tmp++;
  113         }
  114 }
  115 
  116 #endif /* __GNUC__ */
  117 
  118 #endif /* __KERNEL__ */
  119 
  120 #endif /* _ALPHA_POSIX_TYPES_H */

Cache object: 2318a758b6aaf0d2bb9ebdefe56dcd79


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.