From 7c16e1a5143b92228d9f3fac7fe653e5c3e4b880 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Tue, 23 Dec 2014 11:38:34 +0100 Subject: powerpc: Set PPC_DEFAULT_CACHE_LINE_SIZE for e6500 --- cpukit/score/cpu/powerpc/rtems/score/cpu.h | 10 +++++----- cpukit/score/cpu/powerpc/rtems/score/powerpc.h | 8 +++++++- 2 files changed, 12 insertions(+), 6 deletions(-) (limited to 'cpukit/score/cpu/powerpc/rtems/score') diff --git a/cpukit/score/cpu/powerpc/rtems/score/cpu.h b/cpukit/score/cpu/powerpc/rtems/score/cpu.h index 889ecdf696..29a2833ca7 100644 --- a/cpukit/score/cpu/powerpc/rtems/score/cpu.h +++ b/cpukit/score/cpu/powerpc/rtems/score/cpu.h @@ -358,13 +358,13 @@ static inline ppc_context *ppc_get_context( const Context_Control *context ) #endif #endif /* ASM */ -#define PPC_CONTEXT_OFFSET_GPR1 32 -#define PPC_CONTEXT_OFFSET_MSR 36 -#define PPC_CONTEXT_OFFSET_LR 40 -#define PPC_CONTEXT_OFFSET_CR 44 +#define PPC_CONTEXT_OFFSET_GPR1 (PPC_DEFAULT_CACHE_LINE_SIZE + 0) +#define PPC_CONTEXT_OFFSET_MSR (PPC_DEFAULT_CACHE_LINE_SIZE + 4) +#define PPC_CONTEXT_OFFSET_LR (PPC_DEFAULT_CACHE_LINE_SIZE + 8) +#define PPC_CONTEXT_OFFSET_CR (PPC_DEFAULT_CACHE_LINE_SIZE + 12) #define PPC_CONTEXT_GPR_OFFSET( gpr ) \ - (((gpr) - 14) * PPC_GPR_SIZE + 48) + (((gpr) - 14) * PPC_GPR_SIZE + PPC_DEFAULT_CACHE_LINE_SIZE + 16) #define PPC_CONTEXT_OFFSET_GPR14 PPC_CONTEXT_GPR_OFFSET( 14 ) #define PPC_CONTEXT_OFFSET_GPR15 PPC_CONTEXT_GPR_OFFSET( 15 ) diff --git a/cpukit/score/cpu/powerpc/rtems/score/powerpc.h b/cpukit/score/cpu/powerpc/rtems/score/powerpc.h index ee5484bc63..90cbbd1db3 100644 --- a/cpukit/score/cpu/powerpc/rtems/score/powerpc.h +++ b/cpukit/score/cpu/powerpc/rtems/score/powerpc.h @@ -74,7 +74,13 @@ extern "C" { #define PPC_ALIGNMENT 8 -#define PPC_DEFAULT_CACHE_LINE_SIZE 32 +#ifdef __PPC_CPU_E6500__ +#define PPC_DEFAULT_CACHE_LINE_POWER 6 +#else +#define PPC_DEFAULT_CACHE_LINE_POWER 5 +#endif + +#define PPC_DEFAULT_CACHE_LINE_SIZE (1 << PPC_DEFAULT_CACHE_LINE_POWER) #define PPC_STRUCTURE_ALIGNMENT PPC_DEFAULT_CACHE_LINE_SIZE -- cgit v1.2.3