powerpc/fsl-booke: Don't hard-code size of struct tlbcam
Some assembly code in head_fsl_booke.S hard-coded the size of struct tlbcam to 20 when it indexed the TLBCAM table. Anyone changing the size of struct tlbcam would not know to expect that. The kernel already has a system to get the size of C structures into assembly language files, asm-offsets, so let's use it. The definition of the struct gets moved to a header, so that asm-offsets.c can include it. Signed-off-by: Trent Piepho <tpiepho@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
This commit is contained in:
@@ -56,6 +56,10 @@
|
||||
#include "head_booke.h"
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_FSL_BOOKE)
|
||||
#include "../mm/mmu_decl.h"
|
||||
#endif
|
||||
|
||||
int main(void)
|
||||
{
|
||||
DEFINE(THREAD, offsetof(struct task_struct, thread));
|
||||
@@ -384,6 +388,9 @@ int main(void)
|
||||
DEFINE(PGD_T_LOG2, PGD_T_LOG2);
|
||||
DEFINE(PTE_T_LOG2, PTE_T_LOG2);
|
||||
#endif
|
||||
#ifdef CONFIG_FSL_BOOKE
|
||||
DEFINE(TLBCAM_SIZE, sizeof(struct tlbcam));
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@@ -909,7 +909,7 @@ KernelSPE:
|
||||
_GLOBAL(loadcam_entry)
|
||||
lis r4,TLBCAM@ha
|
||||
addi r4,r4,TLBCAM@l
|
||||
mulli r5,r3,20
|
||||
mulli r5,r3,TLBCAM_SIZE
|
||||
add r3,r5,r4
|
||||
lwz r4,0(r3)
|
||||
mtspr SPRN_MAS0,r4
|
||||
|
Reference in New Issue
Block a user