X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=cpu%2Ftypes.h;h=187d45f14be1f08798e5f61eeeacb2489b14e0ab;hb=1fc31f45bcec8bc23a5924ae5b288439abca8ded;hp=985dbe6bf170580bc9b0f78ec79e0f30d1c11646;hpb=efbdba7e2814415234ef47bd10ff888559ea90af;p=bertos.git diff --git a/cpu/types.h b/cpu/types.h index 985dbe6b..187d45f1 100644 --- a/cpu/types.h +++ b/cpu/types.h @@ -49,6 +49,8 @@ typedef uint16_t cpuflags_t; // FIXME typedef unsigned int cpustack_t; + #warning Verify following costant + #define SIZEOF_CPUSTACK_T 2 #elif CPU_X86 @@ -60,29 +62,36 @@ #if CPU_X86_64 typedef uint64_t cpustack_t; + #define SIZEOF_CPUSTACK_T 8 #else typedef uint32_t cpustack_t; + #define SIZEOF_CPUSTACK_T 4 #endif #elif CPU_ARM typedef uint32_t cpuflags_t; typedef uint32_t cpustack_t; + #define SIZEOF_CPUSTACK_T 4 #elif CPU_PPC typedef uint32_t cpuflags_t; // FIXME typedef uint32_t cpustack_t; // FIXME + #define SIZEOF_CPUSTACK_T 4 #elif CPU_DSP56K typedef uint16_t cpuflags_t; typedef unsigned int cpustack_t; - + #warning Verify following costant + #define SIZEOF_CPUSTACK_T 2 + #elif CPU_AVR typedef uint8_t cpuflags_t; typedef uint8_t cpustack_t; + #define SIZEOF_CPUSTACK_T 1 #else #error No CPU_... defined. @@ -178,6 +187,7 @@ STATIC_ASSERT(sizeof(uint32_t) * CPU_BITS_PER_CHAR == 32); STATIC_ASSERT(sizeof(int64_t) * CPU_BITS_PER_CHAR == 64); STATIC_ASSERT(sizeof(uint64_t) * CPU_BITS_PER_CHAR == 64); #endif +STATIC_ASSERT(sizeof(cpustack_t) == SIZEOF_CPUSTACK_T); #endif /* CPU_TYPES_H */