Commit 82497789 authored by David S. Miller's avatar David S. Miller

sparc64: Use BUILD_BUG_ON() in trap_init().

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5a5488d3
...@@ -2531,35 +2531,48 @@ extern void tsb_config_offsets_are_bolixed_dave(void); ...@@ -2531,35 +2531,48 @@ extern void tsb_config_offsets_are_bolixed_dave(void);
void __init trap_init(void) void __init trap_init(void)
{ {
/* Compile time sanity check. */ /* Compile time sanity check. */
if (TI_TASK != offsetof(struct thread_info, task) || BUILD_BUG_ON(TI_TASK != offsetof(struct thread_info, task) ||
TI_FLAGS != offsetof(struct thread_info, flags) || TI_FLAGS != offsetof(struct thread_info, flags) ||
TI_CPU != offsetof(struct thread_info, cpu) || TI_CPU != offsetof(struct thread_info, cpu) ||
TI_FPSAVED != offsetof(struct thread_info, fpsaved) || TI_FPSAVED != offsetof(struct thread_info, fpsaved) ||
TI_KSP != offsetof(struct thread_info, ksp) || TI_KSP != offsetof(struct thread_info, ksp) ||
TI_FAULT_ADDR != offsetof(struct thread_info, fault_address) || TI_FAULT_ADDR != offsetof(struct thread_info,
fault_address) ||
TI_KREGS != offsetof(struct thread_info, kregs) || TI_KREGS != offsetof(struct thread_info, kregs) ||
TI_UTRAPS != offsetof(struct thread_info, utraps) || TI_UTRAPS != offsetof(struct thread_info, utraps) ||
TI_EXEC_DOMAIN != offsetof(struct thread_info, exec_domain) || TI_EXEC_DOMAIN != offsetof(struct thread_info,
TI_REG_WINDOW != offsetof(struct thread_info, reg_window) || exec_domain) ||
TI_RWIN_SPTRS != offsetof(struct thread_info, rwbuf_stkptrs) || TI_REG_WINDOW != offsetof(struct thread_info,
reg_window) ||
TI_RWIN_SPTRS != offsetof(struct thread_info,
rwbuf_stkptrs) ||
TI_GSR != offsetof(struct thread_info, gsr) || TI_GSR != offsetof(struct thread_info, gsr) ||
TI_XFSR != offsetof(struct thread_info, xfsr) || TI_XFSR != offsetof(struct thread_info, xfsr) ||
TI_USER_CNTD0 != offsetof(struct thread_info, user_cntd0) || TI_USER_CNTD0 != offsetof(struct thread_info,
TI_USER_CNTD1 != offsetof(struct thread_info, user_cntd1) || user_cntd0) ||
TI_KERN_CNTD0 != offsetof(struct thread_info, kernel_cntd0) || TI_USER_CNTD1 != offsetof(struct thread_info,
TI_KERN_CNTD1 != offsetof(struct thread_info, kernel_cntd1) || user_cntd1) ||
TI_KERN_CNTD0 != offsetof(struct thread_info,
kernel_cntd0) ||
TI_KERN_CNTD1 != offsetof(struct thread_info,
kernel_cntd1) ||
TI_PCR != offsetof(struct thread_info, pcr_reg) || TI_PCR != offsetof(struct thread_info, pcr_reg) ||
TI_PRE_COUNT != offsetof(struct thread_info, preempt_count) || TI_PRE_COUNT != offsetof(struct thread_info,
preempt_count) ||
TI_NEW_CHILD != offsetof(struct thread_info, new_child) || TI_NEW_CHILD != offsetof(struct thread_info, new_child) ||
TI_SYS_NOERROR != offsetof(struct thread_info, syscall_noerror) || TI_SYS_NOERROR != offsetof(struct thread_info,
TI_RESTART_BLOCK != offsetof(struct thread_info, restart_block) || syscall_noerror) ||
TI_KUNA_REGS != offsetof(struct thread_info, kern_una_regs) || TI_RESTART_BLOCK != offsetof(struct thread_info,
TI_KUNA_INSN != offsetof(struct thread_info, kern_una_insn) || restart_block) ||
TI_KUNA_REGS != offsetof(struct thread_info,
kern_una_regs) ||
TI_KUNA_INSN != offsetof(struct thread_info,
kern_una_insn) ||
TI_FPREGS != offsetof(struct thread_info, fpregs) || TI_FPREGS != offsetof(struct thread_info, fpregs) ||
(TI_FPREGS & (64 - 1))) (TI_FPREGS & (64 - 1)));
thread_info_offsets_are_bolixed_dave();
if (TRAP_PER_CPU_THREAD != offsetof(struct trap_per_cpu, thread) || BUILD_BUG_ON(TRAP_PER_CPU_THREAD != offsetof(struct trap_per_cpu,
thread) ||
(TRAP_PER_CPU_PGD_PADDR != (TRAP_PER_CPU_PGD_PADDR !=
offsetof(struct trap_per_cpu, pgd_paddr)) || offsetof(struct trap_per_cpu, pgd_paddr)) ||
(TRAP_PER_CPU_CPU_MONDO_PA != (TRAP_PER_CPU_CPU_MONDO_PA !=
...@@ -2595,10 +2608,9 @@ void __init trap_init(void) ...@@ -2595,10 +2608,9 @@ void __init trap_init(void)
(TRAP_PER_CPU_NONRESUM_QMASK != (TRAP_PER_CPU_NONRESUM_QMASK !=
offsetof(struct trap_per_cpu, nonresum_qmask)) || offsetof(struct trap_per_cpu, nonresum_qmask)) ||
(TRAP_PER_CPU_PER_CPU_BASE != (TRAP_PER_CPU_PER_CPU_BASE !=
offsetof(struct trap_per_cpu, __per_cpu_base))) offsetof(struct trap_per_cpu, __per_cpu_base)));
trap_per_cpu_offsets_are_bolixed_dave();
if ((TSB_CONFIG_TSB != BUILD_BUG_ON((TSB_CONFIG_TSB !=
offsetof(struct tsb_config, tsb)) || offsetof(struct tsb_config, tsb)) ||
(TSB_CONFIG_RSS_LIMIT != (TSB_CONFIG_RSS_LIMIT !=
offsetof(struct tsb_config, tsb_rss_limit)) || offsetof(struct tsb_config, tsb_rss_limit)) ||
...@@ -2609,8 +2621,7 @@ void __init trap_init(void) ...@@ -2609,8 +2621,7 @@ void __init trap_init(void)
(TSB_CONFIG_MAP_VADDR != (TSB_CONFIG_MAP_VADDR !=
offsetof(struct tsb_config, tsb_map_vaddr)) || offsetof(struct tsb_config, tsb_map_vaddr)) ||
(TSB_CONFIG_MAP_PTE != (TSB_CONFIG_MAP_PTE !=
offsetof(struct tsb_config, tsb_map_pte))) offsetof(struct tsb_config, tsb_map_pte)));
tsb_config_offsets_are_bolixed_dave();
/* Attach to the address space of init_task. On SMP we /* Attach to the address space of init_task. On SMP we
* do this in smp.c:smp_callin for other cpus. * do this in smp.c:smp_callin for other cpus.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment