diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index 817ccff413..e79d147e99 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,3 +1,9 @@ +2010-06-29 Joel Sherrill + + * configure.ac, score/include/rtems/score/percpu.h: Add + __RTEMS_SIZEOF_VOID_P__ to cpuopts.h so percpu.h has this information + available during build and after installation. + 2010-06-29 Sebastian Huber * libnetworking/lib/tftpDriver.c: rtems_tftp_ops and diff --git a/cpukit/configure.ac b/cpukit/configure.ac index d74c424210..8ac8f5184c 100644 --- a/cpukit/configure.ac +++ b/cpukit/configure.ac @@ -118,6 +118,10 @@ rtems_major=`echo _RTEMS_VERSION | sed "s/\..*//"` rtems_minor=`echo _RTEMS_VERSION | sed "s/[[0-9]][[0-9]]*\.//;s/\..*//"` rtems_revision=`echo _RTEMS_VERSION | sed "s/[[0-9]][[0-9]]*\.//;s/[[0-9]][[0-9]]*\.//;s/\..*//"` +## This is needed to generate the field offsets of the per CPU +## data structure so they can be accessed from assembly code. +AC_CHECK_SIZEOF([void *]) + _RTEMS_CPUOPT_INIT RTEMS_CPUOPT([RTEMS_DEBUG], @@ -195,6 +199,14 @@ RTEMS_CPUOPT([__RTEMS_ADA__], [1], [Define to 1 if ada/gnat bindings are built-in]) +## Then we propagate a private copy of the value into cpuopts.h +## so it is always available to the RTEMS header files. + +RTEMS_CPUOPT([__RTEMS_SIZEOF_VOID_P__], + [true], + [$ac_cv_sizeof_void_p], + [Size of a void * pointer]) + RTEMS_CPUOPT([__RTEMS_MAJOR__], [true], [$rtems_major], @@ -251,10 +263,6 @@ AC_CHECK_DECLS([sbrk],,,[#include ]) ## Check if libc provides BSD's strlcpy/strlcat AC_CHECK_FUNCS(strlcpy strlcat) -## This is needed to generate the field offsets of the per CPU -## data structure so they can be accessed from assembly code. -AC_CHECK_SIZEOF([void *]) - # ... far too many conditionals ... AM_CONDITIONAL(LIBRPC,[test x"$rtems_cv_HAS_NETWORKING" = x"yes"]) AM_CONDITIONAL(NEWLIB,test x"$RTEMS_USE_NEWLIB" = x"yes") diff --git a/cpukit/score/include/rtems/score/percpu.h b/cpukit/score/include/rtems/score/percpu.h index 09f82ad663..3d7fb18f0a 100644 --- a/cpukit/score/include/rtems/score/percpu.h +++ b/cpukit/score/include/rtems/score/percpu.h @@ -97,8 +97,8 @@ typedef struct { * we need to have places in the per cpu table to hold them. */ #define PER_CPU_INTERRUPT_STACK_LOW 0 - #define PER_CPU_INTERRUPT_STACK_HIGH (1 * SIZEOF_VOID_P) - #define PER_CPU_END_STACK (2 * SIZEOF_VOID_P) + #define PER_CPU_INTERRUPT_STACK_HIGH (1 * __RTEMS_SIZEOF_VOID_P__) + #define PER_CPU_END_STACK (2 * __RTEMS_SIZEOF_VOID_P__) #else /* * Otherwise, there are no interrupt stack addresses in the per CPU table. @@ -109,15 +109,21 @@ typedef struct { /* * These are the offsets of the required elements in the per CPU table. */ -#define PER_CPU_ISR_NEST_LEVEL PER_CPU_END_STACK + 0 -#define PER_CPU_EXECUTING PER_CPU_END_STACK + (1 * SIZEOF_VOID_P) -#define PER_CPU_HEIR PER_CPU_END_STACK + (2 * SIZEOF_VOID_P) -#define PER_CPU_IDLE PER_CPU_END_STACK + (3 * SIZEOF_VOID_P) -#define PER_CPU_DISPATCH_NEEDED PER_CPU_END_STACK + (4 * SIZEOF_VOID_P) +#define PER_CPU_ISR_NEST_LEVEL \ + PER_CPU_END_STACK + 0 +#define PER_CPU_EXECUTING \ + PER_CPU_END_STACK + (1 * __RTEMS_SIZEOF_VOID_P__) +#define PER_CPU_HEIR \ + PER_CPU_END_STACK + (2 * __RTEMS_SIZEOF_VOID_P__) +#define PER_CPU_IDLE \ + PER_CPU_END_STACK + (3 * __RTEMS_SIZEOF_VOID_P__) +#define PER_CPU_DISPATCH_NEEDED \ + PER_CPU_END_STACK + (4 * __RTEMS_SIZEOF_VOID_P__) + #define ISR_NEST_LEVEL \ - (SYM(_Per_CPU_Information) + PER_CPU_ISR_NEST_LEVEL) + (SYM(_Per_CPU_Information) + PER_CPU_ISR_NEST_LEVEL) #define DISPATCH_NEEDED \ - (SYM(_Per_CPU_Information) + PER_CPU_DISPATCH_NEEDED) + (SYM(_Per_CPU_Information) + PER_CPU_DISPATCH_NEEDED) /* * Do not define these offsets if they are not in the table.