1 | /*
|
---|
2 | * TOPPERS/JSP Kernel
|
---|
3 | * Toyohashi Open Platform for Embedded Real-Time Systems/
|
---|
4 | * Just Standard Profile Kernel
|
---|
5 | *
|
---|
6 | * Copyright (C) 2000-2004 by Embedded and Real-Time Systems Laboratory
|
---|
7 | * Toyohashi Univ. of Technology, JAPAN
|
---|
8 | * Copyright (C) 2000-2004 by Industrial Technology Institute,
|
---|
9 | * Miyagi Prefectural Government, JAPAN
|
---|
10 | *
|
---|
11 | * ä¸è¨è使¨©è
|
---|
12 | ã¯ï¼ä»¥ä¸ã® (1)ã(4) ã®æ¡ä»¶ãï¼Free Software Foundation
|
---|
13 | * ã«ãã£ã¦å
|
---|
14 | ¬è¡¨ããã¦ãã GNU General Public License ã® Version 2 ã«è¨
|
---|
15 | * è¿°ããã¦ããæ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§ã¢ï¼æ¬ã½ããã¦ã§ã¢
|
---|
16 | * ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ã使ç¨ã»è¤è£½ã»æ¹å¤ã»åé
|
---|
17 | å¸ï¼ä»¥ä¸ï¼
|
---|
18 | * å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
|
---|
19 | * (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
|
---|
20 | * 権表示ï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
|
---|
21 | * ã¹ã³ã¼ãä¸ã«å«ã¾ãã¦ãããã¨ï¼
|
---|
22 | * (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
|
---|
23 | * ç¨ã§ããå½¢ã§åé
|
---|
24 | å¸ããå ´åã«ã¯ï¼åé
|
---|
25 | å¸ã«ä¼´ãããã¥ã¡ã³ãï¼å©ç¨
|
---|
26 | * è
|
---|
27 | ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è使¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
|
---|
28 | * ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
|
---|
29 | * (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
|
---|
30 | * ç¨ã§ããªãå½¢ã§åé
|
---|
31 | å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
|
---|
32 | * ã¨ï¼
|
---|
33 | * (a) åé
|
---|
34 | å¸ã«ä¼´ãããã¥ã¡ã³ãï¼å©ç¨è
|
---|
35 | ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
|
---|
36 | * 使¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
|
---|
37 | * (b) åé
|
---|
38 | å¸ã®å½¢æ
|
---|
39 | ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSããã¸ã§ã¯ãã«
|
---|
40 | * å ±åãããã¨ï¼
|
---|
41 | * (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
|
---|
42 | * 害ãããï¼ä¸è¨è使¨©è
|
---|
43 | ããã³TOPPERSããã¸ã§ã¯ããå
|
---|
44 | 責ãããã¨ï¼
|
---|
45 | *
|
---|
46 | * æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨è使¨©è
|
---|
47 | ã
|
---|
48 | * ãã³TOPPERSããã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ãã®é©ç¨å¯è½æ§ã
|
---|
49 | * å«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´
|
---|
50 | * æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ãã®è²¬ä»»ãè² ããªãï¼
|
---|
51 | */
|
---|
52 |
|
---|
53 | #ifndef _UTIL_H_
|
---|
54 | #define _UTIL_H_
|
---|
55 |
|
---|
56 | /*
|
---|
57 | * ãããçªå·ã®å®ç¾©
|
---|
58 | * ãæ³¨æï¼PowerPCã®ãããçªå·ã¯é常ã¨éã«ãªã£ã¦ãã
|
---|
59 | * ããããã¾ãã32ãããã¬ã¸ã¹ã¿ã¨16ãããã¬ã¸ã¹ã¿ã§ã¯
|
---|
60 | * ããããæä¸ä½ãããã®ãããçªå·ãç°ãªãç¹ã«ã注æ
|
---|
61 | */
|
---|
62 |
|
---|
63 | /* 32ãããã¬ã¸ã¹ã¿ç¨ */
|
---|
64 | #define BIT0_32 0x80000000
|
---|
65 | #define BIT1_32 0x40000000
|
---|
66 | #define BIT2_32 0x20000000
|
---|
67 | #define BIT3_32 0x10000000
|
---|
68 | #define BIT4_32 0x8000000
|
---|
69 | #define BIT5_32 0x4000000
|
---|
70 | #define BIT6_32 0x2000000
|
---|
71 | #define BIT7_32 0x1000000
|
---|
72 | #define BIT8_32 0x800000
|
---|
73 | #define BIT9_32 0x400000
|
---|
74 | #define BIT10_32 0x200000
|
---|
75 | #define BIT11_32 0x100000
|
---|
76 | #define BIT12_32 0x80000
|
---|
77 | #define BIT13_32 0x40000
|
---|
78 | #define BIT14_32 0x20000
|
---|
79 | #define BIT15_32 0x10000
|
---|
80 | #define BIT16_32 0x8000
|
---|
81 | #define BIT17_32 0x4000
|
---|
82 | #define BIT18_32 0x2000
|
---|
83 | #define BIT19_32 0x1000
|
---|
84 | #define BIT20_32 0x800
|
---|
85 | #define BIT21_32 0x400
|
---|
86 | #define BIT22_32 0x200
|
---|
87 | #define BIT23_32 0x100
|
---|
88 | #define BIT24_32 0x80
|
---|
89 | #define BIT25_32 0x40
|
---|
90 | #define BIT26_32 0x20
|
---|
91 | #define BIT27_32 0x10
|
---|
92 | #define BIT28_32 0x8
|
---|
93 | #define BIT29_32 0x4
|
---|
94 | #define BIT30_32 0x2
|
---|
95 | #define BIT31_32 0x1
|
---|
96 |
|
---|
97 | /* 16ãããã¬ã¸ã¹ã¿ç¨ */
|
---|
98 | #define BIT0_16 0x8000
|
---|
99 | #define BIT1_16 0x4000
|
---|
100 | #define BIT2_16 0x2000
|
---|
101 | #define BIT3_16 0x1000
|
---|
102 | #define BIT4_16 0x800
|
---|
103 | #define BIT5_16 0x400
|
---|
104 | #define BIT6_16 0x200
|
---|
105 | #define BIT7_16 0x100
|
---|
106 | #define BIT8_16 0x80
|
---|
107 | #define BIT9_16 0x40
|
---|
108 | #define BIT10_16 0x20
|
---|
109 | #define BIT11_16 0x10
|
---|
110 | #define BIT12_16 0x8
|
---|
111 | #define BIT13_16 0x4
|
---|
112 | #define BIT14_16 0x2
|
---|
113 | #define BIT15_16 0x1
|
---|
114 |
|
---|
115 | /* 8ãããã¬ã¸ã¹ã¿ç¨ */
|
---|
116 | #define BIT0_8 0x80
|
---|
117 | #define BIT1_8 0x40
|
---|
118 | #define BIT2_8 0x20
|
---|
119 | #define BIT3_8 0x10
|
---|
120 | #define BIT4_8 0x8
|
---|
121 | #define BIT5_8 0x4
|
---|
122 | #define BIT6_8 0x2
|
---|
123 | #define BIT7_8 0x1
|
---|
124 |
|
---|
125 | /* ã·ã³ãã«åã®æååå */
|
---|
126 | #define _TO_STRING(arg) #arg
|
---|
127 | #define TO_STRING(arg) _TO_STRING(arg)
|
---|
128 |
|
---|
129 | #endif /* _UTIL_H_ */
|
---|
130 | /* end of file */
|
---|