debuggers.hg

view extras/mini-os/include/types.h @ 0:7d21f7218375

Exact replica of unstable on 051908 + README-this
author Mukesh Rathor
date Mon May 19 15:34:57 2008 -0700 (2008-05-19)
parents
children 5c0bf00e371d
line source
1 /* -*- Mode:C; c-basic-offset:4; tab-width:4 -*-
2 ****************************************************************************
3 * (C) 2003 - Rolf Neugebauer - Intel Research Cambridge
4 ****************************************************************************
5 *
6 * File: types.h
7 * Author: Rolf Neugebauer (neugebar@dcs.gla.ac.uk)
8 * Changes:
9 *
10 * Date: May 2003
11 *
12 * Environment: Xen Minimal OS
13 * Description: a random collection of type definitions
14 *
15 ****************************************************************************
16 * $Id: h-insert.h,v 1.4 2002/11/08 16:03:55 rn Exp $
17 ****************************************************************************
18 */
20 #ifndef _TYPES_H_
21 #define _TYPES_H_
22 #include <stddef.h>
24 typedef signed char s8;
25 typedef unsigned char u8;
26 typedef signed short s16;
27 typedef unsigned short u16;
28 typedef signed int s32;
29 typedef unsigned int u32;
30 #ifdef __i386__
31 typedef signed long long s64;
32 typedef unsigned long long u64;
33 #elif defined(__x86_64__) || defined(__ia64__)
34 typedef signed long s64;
35 typedef unsigned long u64;
36 #endif
38 /* FreeBSD compat types */
39 typedef unsigned char u_char;
40 typedef unsigned int u_int;
41 typedef unsigned long u_long;
42 #ifdef __i386__
43 typedef long long quad_t;
44 typedef unsigned long long u_quad_t;
46 typedef struct { unsigned long pte_low, pte_high; } pte_t;
48 #elif defined(__x86_64__) || defined(__ia64__)
49 typedef long quad_t;
50 typedef unsigned long u_quad_t;
52 typedef struct { unsigned long pte; } pte_t;
53 #endif /* __i386__ || __x86_64__ */
55 #ifdef __x86_64__
56 #define __pte(x) ((pte_t) { (x) } )
57 #else
58 #define __pte(x) ({ unsigned long long _x = (x); \
59 ((pte_t) {(unsigned long)(_x), (unsigned long)(_x>>32)}); })
60 #endif
62 #ifdef HAVE_LIBC
63 #include <limits.h>
64 #include <stdint.h>
65 #else
66 #ifdef __i386__
67 typedef unsigned int uintptr_t;
68 typedef int intptr_t;
69 #elif defined(__x86_64__) || defined(__ia64__)
70 typedef unsigned long uintptr_t;
71 typedef long intptr_t;
72 #endif /* __i386__ || __x86_64__ */
73 typedef u8 uint8_t;
74 typedef s8 int8_t;
75 typedef u16 uint16_t;
76 typedef s16 int16_t;
77 typedef u32 uint32_t;
78 typedef s32 int32_t;
79 typedef u64 uint64_t, uintmax_t;
80 typedef s64 int64_t, intmax_t;
81 typedef u64 off_t;
84 #define INT_MAX ((int)(~0U>>1))
85 #define UINT_MAX (~0U)
87 typedef long ssize_t;
88 #endif
89 #endif /* _TYPES_H_ */