OSDN Git Service

projects clean up 1
[pinoc/pinoc.git] / pinoc_x86 / common / typedef.h
1 #ifndef __TYPEDEF_H_
2 #define __TYPEDEF_H_
3
4 #ifndef __CODING__
5 #define __CODING__
6
7 #define FOR(si_i, si_Cnt) for(si_i = 0; ((si_i) < (si_Cnt)); (si_i++))
8
9 typedef signed int si;
10 typedef signed char s1;
11 typedef signed short int s2;
12 typedef signed long int s4;
13 typedef signed long long int s8;
14
15 typedef unsigned int ui;
16 typedef unsigned char u1;
17 typedef unsigned short int u2;
18 typedef unsigned long int u4;
19 typedef unsigned long long int u8;
20
21 typedef void vo;
22
23 // bit
24 typedef union _BYTEBIT
25 {
26         u1 byte;
27         struct{
28                 u1 b1:1;
29                 u1 b2:1;
30                 u1 b3:1;
31                 u1 b4:1;
32                 u1 b5:1;
33                 u1 b6:1;
34                 u1 b7:1;
35                 u1 b8:1;
36         };
37
38 }BYTEBIT;
39
40 typedef struct _RGB
41 {
42         u1 B;
43         u1 G;
44         u1 R;
45 }RGB;
46
47 // セグメントディスクリプタ
48 typedef struct _SEGMENT_DESCRIPTOR
49 {
50         u2 limit1;
51
52         u2 base1;
53
54         u1 p:1;
55         u1 dpl:2;
56         u1 s:1;
57         u1 type:3;
58         u1 a:1;
59
60         u1 base3;
61
62         u1 base2;
63
64         u1 g:1;
65         u1 db:1;
66         u1 no:1;
67         u1 avl:1;
68         u1 limit2:4;
69
70 } SD;
71
72 #endif
73
74 #endif
75
76 // デバッグモード切り替え
77 #define DEBUG 1