Author: afaerber Date: Sun Oct 31 17:37:33 2010 New Revision: 939 URL: http://tracker.coreboot.org/trac/openbios/changeset/939
Log: Partially revert r917: Leave bootstrap functionality in kernel/cross.h
The base_address for native bitwidth smaller than host bitwidth is available only in kernel/bootstrap.c and thus cannot be used elsewhere.
The bitwidth equality code path will have to be enhanced for different cell sizes instead.
Signed-off-by: Andreas Färber andreas.faerber@web.de
Modified: trunk/openbios-devel/include/kernel/stack.h trunk/openbios-devel/kernel/cross.h
Modified: trunk/openbios-devel/include/kernel/stack.h ============================================================================== --- trunk/openbios-devel/include/kernel/stack.h Sun Oct 31 16:12:01 2010 (r938) +++ trunk/openbios-devel/include/kernel/stack.h Sun Oct 31 17:37:33 2010 (r939) @@ -35,14 +35,6 @@ #define pointer2cell(x) ((ucell)(uintptr_t)(x)) #define cell2pointer(x) ((u8 *)(uintptr_t)(x)) #endif -#ifdef NATIVE_BITWIDTH_SMALLER_THAN_HOST_BITWIDTH -#define pointer2cell(x) ((ucell)(((unsigned long)(x))-base_address)) -#define cell2pointer(x) ((u8 *)(((unsigned long)(x))+base_address)) -#endif -#ifdef NATIVE_BITWIDTH_LARGER_THAN_HOST_BITWIDTH -#define pointer2cell(x) ((ucell)(unsigned long)(x)) -#define cell2pointer(x) ((u8 *)((unsigned long)(x)&0xFFFFFFFFUL)) -#endif
static inline void PUSH(ucell value) { dstack[++dstackcnt] = (value);
Modified: trunk/openbios-devel/kernel/cross.h ============================================================================== --- trunk/openbios-devel/kernel/cross.h Sun Oct 31 16:12:01 2010 (r938) +++ trunk/openbios-devel/kernel/cross.h Sun Oct 31 17:37:33 2010 (r939) @@ -114,11 +114,15 @@
#ifdef NATIVE_BITWIDTH_SMALLER_THAN_HOST_BITWIDTH extern unsigned long base_address; +#define pointer2cell(x) ((ucell)(((unsigned long)(x))-base_address)) +#define cell2pointer(x) ((u8 *)(((unsigned long)(x))+base_address)) #define FMT_CELL_x "x" #define FMT_CELL_d "d" #endif
#ifdef NATIVE_BITWIDTH_LARGER_THAN_HOST_BITWIDTH +#define pointer2cell(x) ((ucell)(unsigned long)(x)) +#define cell2pointer(x) ((u8 *)((unsigned long)(x)&0xFFFFFFFFUL)) #define FMT_CELL_x "llx" #define FMT_CELL_d "lld" #endif