summaryrefslogtreecommitdiffstats
path: root/cpukit/score/cpu/h8300
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2012-11-04 21:04:39 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2012-11-22 16:35:07 +0100
commitf1738ed619ed01199535410887a81c6ac99e482c (patch)
tree2578ed634fd96ffc933ec3470e2d06ff82cd8e5a /cpukit/score/cpu/h8300
parent74d22fd1a9633efe12a7a9c6b7662d80c0185f87 (diff)
downloadrtems-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/cpu/h8300')
-rw-r--r--cpukit/score/cpu/h8300/rtems/score/cpu.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/cpukit/score/cpu/h8300/rtems/score/cpu.h b/cpukit/score/cpu/h8300/rtems/score/cpu.h
index ea9d443e25..1811ce779a 100644
--- a/cpukit/score/cpu/h8300/rtems/score/cpu.h
+++ b/cpukit/score/cpu/h8300/rtems/score/cpu.h
@@ -497,6 +497,12 @@ SCORE_EXTERN Context_Control_fp _CPU_Null_fp_context;
#define CPU_STACK_MINIMUM_SIZE (1536)
+#if defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__)
+ #define CPU_SIZEOF_POINTER 4
+#else
+ #define CPU_SIZEOF_POINTER 2
+#endif
+
/*
* CPU's worst alignment requirement for data types on a byte boundary. This
* alignment does not take into account the requirements for the stack.