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 | */ |
---|
19 | |
---|
20 | #ifndef _TYPES_H_ |
---|
21 | #define _TYPES_H_ |
---|
22 | |
---|
23 | typedef signed char s8; |
---|
24 | typedef unsigned char u8; |
---|
25 | typedef signed short s16; |
---|
26 | typedef unsigned short u16; |
---|
27 | typedef signed int s32; |
---|
28 | typedef unsigned int u32; |
---|
29 | #ifdef __i386__ |
---|
30 | typedef signed long long s64; |
---|
31 | typedef unsigned long long u64; |
---|
32 | #elif defined(__x86_64__) || defined(__ia64__) |
---|
33 | typedef signed long s64; |
---|
34 | typedef unsigned long u64; |
---|
35 | #endif |
---|
36 | |
---|
37 | /* FreeBSD compat types */ |
---|
38 | typedef unsigned char u_char; |
---|
39 | typedef unsigned int u_int; |
---|
40 | typedef unsigned long u_long; |
---|
41 | #ifdef __i386__ |
---|
42 | typedef long long quad_t; |
---|
43 | typedef unsigned long long u_quad_t; |
---|
44 | typedef unsigned int uintptr_t; |
---|
45 | |
---|
46 | #if !defined(CONFIG_X86_PAE) |
---|
47 | typedef struct { unsigned long pte_low; } pte_t; |
---|
48 | #else |
---|
49 | typedef struct { unsigned long pte_low, pte_high; } pte_t; |
---|
50 | #endif /* CONFIG_X86_PAE */ |
---|
51 | |
---|
52 | #elif defined(__x86_64__) || defined(__ia64__) |
---|
53 | typedef long quad_t; |
---|
54 | typedef unsigned long u_quad_t; |
---|
55 | typedef unsigned long uintptr_t; |
---|
56 | |
---|
57 | typedef struct { unsigned long pte; } pte_t; |
---|
58 | #endif /* __i386__ || __x86_64__ */ |
---|
59 | |
---|
60 | typedef u8 uint8_t; |
---|
61 | typedef s8 int8_t; |
---|
62 | typedef u16 uint16_t; |
---|
63 | typedef s16 int16_t; |
---|
64 | typedef u32 uint32_t; |
---|
65 | typedef s32 int32_t; |
---|
66 | typedef u64 uint64_t; |
---|
67 | typedef s64 int64_t; |
---|
68 | |
---|
69 | |
---|
70 | #define INT_MAX ((int)(~0U>>1)) |
---|
71 | #define UINT_MAX (~0U) |
---|
72 | #endif /* _TYPES_H_ */ |
---|