#include <stddef.h>\r
#include "internal.h"\r
\r
+#if defined(__GNUC__)\r
#define DECLARE(sym,val) \\r
__asm("#define\t" #sym "\t%0" : : "n" ((val)))\r
\r
void asm_foo(void) {\r
- DECLARE(PCB_STACK_CURR_P, offsetof(OsTaskVarType, stack));\r
+#elif defined(__CWCC__)\r
+#define DECLARE(_var,_offset) \\r
+ __declspec(section ".apa") char _var[100+ (_offset)]\r
+#pragma section ".apa" ".apa"\r
+#endif\r
+DECLARE(PCB_STACK_CURR_P, offsetof(OsTaskVarType, stack));\r
DECLARE(PCB_CONST_P, offsetof(OsTaskVarType, constPtr));\r
// DECLARE(PCB_ENTRY_P, offsetof(OsTaskVarType, entry));\r
DECLARE(SYS_CURR_PCB_P, offsetof(Os_SysType, currTaskPtr));\r
DECLARE(SYS_INT_NEST_CNT, offsetof(Os_SysType, intNestCnt));\r
DECLARE(SYS_INT_STACK, offsetof(Os_SysType, intStack));\r
+#if defined(__GNUC__)\r
}\r
-\r
-\r
+#endif\r
\r