From b4aa14e88c9e28a16a5f9c0c220fac6cc36750ad Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 18 May 2011 09:03:50 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2971 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/ports/GCC/ARM/chcore.h | 14 ++++++-------- os/ports/GCC/ARMCMx/old/chcore_v7m.c | 15 --------------- os/ports/GCC/ARMCMx/old/chcore_v7m.h | 10 +++++----- os/ports/GCC/AVR/chcore.c | 4 ---- os/ports/GCC/AVR/chcore.h | 14 ++++++-------- os/ports/GCC/MSP430/chcore.h | 12 ++++++------ os/ports/GCC/PPC/chcore.h | 12 ++++++------ os/ports/GCC/SIMIA32/chcore.h | 10 +++++----- os/ports/IAR/ARMCMx/chcore.h | 2 +- os/ports/IAR/ARMCMx/chcore_v6m.h | 10 +++++----- os/ports/IAR/ARMCMx/chcore_v7m.h | 14 ++++++-------- os/ports/RC/STM8/chcore.h | 12 ++++++------ os/ports/RVCT/ARMCMx/chcore.h | 2 +- os/ports/RVCT/ARMCMx/chcore_v6m.h | 10 +++++----- os/ports/RVCT/ARMCMx/chcore_v7m.h | 14 ++++++-------- os/ports/cosmic/STM8/chcore.h | 12 ++++++------ 16 files changed, 70 insertions(+), 97 deletions(-) (limited to 'os/ports') diff --git a/os/ports/GCC/ARM/chcore.h b/os/ports/GCC/ARM/chcore.h index b67fb9c1b..5a36d82c8 100644 --- a/os/ports/GCC/ARM/chcore.h +++ b/os/ports/GCC/ARM/chcore.h @@ -155,9 +155,7 @@ struct intctx { regarm_t r4; regarm_t r5; regarm_t r6; -#ifndef CH_CURRP_REGISTER_CACHE regarm_t r7; -#endif regarm_t r8; regarm_t r9; regarm_t r10; @@ -192,12 +190,12 @@ struct context { * @brief Stack size for the system idle thread. * @details This size depends on the idle thread implementation, usually * the idle thread should take no more space than those reserved - * by @p INT_REQUIRED_STACK. + * by @p PORT_INT_REQUIRED_STACK. * @note In this port it is set to 4 because the idle thread does have * a stack frame when compiling without optimizations. */ -#ifndef IDLE_THREAD_STACK_SIZE -#define IDLE_THREAD_STACK_SIZE 4 +#ifndef PORT_IDLE_THREAD_STACK_SIZE +#define PORT_IDLE_THREAD_STACK_SIZE 4 #endif /** @@ -210,8 +208,8 @@ struct context { * @note In this port 0x10 is a safe value, it can be reduced after careful * analysis of the generated code. */ -#ifndef INT_REQUIRED_STACK -#define INT_REQUIRED_STACK 0x10 +#ifndef PORT_INT_REQUIRED_STACK +#define PORT_INT_REQUIRED_STACK 0x10 #endif /** @@ -225,7 +223,7 @@ struct context { #define THD_WA_SIZE(n) STACK_ALIGN(sizeof(Thread) + \ sizeof(struct intctx) + \ sizeof(struct extctx) + \ - (n) + (INT_REQUIRED_STACK)) + (n) + (PORT_INT_REQUIRED_STACK)) /** * @brief Static working area allocation. diff --git a/os/ports/GCC/ARMCMx/old/chcore_v7m.c b/os/ports/GCC/ARMCMx/old/chcore_v7m.c index bd888cd01..244ff396e 100644 --- a/os/ports/GCC/ARMCMx/old/chcore_v7m.c +++ b/os/ports/GCC/ARMCMx/old/chcore_v7m.c @@ -54,7 +54,6 @@ void SysTickVector(void) { chSysUnlockFromIsr(); } -#if !defined(CH_CURRP_REGISTER_CACHE) #define PUSH_CONTEXT(sp, prio) { \ asm volatile ("mrs %0, PSP \n\t" \ "stmdb %0!, {r3-r11,lr}" : \ @@ -67,20 +66,6 @@ void SysTickVector(void) { "msr BASEPRI, r3 \n\t" \ "bx lr" : "=r" (sp) : "r" (sp)); \ } -#else /* defined(CH_CURRP_REGISTER_CACHE) */ -#define PUSH_CONTEXT(sp, prio) { \ - asm volatile ("mrs %0, PSP \n\t" \ - "stmdb %0!, {r3-r6,r8-r11, lr}" : \ - "=r" (sp) : "r" (sp), "r" (prio)); \ -} - -#define POP_CONTEXT(sp) { \ - asm volatile ("ldmia %0!, {r3-r6,r8-r11, lr} \n\t" \ - "msr PSP, %0 \n\t" \ - "msr BASEPRI, r3 \n\t" \ - "bx lr" : "=r" (sp) : "r" (sp)); \ -} -#endif /* defined(CH_CURRP_REGISTER_CACHE) */ /** * @brief SVC vector. diff --git a/os/ports/GCC/ARMCMx/old/chcore_v7m.h b/os/ports/GCC/ARMCMx/old/chcore_v7m.h index 93e701202..b94afdca3 100644 --- a/os/ports/GCC/ARMCMx/old/chcore_v7m.h +++ b/os/ports/GCC/ARMCMx/old/chcore_v7m.h @@ -96,12 +96,12 @@ struct intctx { * @brief Stack size for the system idle thread. * @details This size depends on the idle thread implementation, usually * the idle thread should take no more space than those reserved - * by @p INT_REQUIRED_STACK. + * by @p PORT_INT_REQUIRED_STACK. * @note In this port it is set to 4 because the idle thread does have * a stack frame when compiling without optimizations. */ -#ifndef IDLE_THREAD_STACK_SIZE -#define IDLE_THREAD_STACK_SIZE 4 +#ifndef PORT_IDLE_THREAD_STACK_SIZE +#define PORT_IDLE_THREAD_STACK_SIZE 4 #endif /** @@ -113,8 +113,8 @@ struct intctx { * @p extctx is known to be zero. * @note This port requires no extra stack space for interrupt handling. */ -#ifndef INT_REQUIRED_STACK -#define INT_REQUIRED_STACK 0 +#ifndef PORT_INT_REQUIRED_STACK +#define PORT_INT_REQUIRED_STACK 0 #endif /** diff --git a/os/ports/GCC/AVR/chcore.c b/os/ports/GCC/AVR/chcore.c index 166c0d1b1..7cb0dda07 100644 --- a/os/ports/GCC/AVR/chcore.c +++ b/os/ports/GCC/AVR/chcore.c @@ -51,10 +51,8 @@ void port_switch(Thread *ntp, Thread *otp) { asm volatile ("push r5"); asm volatile ("push r6"); asm volatile ("push r7"); -#ifndef CH_CURRP_REGISTER_CACHE asm volatile ("push r8"); asm volatile ("push r9"); -#endif asm volatile ("push r10"); asm volatile ("push r11"); asm volatile ("push r12"); @@ -88,10 +86,8 @@ void port_switch(Thread *ntp, Thread *otp) { asm volatile ("pop r12"); asm volatile ("pop r11"); asm volatile ("pop r10"); -#ifndef CH_CURRP_REGISTER_CACHE asm volatile ("pop r9"); asm volatile ("pop r8"); -#endif asm volatile ("pop r7"); asm volatile ("pop r6"); asm volatile ("pop r5"); diff --git a/os/ports/GCC/AVR/chcore.h b/os/ports/GCC/AVR/chcore.h index 4377c5047..5e1c4d954 100644 --- a/os/ports/GCC/AVR/chcore.h +++ b/os/ports/GCC/AVR/chcore.h @@ -105,10 +105,8 @@ struct intctx { uint8_t r12; uint8_t r11; uint8_t r10; -#ifndef CH_CURRP_REGISTER_CACHE uint8_t r9; uint8_t r8; -#endif uint8_t r7; uint8_t r6; uint8_t r5; @@ -149,11 +147,11 @@ struct context { * @brief Stack size for the system idle thread. * @details This size depends on the idle thread implementation, usually * the idle thread should take no more space than those reserved - * by @p INT_REQUIRED_STACK. + * by @p PORT_INT_REQUIRED_STACK. * @note In this port it is set to 8. */ -#ifndef IDLE_THREAD_STACK_SIZE -#define IDLE_THREAD_STACK_SIZE 8 +#ifndef PORT_IDLE_THREAD_STACK_SIZE +#define PORT_IDLE_THREAD_STACK_SIZE 8 #endif /** @@ -165,8 +163,8 @@ struct context { * @p extctx is known to be zero. * @note In this port the default is 32 bytes per thread. */ -#ifndef INT_REQUIRED_STACK -#define INT_REQUIRED_STACK 32 +#ifndef PORT_INT_REQUIRED_STACK +#define PORT_INT_REQUIRED_STACK 32 #endif /** @@ -180,7 +178,7 @@ struct context { #define THD_WA_SIZE(n) STACK_ALIGN(sizeof(Thread) + \ (sizeof(struct intctx) - 1) + \ (sizeof(struct extctx) - 1) + \ - (n) + (INT_REQUIRED_STACK)) + (n) + (PORT_INT_REQUIRED_STACK)) /** * @brief Static working area allocation. diff --git a/os/ports/GCC/MSP430/chcore.h b/os/ports/GCC/MSP430/chcore.h index 5cb88ab3d..f70a34438 100644 --- a/os/ports/GCC/MSP430/chcore.h +++ b/os/ports/GCC/MSP430/chcore.h @@ -122,10 +122,10 @@ struct context { * @brief Stack size for the system idle thread. * @details This size depends on the idle thread implementation, usually * the idle thread should take no more space than those reserved - * by @p INT_REQUIRED_STACK. + * by @p PORT_INT_REQUIRED_STACK. */ -#ifndef IDLE_THREAD_STACK_SIZE -#define IDLE_THREAD_STACK_SIZE 0 +#ifndef PORT_IDLE_THREAD_STACK_SIZE +#define PORT_IDLE_THREAD_STACK_SIZE 0 #endif /** @@ -137,8 +137,8 @@ struct context { * @p extctx is known to be zero. * @note In this port the default is 32 bytes per thread. */ -#ifndef INT_REQUIRED_STACK -#define INT_REQUIRED_STACK 32 +#ifndef PORT_INT_REQUIRED_STACK +#define PORT_INT_REQUIRED_STACK 32 #endif /** @@ -152,7 +152,7 @@ struct context { #define THD_WA_SIZE(n) STACK_ALIGN(sizeof(Thread) + \ sizeof(struct intctx) + \ sizeof(struct extctx) + \ - (n) + (INT_REQUIRED_STACK)) + (n) + (PORT_INT_REQUIRED_STACK)) /** * @brief Static working area allocation. diff --git a/os/ports/GCC/PPC/chcore.h b/os/ports/GCC/PPC/chcore.h index 058379923..30e5f717c 100644 --- a/os/ports/GCC/PPC/chcore.h +++ b/os/ports/GCC/PPC/chcore.h @@ -185,10 +185,10 @@ struct context { * @brief Stack size for the system idle thread. * @details This size depends on the idle thread implementation, usually * the idle thread should take no more space than those reserved - * by @p INT_REQUIRED_STACK. + * by @p PORT_INT_REQUIRED_STACK. */ -#ifndef IDLE_THREAD_STACK_SIZE -#define IDLE_THREAD_STACK_SIZE 0 +#ifndef PORT_IDLE_THREAD_STACK_SIZE +#define PORT_IDLE_THREAD_STACK_SIZE 0 #endif /** @@ -199,8 +199,8 @@ struct context { * separate interrupt stack and the stack space between @p intctx and * @p extctx is known to be zero. */ -#ifndef INT_REQUIRED_STACK -#define INT_REQUIRED_STACK 128 +#ifndef PORT_INT_REQUIRED_STACK +#define PORT_INT_REQUIRED_STACK 128 #endif /** @@ -214,7 +214,7 @@ struct context { #define THD_WA_SIZE(n) STACK_ALIGN(sizeof(Thread) + \ sizeof(struct intctx) + \ sizeof(struct extctx) + \ - (n) + (INT_REQUIRED_STACK)) + (n) + (PORT_INT_REQUIRED_STACK)) /** * @brief Static working area allocation. diff --git a/os/ports/GCC/SIMIA32/chcore.h b/os/ports/GCC/SIMIA32/chcore.h index 266cfd955..05dc05db4 100644 --- a/os/ports/GCC/SIMIA32/chcore.h +++ b/os/ports/GCC/SIMIA32/chcore.h @@ -108,8 +108,8 @@ struct context { /** * Stack size for the system idle thread. */ -#ifndef IDLE_THREAD_STACK_SIZE -#define IDLE_THREAD_STACK_SIZE 256 +#ifndef PORT_IDLE_THREAD_STACK_SIZE +#define PORT_IDLE_THREAD_STACK_SIZE 256 #endif /** @@ -118,8 +118,8 @@ struct context { * It requires stack space because the simulated "interrupt handlers" can * invoke host library functions inside so it better have a lot of space. */ -#ifndef INT_REQUIRED_STACK -#define INT_REQUIRED_STACK 16384 +#ifndef PORT_INT_REQUIRED_STACK +#define PORT_INT_REQUIRED_STACK 16384 #endif /** @@ -134,7 +134,7 @@ struct context { sizeof(void *) * 4 + \ sizeof(struct intctx) + \ sizeof(struct extctx) + \ - (n) + (INT_REQUIRED_STACK)) + (n) + (PORT_INT_REQUIRED_STACK)) /** * Macro used to allocate a thread working area aligned as both position and diff --git a/os/ports/IAR/ARMCMx/chcore.h b/os/ports/IAR/ARMCMx/chcore.h index 3854de61e..9c6a63730 100644 --- a/os/ports/IAR/ARMCMx/chcore.h +++ b/os/ports/IAR/ARMCMx/chcore.h @@ -302,7 +302,7 @@ struct context { #define THD_WA_SIZE(n) STACK_ALIGN(sizeof(Thread) + \ sizeof(struct intctx) + \ sizeof(struct extctx) + \ - (n) + (INT_REQUIRED_STACK)) + (n) + (PORT_INT_REQUIRED_STACK)) /** * @brief Static working area allocation. diff --git a/os/ports/IAR/ARMCMx/chcore_v6m.h b/os/ports/IAR/ARMCMx/chcore_v6m.h index a2d5ef577..41b656532 100644 --- a/os/ports/IAR/ARMCMx/chcore_v6m.h +++ b/os/ports/IAR/ARMCMx/chcore_v6m.h @@ -76,13 +76,13 @@ struct intctx { * @brief Stack size for the system idle thread. * @details This size depends on the idle thread implementation, usually * the idle thread should take no more space than those reserved - * by @p INT_REQUIRED_STACK. + * by @p PORT_INT_REQUIRED_STACK. * @note In this port it is set to 8 because the idle thread does have * a stack frame when compiling without optimizations. You may * reduce this value to zero when compiling with optimizations. */ -#ifndef IDLE_THREAD_STACK_SIZE -#define IDLE_THREAD_STACK_SIZE 16 +#ifndef PORT_IDLE_THREAD_STACK_SIZE +#define PORT_IDLE_THREAD_STACK_SIZE 16 #endif /** @@ -96,8 +96,8 @@ struct intctx { * @p chSchDoRescheduleI() can have a stack frame, expecially with * compiler optimizations disabled. */ -#ifndef INT_REQUIRED_STACK -#define INT_REQUIRED_STACK 16 +#ifndef PORT_INT_REQUIRED_STACK +#define PORT_INT_REQUIRED_STACK 16 #endif /** diff --git a/os/ports/IAR/ARMCMx/chcore_v7m.h b/os/ports/IAR/ARMCMx/chcore_v7m.h index 9c5d700ee..31be9a04a 100644 --- a/os/ports/IAR/ARMCMx/chcore_v7m.h +++ b/os/ports/IAR/ARMCMx/chcore_v7m.h @@ -49,9 +49,7 @@ struct intctx { regarm_t r4; regarm_t r5; regarm_t r6; -#ifndef CH_CURRP_REGISTER_CACHE regarm_t r7; -#endif regarm_t r8; regarm_t r9; regarm_t r10; @@ -78,13 +76,13 @@ struct intctx { * @brief Stack size for the system idle thread. * @details This size depends on the idle thread implementation, usually * the idle thread should take no more space than those reserved - * by @p INT_REQUIRED_STACK. - * @note In this port it is set to 8 because the idle thread does have + * by @p PORT_INT_REQUIRED_STACK. + * @note In this port it is set to 16 because the idle thread does have * a stack frame when compiling without optimizations. You may * reduce this value to zero when compiling with optimizations. */ -#ifndef IDLE_THREAD_STACK_SIZE -#define IDLE_THREAD_STACK_SIZE 8 +#ifndef PORT_IDLE_THREAD_STACK_SIZE +#define PORT_IDLE_THREAD_STACK_SIZE 16 #endif /** @@ -98,8 +96,8 @@ struct intctx { * @p chSchDoRescheduleI() can have a stack frame, expecially with * compiler optimizations disabled. */ -#ifndef INT_REQUIRED_STACK -#define INT_REQUIRED_STACK 16 +#ifndef PORT_INT_REQUIRED_STACK +#define PORT_INT_REQUIRED_STACK 16 #endif /** diff --git a/os/ports/RC/STM8/chcore.h b/os/ports/RC/STM8/chcore.h index ed10b564e..4de8bea54 100644 --- a/os/ports/RC/STM8/chcore.h +++ b/os/ports/RC/STM8/chcore.h @@ -147,10 +147,10 @@ struct stm8_startctx { * @brief Stack size for the system idle thread. * @details This size depends on the idle thread implementation, usually * the idle thread should take no more space than those reserved - * by @p INT_REQUIRED_STACK. + * by @p PORT_INT_REQUIRED_STACK. */ -#ifndef IDLE_THREAD_STACK_SIZE -#define IDLE_THREAD_STACK_SIZE 0 +#ifndef PORT_IDLE_THREAD_STACK_SIZE +#define PORT_IDLE_THREAD_STACK_SIZE 0 #endif /** @@ -158,8 +158,8 @@ struct stm8_startctx { * @details This is a safe value, you may trim it down after reading the * right size in the map file. */ -#ifndef INT_REQUIRED_STACK -#define INT_REQUIRED_STACK 48 +#ifndef PORT_INT_REQUIRED_STACK +#define PORT_INT_REQUIRED_STACK 48 #endif /** @@ -173,7 +173,7 @@ struct stm8_startctx { #define THD_WA_SIZE(n) STACK_ALIGN(sizeof(Thread) + \ (sizeof(struct intctx) - 1) + \ (sizeof(struct extctx) - 1) + \ - (n) + (INT_REQUIRED_STACK)) + (n) + (PORT_INT_REQUIRED_STACK)) /** * @brief Static working area allocation. diff --git a/os/ports/RVCT/ARMCMx/chcore.h b/os/ports/RVCT/ARMCMx/chcore.h index aa8fe2483..767f71923 100644 --- a/os/ports/RVCT/ARMCMx/chcore.h +++ b/os/ports/RVCT/ARMCMx/chcore.h @@ -305,7 +305,7 @@ struct context { #define THD_WA_SIZE(n) STACK_ALIGN(sizeof(Thread) + \ sizeof(struct intctx) + \ sizeof(struct extctx) + \ - (n) + (INT_REQUIRED_STACK)) + (n) + (PORT_INT_REQUIRED_STACK)) /** * @brief Static working area allocation. diff --git a/os/ports/RVCT/ARMCMx/chcore_v6m.h b/os/ports/RVCT/ARMCMx/chcore_v6m.h index 9c5e35b33..1c4af7da9 100644 --- a/os/ports/RVCT/ARMCMx/chcore_v6m.h +++ b/os/ports/RVCT/ARMCMx/chcore_v6m.h @@ -76,13 +76,13 @@ struct intctx { * @brief Stack size for the system idle thread. * @details This size depends on the idle thread implementation, usually * the idle thread should take no more space than those reserved - * by @p INT_REQUIRED_STACK. + * by @p PORT_INT_REQUIRED_STACK. * @note In this port it is set to 8 because the idle thread does have * a stack frame when compiling without optimizations. You may * reduce this value to zero when compiling with optimizations. */ -#ifndef IDLE_THREAD_STACK_SIZE -#define IDLE_THREAD_STACK_SIZE 16 +#ifndef PORT_IDLE_THREAD_STACK_SIZE +#define PORT_IDLE_THREAD_STACK_SIZE 16 #endif /** @@ -96,8 +96,8 @@ struct intctx { * @p chSchDoRescheduleI() can have a stack frame, expecially with * compiler optimizations disabled. */ -#ifndef INT_REQUIRED_STACK -#define INT_REQUIRED_STACK 16 +#ifndef PORT_INT_REQUIRED_STACK +#define PORT_INT_REQUIRED_STACK 16 #endif /** diff --git a/os/ports/RVCT/ARMCMx/chcore_v7m.h b/os/ports/RVCT/ARMCMx/chcore_v7m.h index 3a4cbe381..7f7d8c5be 100644 --- a/os/ports/RVCT/ARMCMx/chcore_v7m.h +++ b/os/ports/RVCT/ARMCMx/chcore_v7m.h @@ -49,9 +49,7 @@ struct intctx { regarm_t r4; regarm_t r5; regarm_t r6; -#ifndef CH_CURRP_REGISTER_CACHE regarm_t r7; -#endif regarm_t r8; regarm_t r9; regarm_t r10; @@ -78,13 +76,13 @@ struct intctx { * @brief Stack size for the system idle thread. * @details This size depends on the idle thread implementation, usually * the idle thread should take no more space than those reserved - * by @p INT_REQUIRED_STACK. - * @note In this port it is set to 8 because the idle thread does have + * by @p PORT_INT_REQUIRED_STACK. + * @note In this port it is set to 16 because the idle thread does have * a stack frame when compiling without optimizations. You may * reduce this value to zero when compiling with optimizations. */ -#ifndef IDLE_THREAD_STACK_SIZE -#define IDLE_THREAD_STACK_SIZE 8 +#ifndef PORT_IDLE_THREAD_STACK_SIZE +#define PORT_IDLE_THREAD_STACK_SIZE 16 #endif /** @@ -98,8 +96,8 @@ struct intctx { * @p chSchDoRescheduleI() can have a stack frame, expecially with * compiler optimizations disabled. */ -#ifndef INT_REQUIRED_STACK -#define INT_REQUIRED_STACK 16 +#ifndef PORT_INT_REQUIRED_STACK +#define PORT_INT_REQUIRED_STACK 16 #endif /** diff --git a/os/ports/cosmic/STM8/chcore.h b/os/ports/cosmic/STM8/chcore.h index 615116736..e154b8914 100644 --- a/os/ports/cosmic/STM8/chcore.h +++ b/os/ports/cosmic/STM8/chcore.h @@ -145,10 +145,10 @@ struct stm8_startctx { * @brief Stack size for the system idle thread. * @details This size depends on the idle thread implementation, usually * the idle thread should take no more space than those reserved - * by @p INT_REQUIRED_STACK. + * by @p PORT_INT_REQUIRED_STACK. */ -#ifndef IDLE_THREAD_STACK_SIZE -#define IDLE_THREAD_STACK_SIZE 0 +#ifndef PORT_IDLE_THREAD_STACK_SIZE +#define PORT_IDLE_THREAD_STACK_SIZE 0 #endif /** @@ -156,8 +156,8 @@ struct stm8_startctx { * @details This is a safe value, you may trim it down after reading the * right size in the map file. */ -#ifndef INT_REQUIRED_STACK -#define INT_REQUIRED_STACK 48 +#ifndef PORT_INT_REQUIRED_STACK +#define PORT_INT_REQUIRED_STACK 48 #endif /** @@ -171,7 +171,7 @@ struct stm8_startctx { #define THD_WA_SIZE(n) STACK_ALIGN(sizeof(Thread) + \ (sizeof(struct intctx) - 1) + \ (sizeof(struct extctx) - 1) + \ - (n) + (INT_REQUIRED_STACK)) + (n) + (PORT_INT_REQUIRED_STACK)) /** * @brief Static working area allocation. -- cgit v1.2.3