patch-1.3.48 linux/include/asm-mips/types.h
Next file: linux/include/asm-mips/unistd.h
Previous file: linux/include/asm-mips/termios.h
Back to the patch index
Back to the overall index
- Lines: 133
- Date:
Wed Dec 13 12:39:47 1995
- Orig file:
v1.3.47/linux/include/asm-mips/types.h
- Orig date:
Tue Jan 10 03:34:06 1995
diff -u --recursive --new-file v1.3.47/linux/include/asm-mips/types.h linux/include/asm-mips/types.h
@@ -1,19 +1,39 @@
+/*
+ * include/asm-mips/types.h
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1994, 1995 by Waldorf GMBH
+ * written by Ralf Baechle
+ */
#ifndef __ASM_MIPS_TYPES_H
#define __ASM_MIPS_TYPES_H
#ifndef _SIZE_T
#define _SIZE_T
-typedef unsigned long size_t;
+typedef __SIZE_TYPE__ size_t;
#endif
#ifndef _SSIZE_T
#define _SSIZE_T
-typedef long ssize_t;
+typedef __SSIZE_TYPE__ ssize_t;
#endif
#ifndef _PTRDIFF_T
#define _PTRDIFF_T
-typedef long ptrdiff_t;
+typedef __PTRDIFF_TYPE__ ptrdiff_t;
+#endif
+
+#ifndef _TIME_T
+#define _TIME_T
+typedef long time_t;
+#endif
+
+#ifndef _CLOCK_T
+#define _CLOCK_T
+typedef long clock_t;
#endif
/*
@@ -55,8 +75,8 @@
typedef __signed short s16;
typedef unsigned short u16;
-typedef __signed long s32;
-typedef unsigned long u32;
+typedef __signed int s32;
+typedef unsigned int u32;
#if ((~0UL) == 0xffffffff)
@@ -74,20 +94,65 @@
#endif /* __KERNEL__ */
+typedef __s32 pid_t;
+typedef __s32 uid_t;
+typedef __s32 gid_t;
+typedef __u32 dev_t;
+typedef __u32 ino_t;
+typedef __u32 mode_t;
+typedef __u32 umode_t;
+typedef __u32 nlink_t;
+typedef long daddr_t;
+typedef long off_t;
+
+#undef __FD_SET
+static __inline__ void __FD_SET(unsigned long fd, fd_set *fdsetp)
+{
+ unsigned long _tmp = fd / __NFDBITS;
+ unsigned long _rem = fd % __NFDBITS;
+ fdsetp->fds_bits[_tmp] |= (1UL<<_rem);
+}
+
+#undef __FD_CLR
+static __inline__ void __FD_CLR(unsigned long fd, fd_set *fdsetp)
+{
+ unsigned long _tmp = fd / __NFDBITS;
+ unsigned long _rem = fd % __NFDBITS;
+ fdsetp->fds_bits[_tmp] &= ~(1UL<<_rem);
+}
+
+#undef __FD_ISSET
+static __inline__ int __FD_ISSET(unsigned long fd, fd_set *p)
+{
+ unsigned long _tmp = fd / __NFDBITS;
+ unsigned long _rem = fd % __NFDBITS;
+ return (p->fds_bits[_tmp] & (1UL<<_rem)) != 0;
+}
+
/*
- * These definitions double the definitions from <gnu/types.h>.
+ * This will unroll the loop for the normal constant case (8 ints,
+ * for a 256-bit fd_set)
*/
-#undef __FDELT
-#define __FDELT(d) ((d) / __NFDBITS)
-#undef __FDMASK
-#define __FDMASK(d) (1 << ((d) % __NFDBITS))
-#undef __FD_SET
-#define __FD_SET(d, set) ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d))
-#undef __FD_CLR
-#define __FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d))
-#undef __FD_ISSET
-#define __FD_ISSET(d, set) ((set)->fds_bits[__FDELT(d)] & __FDMASK(d))
-#undef __FD_ZERO
-#define __FD_ZERO(fdsetp) (memset (fdsetp, 0, sizeof(*(fd_set *)fdsetp)))
+#undef __FD_ZERO
+static __inline__ void __FD_ZERO(fd_set *p)
+{
+ unsigned int *tmp = p->fds_bits;
+ int i;
+
+ if (__builtin_constant_p(__FDSET_INTS)) {
+ switch (__FDSET_INTS) {
+ case 8:
+ tmp[0] = 0; tmp[1] = 0; tmp[2] = 0; tmp[3] = 0;
+ tmp[4] = 0; tmp[5] = 0; tmp[6] = 0; tmp[7] = 0;
+ return;
+ }
+ }
+ i = __FDSET_INTS;
+ while (i) {
+ i--;
+ *tmp = 0;
+ tmp++;
+ }
+}
#endif /* __ASM_MIPS_TYPES_H */
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov
with Sam's (original) version of this