From 0b38ba2ac1fe2fc44ee6b417235fdc0f42f65867 Mon Sep 17 00:00:00 2001 From: batt Date: Tue, 30 Mar 2010 14:40:49 +0000 Subject: [PATCH] Further Cortex-M3 core related macros. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3333 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/cfg/compiler.h | 2 +- bertos/cpu/frame.h | 6 ++++++ bertos/cpu/types.h | 14 +++++++++++--- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/bertos/cfg/compiler.h b/bertos/cfg/compiler.h index bd60c6e7..477094d2 100644 --- a/bertos/cfg/compiler.h +++ b/bertos/cfg/compiler.h @@ -448,7 +448,7 @@ typedef unsigned char page_t; /**< Type for banked memory pages. */ #if CPU_X86 /* 32bit or 64bit (32bit for _WIN64). */ typedef long ssize_t; - #elif CPU_ARM + #elif CPU_ARM || CPU_CM3 typedef int ssize_t; #elif CPU_AVR /* 16bit (missing in avr-libc's sys/types.h). */ diff --git a/bertos/cpu/frame.h b/bertos/cpu/frame.h index e5c56468..9fd55b0b 100644 --- a/bertos/cpu/frame.h +++ b/bertos/cpu/frame.h @@ -67,6 +67,12 @@ #define CPU_STACK_GROWS_UPWARD 0 #define CPU_SP_ON_EMPTY_SLOT 0 +#elif CPU_CM3 + + #define CPU_SAVED_REGS_CNT fixme + #define CPU_STACK_GROWS_UPWARD 0 + #define CPU_SP_ON_EMPTY_SLOT 0 + #elif CPU_PPC #define CPU_SAVED_REGS_CNT 1 diff --git a/bertos/cpu/types.h b/bertos/cpu/types.h index bb4aa79f..3e56a360 100644 --- a/bertos/cpu/types.h +++ b/bertos/cpu/types.h @@ -77,14 +77,22 @@ #define SIZEOF_CPUALIGNED_T SIZEOF_CPUSTACK_T #endif -#elif CPU_ARM +#elif CPU_ARM || CPU_CM3 typedef uint32_t cpu_flags_t; typedef uint32_t cpu_atomic_t; typedef uint32_t cpu_stack_t; - typedef uint64_t cpu_aligned_stack_t; #define SIZEOF_CPUSTACK_T 4 - #define SIZEOF_CPUALIGNED_T 8 + + #if CPU_ARM + typedef uint64_t cpu_aligned_stack_t; + #define SIZEOF_CPUALIGNED_T 8 + #elif CPU_CM3 + typedef uint32_t cpu_aligned_stack_t; + #define SIZEOF_CPUALIGNED_T 4 + #else + #error CPU configuration error + #endif #elif CPU_PPC -- 2.25.1