UCOS_TI_LM3S_Keil
 全部 结构体 文件 函数 变量 类型定义 宏定义 
cpu_def.h
浏览该文件的文档.
1 /*
2 *********************************************************************************************************
3 * uC/CPU
4 * CPU CONFIGURATION & PORT LAYER
5 *
6 * (c) Copyright 2004-2009; Micrium, Inc.; Weston, FL
7 *
8 * All rights reserved. Protected by international copyright laws.
9 *
10 * uC/CPU is provided in source form for FREE evaluation, for educational
11 * use or peaceful research. If you plan on using uC/CPU in a commercial
12 * product you need to contact Micrium to properly license its use in your
13 * product. We provide ALL the source code for your convenience and to
14 * help you experience uC/CPU. The fact that the source code is provided
15 * does NOT mean that you can use it without paying a licensing fee.
16 *
17 * Knowledge of the source code may NOT be used to develop a similar product.
18 *
19 * Please help us continue to provide the Embedded community with the finest
20 * software available. Your honesty is greatly appreciated.
21 *********************************************************************************************************
22 */
23 
24 /*
25 *********************************************************************************************************
26 *
27 * CPU CONFIGURATION DEFINES
28 *
29 * Filename : cpu_def.h
30 * Version : V1.23
31 * Programmer(s) : ITJ
32 *********************************************************************************************************
33 */
34 
35 
36 /*
37 *********************************************************************************************************
38 * MODULE
39 *********************************************************************************************************
40 */
41 
42 #ifndef CPU_DEF_MODULE_PRESENT
43 #define CPU_DEF_MODULE_PRESENT
44 
45 
46 /*
47 *********************************************************************************************************
48 * CPU WORD CONFIGURATION
49 *
50 * Note(s) : (1) Configure CPU_CFG_ADDR_SIZE & CPU_CFG_DATA_SIZE in 'cpu.h' with CPU's word sizes :
51 *
52 * CPU_WORD_SIZE_08 8-bit word size
53 * CPU_WORD_SIZE_16 16-bit word size
54 * CPU_WORD_SIZE_32 32-bit word size
55 * CPU_WORD_SIZE_64 64-bit word size See Note #1a
56 *
57 * (a) 64-bit word size NOT currently supported.
58 *
59 * (2) Configure CPU_CFG_ENDIAN_TYPE in 'cpu.h' with CPU's data-word-memory order :
60 *
61 * (a) CPU_ENDIAN_TYPE_BIG Big- endian word order (CPU words' most significant
62 * octet @ lowest memory address)
63 * (b) CPU_ENDIAN_TYPE_LITTLE Little-endian word order (CPU words' least significant
64 * octet @ lowest memory address)
65 *********************************************************************************************************
66 */
67 
68  /* ---------------------- CPU WORD SIZE ----------------------- */
69 #define CPU_WORD_SIZE_08 1 /* 8-bit word size (in octets). */
70 #define CPU_WORD_SIZE_16 2 /* 16-bit word size (in octets). */
71 #define CPU_WORD_SIZE_32 4 /* 32-bit word size (in octets). */
72 #define CPU_WORD_SIZE_64 8 /* 64-bit word size (in octets) [see Note #1a]. */
73 
74 
75  /* ------------------ CPU WORD-ENDIAN ORDER ------------------- */
76 #define CPU_ENDIAN_TYPE_NONE 0
77 #define CPU_ENDIAN_TYPE_BIG 1 /* Big- endian word order (see Note #1a). */
78 #define CPU_ENDIAN_TYPE_LITTLE 2 /* Little-endian word order (see Note #1b). */
79 
80 
81 /*
82 *********************************************************************************************************
83 * CPU STACK CONFIGURATION
84 *
85 * Note(s) : (1) Configure CPU_CFG_STK_GROWTH in 'cpu.h' with CPU's stack growth order :
86 *
87 * (a) CPU_STK_GROWTH_LO_TO_HI CPU stack pointer increments to the next higher stack
88 * memory address after data is pushed onto the stack
89 * (b) CPU_STK_GROWTH_HI_TO_LO CPU stack pointer decrements to the next lower stack
90 * memory address after data is pushed onto the stack
91 *********************************************************************************************************
92 */
93 
94  /* ------------------ CPU STACK GROWTH ORDER ------------------ */
95 #define CPU_STK_GROWTH_NONE 0
96 #define CPU_STK_GROWTH_LO_TO_HI 1 /* CPU stk incs towards higher mem addrs (see Note #1a). */
97 #define CPU_STK_GROWTH_HI_TO_LO 2 /* CPU stk decs towards lower mem addrs (see Note #1b). */
98 
99 
100 /*$PAGE*/
101 /*
102 *********************************************************************************************************
103 * CRITICAL SECTION CONFIGURATION
104 *
105 * Note(s) : (1) Configure CPU_CFG_CRITICAL_METHOD with CPU's/compiler's critical section method :
106 *
107 * Enter/Exit critical sections by ...
108 *
109 * CPU_CRITICAL_METHOD_INT_DIS_EN Disable/Enable interrupts
110 * CPU_CRITICAL_METHOD_STATUS_STK Push/Pop interrupt status onto stack
111 * CPU_CRITICAL_METHOD_STATUS_LOCAL Save/Restore interrupt status to local variable
112 *
113 * (a) CPU_CRITICAL_METHOD_INT_DIS_EN is NOT a preferred method since it does NOT support
114 * multiple levels of interrupts. However, with some CPUs/compilers, this is the only
115 * available method.
116 *
117 * (b) CPU_CRITICAL_METHOD_STATUS_STK is one preferred method since it supports multiple
118 * levels of interrupts. However, this method assumes that the compiler provides C-level
119 * &/or assembly-level functionality for the following :
120 *
121 * ENTER CRITICAL SECTION :
122 * (1) Push/save interrupt status onto a local stack
123 * (2) Disable interrupts
124 *
125 * EXIT CRITICAL SECTION :
126 * (3) Pop/restore interrupt status from a local stack
127 *
128 * (c) CPU_CRITICAL_METHOD_STATUS_LOCAL is one preferred method since it supports multiple
129 * levels of interrupts. However, this method assumes that the compiler provides C-level
130 * &/or assembly-level functionality for the following :
131 *
132 * ENTER CRITICAL SECTION :
133 * (1) Save interrupt status into a local variable
134 * (2) Disable interrupts
135 *
136 * EXIT CRITICAL SECTION :
137 * (3) Restore interrupt status from a local variable
138 *
139 * (2) Critical section macro's most likely require inline assembly. If the compiler does NOT
140 * allow inline assembly in C source files, critical section macro's MUST call an assembly
141 * subroutine defined in a 'cpu_a.asm' file located in the following software directory :
142 *
143 * <CPU-Compiler Directory><cpu><compiler>\
144 *
145 * where
146 * <CPU-Compiler Directory> directory path for common CPU-compiler software
147 * <cpu> directory name for specific CPU
148 * <compiler> directory name for specific compiler
149 *
150 * (3) (a) To save/restore interrupt status, a local variable 'cpu_sr' of type 'CPU_SR' MAY need
151 * to be declared (e.g. if 'CPU_CRITICAL_METHOD_STATUS_LOCAL' method is configured).
152 *
153 * (1) 'cpu_sr' local variable SHOULD be declared via the CPU_SR_ALLOC() macro which,
154 * if used, MUST be declared following ALL other local variables (see any 'cpu.h
155 * CRITICAL SECTION CONFIGURATION Note #3a1').
156 *
157 * (b) Configure 'CPU_SR' data type with the appropriate-sized CPU data type large enough to
158 * completely store the CPU's/compiler's status word.
159 *********************************************************************************************************
160 */
161 
162  /* --------------- CPU CRITICAL SECTION METHODS --------------- */
163 #define CPU_CRITICAL_METHOD_NONE 0 /* */
164 #define CPU_CRITICAL_METHOD_INT_DIS_EN 1 /* DIS/EN ints (see Note #1a). */
165 #define CPU_CRITICAL_METHOD_STATUS_STK 2 /* Push/Pop int status onto stk (see Note #1b). */
166 #define CPU_CRITICAL_METHOD_STATUS_LOCAL 3 /* Save/Restore int status to local var (see Note #1c). */
167 
168 
169 /*$PAGE*/
170 /*
171 *********************************************************************************************************
172 * MODULE END
173 *********************************************************************************************************
174 */
175 
176 #endif /* End of CPU definition module include. */
177