Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


(no commit message)
[palacios.git] / palacios / include / geekos / ktypes.h
1 /*
2  * Kernel data types
3  * Copyright (c) 2001,2003 David H. Hovemeyer <daveho@cs.umd.edu>
4  * $Revision: 1.1.1.1 $
5  * 
6  * This is free software.  You are permitted to use,
7  * redistribute, and modify it as specified in the file "COPYING".
8  */
9
10 #ifndef GEEKOS_KTYPES_H
11 #define GEEKOS_KTYPES_H
12
13 /*
14  * GeekOS uses the C99 bool type, with true and false
15  * constant values.
16  */
17 #include <stdbool.h>
18
19 /*
20  * Shorthand for commonly used integer types.
21  */
22 typedef unsigned long ulong_t;
23 typedef unsigned int uint_t;
24 typedef unsigned short ushort_t;
25 typedef unsigned char uchar_t;
26 typedef unsigned  long long ullong_t;
27
28 /*
29  * MIN() and MAX() macros.
30  * By using gcc extensions, they are type-correct and
31  * evaulate their arguments only once.
32  */
33 #define MIN(a,b) ({typeof (a) _a = (a); typeof (b) _b = (b); (_a < _b) ? _a : _b; })
34 #define MAX(a,b) ({typeof (a) _a = (a); typeof (b) _b = (b); (_a < _b) ? _a : _b; })
35
36 /*
37  * Some ASCII character access and manipulation macros.
38  */
39 #define ISDIGIT(c) ((c) >= '0' && (c) <= '9')
40 #define TOLOWER(c) (((c) >= 'A' && (c) <= 'Z') ? ((c) + ('a' - 'A')) : (c))
41 #define TOUPPER(c) (((c) >= 'a' && (c) <= 'z') ? ((c) - ('a' - 'A')) : (c))
42
43 #endif  /* GEEKOS_KTYPES_H */