home *** CD-ROM | disk | FTP | other *** search
- /*
- * @(#) types.h 2.3 88/06/21
- *
- * Copyright (C) The Santa Cruz Operation, 1984, 1985, 1986, 1987, 1988.
- * Copyright (C) Microsoft Corporation, 1984, 1985, 1986, 1987, 1988.
- * This Module contains Proprietary Information of
- * The Santa Cruz Operation, Microsoft Corporation
- * and AT&T, and should be treated as Confidential.
- */
-
- /*
- * THIS FILE CONTAINS CODE WHICH IS SPECIFIC TO THE
- * INTEL 80286 CPU AND MAY REQUIRE MODIFICATION
- * WHEN ADAPTING XENIX TO NEW HARDWARE.
- */
-
- typedef struct { int r[1]; } *physadr;
- typedef long daddr_t;
- typedef char *caddr_t;
- typedef unsigned short ushort;
- typedef unsigned short ino_t;
- typedef char cnt_t;
- typedef long time_t;
- #ifdef M_I386
- typedef int label_t[6]; /* return, sp, si, di, bp */
- #else
- typedef int label_t[6]; /* return, sp, si, di, bp */
- #endif
- typedef short dev_t;
- typedef long off_t;
- typedef unsigned long paddr_t;
- typedef unsigned short mloc_t; /* memory region location */
- typedef unsigned short msize_t; /* memory region size */
- typedef long key_t; /* IPC key */
- typedef int pfn_t;
- typedef unsigned int uint;
-
- #ifdef M_I386
- #define inodep_t struct inode *
- #define inodepp_t struct inode **
- #define filep_t struct file *
- #else
- #define inodep_t struct inode far *
- #define inodepp_t struct inode far * far *
- #define filep_t struct file far *
- #endif
-
-
- /* 80286 special types */
-
- #ifdef M_I286
- #define faddr_t char far *
- #define fdesc_t struct desctab far /* far ldt entry */
- #else
- #define faddr_t char * /* same as caddr_t for 8086/386 */
- #endif
-
-
- /* 'void' type compatibility */
- #ifdef M_OLDVOID
- typedef int void;
- #endif
-
- /* 'unsigned' type compatibility */
- #ifdef M_OLDSIGN /* { */
-
- typedef char uchar_t;
- typedef long ulong_t;
-
- #define GETUCHAR(uc) (0xff & (uc)) /* extract value */
- /* WARNING: you will lose the high bit */
- #define GETULONG(ul) (0x7fffffffL & (ul)) /* extract value */
-
- #else /* }{ */
-
- typedef unsigned char uchar_t;
- typedef unsigned long ulong_t;
- #define GETUCHAR(uc) (uc)
- #define GETULONG(ul) (ul)
-
- #endif /* } */
-
- struct saddr {
- unsigned short sa_seg;
- long sa_off;
- };
-
- #define NBBY 8 /* number of bits in a byte */
-
- /*
- * Select uses bit masks of file descriptors in longs.
- * These macros manipulate such bit fields (the filesystem macros use chars).
- * FD_SETSIZE may be defined by the user, but the default here
- * should be >= NOFILE (param.h).
- */
- #ifndef FD_SETSIZE
- #define FD_SETSIZE 60
- #endif
-
- typedef long fd_mask;
- #define NFDBITS (sizeof(fd_mask) * NBBY) /* bits per mask */
- #ifndef howmany
- #define howmany(x, y) (((x)+((y)-1))/(y))
- #endif
-
- typedef struct fd_set {
- fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)];
- } fd_set;
-
- #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_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1L << ((n) % NFDBITS)))
- #define FD_ZERO(p) bzero((caddr_t)(p), sizeof(*(p)))
-