os161-1.99
 All Data Structures
types.h
00001 /*
00002  * Copyright (c) 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2009
00003  *      The President and Fellows of Harvard College.
00004  *
00005  * Redistribution and use in source and binary forms, with or without
00006  * modification, are permitted provided that the following conditions
00007  * are met:
00008  * 1. Redistributions of source code must retain the above copyright
00009  *    notice, this list of conditions and the following disclaimer.
00010  * 2. Redistributions in binary form must reproduce the above copyright
00011  *    notice, this list of conditions and the following disclaimer in the
00012  *    documentation and/or other materials provided with the distribution.
00013  * 3. Neither the name of the University nor the names of its contributors
00014  *    may be used to endorse or promote products derived from this software
00015  *    without specific prior written permission.
00016  *
00017  * THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY AND CONTRIBUTORS ``AS IS'' AND
00018  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00019  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00020  * ARE DISCLAIMED.  IN NO EVENT SHALL THE UNIVERSITY OR CONTRIBUTORS BE LIABLE
00021  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00022  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
00023  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00024  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00025  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00026  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00027  * SUCH DAMAGE.
00028  */
00029 
00030 #ifndef _KERN_MIPS_TYPES_H_
00031 #define _KERN_MIPS_TYPES_H_
00032 
00033 /*
00034  * Machine-dependent types visible to userland.
00035  * (Kernel-only types should go in mips/types.h.)
00036  * 32-bit MIPS version.
00037  *
00038  * See kern/types.h for an explanation of the underscores.
00039  */
00040 
00041 
00042 /* Sized integer types, with convenient short names */
00043 typedef char      __i8;                 /* 8-bit signed integer */
00044 typedef short     __i16;                /* 16-bit signed integer */
00045 typedef int       __i32;                /* 32-bit signed integer */
00046 typedef long long __i64;                /* 64-bit signed integer */
00047 
00048 typedef unsigned char      __u8;        /* 8-bit unsigned integer */
00049 typedef unsigned short     __u16;       /* 16-bit unsigned integer */
00050 typedef unsigned int       __u32;       /* 32-bit unsigned integer */
00051 typedef unsigned long long __u64;       /* 64-bit unsigned integer */
00052 
00053 /* Further standard C types */
00054 typedef long __intptr_t;                /* Signed pointer-sized integer */
00055 typedef unsigned long __uintptr_t;      /* Unsigned pointer-sized integer */
00056 
00057 /*
00058  * Since we're a 32-bit platform, size_t, ssize_t, and ptrdiff_t can
00059  * correctly be either (unsigned) int or (unsigned) long. However, if we
00060  * don't define it to the same one gcc is using, gcc will get
00061  * upset. If you switch compilers and see otherwise unexplicable type
00062  * errors involving size_t, try changing this.
00063  */
00064 #if 1
00065 typedef unsigned __size_t;              /* Size of a memory region */
00066 typedef int __ssize_t;                  /* Signed type of same size */
00067 typedef int __ptrdiff_t;                /* Difference of two pointers */
00068 #else
00069 typedef unsigned long __size_t;         /* Size of a memory region */
00070 typedef long __ssize_t;                 /* Signed type of same size */
00071 typedef long __ptrdiff_t;               /* Difference of two pointers */
00072 #endif
00073 
00074 /* Number of bits per byte. */
00075 #define __CHAR_BIT  8
00076 
00077 
00078 #endif /* _KERN_MIPS_TYPES_H_ */
 All Data Structures