diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2012-11-04 21:04:39 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2012-11-22 16:35:07 +0100 |
commit | f1738ed619ed01199535410887a81c6ac99e482c (patch) | |
tree | 2578ed634fd96ffc933ec3470e2d06ff82cd8e5a /cpukit/score/include | |
parent | score: Inline _API_extensions_Run_postswitch() (diff) | |
download | rtems-f1738ed619ed01199535410887a81c6ac99e482c.tar.bz2 |
score: PR1607: Add and use CPU_SIZEOF_POINTER
Add and use new CPU port define CPU_SIZEOF_POINTER. It must be an
integer literal that can be used by the assembler. This value will be
used to calculate offsets of structure members. These offsets will be
used in assembler code.
The size of a pointer is part of the application binary interface (ABI)
and thus independent of the actual programming language. The compiler
will provide defines to determine the current ABI. We use these defines
to select the appropriate CPU_SIZEOF_POINTER value.
Static assertions in the new file "cpukit/score/src/percpuasm.c" will
ensure that the value of CPU_SIZEOF_POINTER is consistent with the
current compiler settings. Also the offset values used by assembler
code are verfied.
Diffstat (limited to 'cpukit/score/include')
-rw-r--r-- | cpukit/score/include/rtems/score/percpu.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cpukit/score/include/rtems/score/percpu.h b/cpukit/score/include/rtems/score/percpu.h index 9442b6e7f0..3e4712d43d 100644 --- a/cpukit/score/include/rtems/score/percpu.h +++ b/cpukit/score/include/rtems/score/percpu.h @@ -150,7 +150,7 @@ typedef struct { } Per_CPU_Control; #endif -#if defined(ASM) +#if defined(ASM) || defined(_RTEMS_PERCPU_DEFINE_OFFSETS) #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) || \ (CPU_HAS_SOFTWARE_INTERRUPT_STACK == TRUE) @@ -161,9 +161,9 @@ typedef struct { #define PER_CPU_INTERRUPT_STACK_LOW \ 0 #define PER_CPU_INTERRUPT_STACK_HIGH \ - PER_CPU_INTERRUPT_STACK_LOW + __RTEMS_SIZEOF_VOID_P__ + PER_CPU_INTERRUPT_STACK_LOW + CPU_SIZEOF_POINTER #define PER_CPU_END_STACK \ - PER_CPU_INTERRUPT_STACK_HIGH + __RTEMS_SIZEOF_VOID_P__ + PER_CPU_INTERRUPT_STACK_HIGH + CPU_SIZEOF_POINTER #define INTERRUPT_STACK_LOW \ (SYM(_Per_CPU_Information) + PER_CPU_INTERRUPT_STACK_LOW) @@ -187,7 +187,7 @@ typedef struct { #define DISPATCH_NEEDED \ (SYM(_Per_CPU_Information) + PER_CPU_DISPATCH_NEEDED) -#endif /* defined(ASM) */ +#endif /* defined(ASM) || defined(_RTEMS_PERCPU_DEFINE_OFFSETS) */ #ifndef ASM |