aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/sparc/kernel/traps_64.c171
1 files changed, 91 insertions, 80 deletions
diff --git a/arch/sparc/kernel/traps_64.c b/arch/sparc/kernel/traps_64.c
index d073aabf65ed..10f7bb9fc140 100644
--- a/arch/sparc/kernel/traps_64.c
+++ b/arch/sparc/kernel/traps_64.c
@@ -2531,86 +2531,97 @@ extern void tsb_config_offsets_are_bolixed_dave(void);
2531void __init trap_init(void) 2531void __init trap_init(void)
2532{ 2532{
2533 /* Compile time sanity check. */ 2533 /* Compile time sanity check. */
2534 if (TI_TASK != offsetof(struct thread_info, task) || 2534 BUILD_BUG_ON(TI_TASK != offsetof(struct thread_info, task) ||
2535 TI_FLAGS != offsetof(struct thread_info, flags) || 2535 TI_FLAGS != offsetof(struct thread_info, flags) ||
2536 TI_CPU != offsetof(struct thread_info, cpu) || 2536 TI_CPU != offsetof(struct thread_info, cpu) ||
2537 TI_FPSAVED != offsetof(struct thread_info, fpsaved) || 2537 TI_FPSAVED != offsetof(struct thread_info, fpsaved) ||
2538 TI_KSP != offsetof(struct thread_info, ksp) || 2538 TI_KSP != offsetof(struct thread_info, ksp) ||
2539 TI_FAULT_ADDR != offsetof(struct thread_info, fault_address) || 2539 TI_FAULT_ADDR != offsetof(struct thread_info,
2540 TI_KREGS != offsetof(struct thread_info, kregs) || 2540 fault_address) ||
2541 TI_UTRAPS != offsetof(struct thread_info, utraps) || 2541 TI_KREGS != offsetof(struct thread_info, kregs) ||
2542 TI_EXEC_DOMAIN != offsetof(struct thread_info, exec_domain) || 2542 TI_UTRAPS != offsetof(struct thread_info, utraps) ||
2543 TI_REG_WINDOW != offsetof(struct thread_info, reg_window) || 2543 TI_EXEC_DOMAIN != offsetof(struct thread_info,
2544 TI_RWIN_SPTRS != offsetof(struct thread_info, rwbuf_stkptrs) || 2544 exec_domain) ||
2545 TI_GSR != offsetof(struct thread_info, gsr) || 2545 TI_REG_WINDOW != offsetof(struct thread_info,
2546 TI_XFSR != offsetof(struct thread_info, xfsr) || 2546 reg_window) ||
2547 TI_USER_CNTD0 != offsetof(struct thread_info, user_cntd0) || 2547 TI_RWIN_SPTRS != offsetof(struct thread_info,
2548 TI_USER_CNTD1 != offsetof(struct thread_info, user_cntd1) || 2548 rwbuf_stkptrs) ||
2549 TI_KERN_CNTD0 != offsetof(struct thread_info, kernel_cntd0) || 2549 TI_GSR != offsetof(struct thread_info, gsr) ||
2550 TI_KERN_CNTD1 != offsetof(struct thread_info, kernel_cntd1) || 2550 TI_XFSR != offsetof(struct thread_info, xfsr) ||
2551 TI_PCR != offsetof(struct thread_info, pcr_reg) || 2551 TI_USER_CNTD0 != offsetof(struct thread_info,
2552 TI_PRE_COUNT != offsetof(struct thread_info, preempt_count) || 2552 user_cntd0) ||
2553 TI_NEW_CHILD != offsetof(struct thread_info, new_child) || 2553 TI_USER_CNTD1 != offsetof(struct thread_info,
2554 TI_SYS_NOERROR != offsetof(struct thread_info, syscall_noerror) || 2554 user_cntd1) ||
2555 TI_RESTART_BLOCK != offsetof(struct thread_info, restart_block) || 2555 TI_KERN_CNTD0 != offsetof(struct thread_info,
2556 TI_KUNA_REGS != offsetof(struct thread_info, kern_una_regs) || 2556 kernel_cntd0) ||
2557 TI_KUNA_INSN != offsetof(struct thread_info, kern_una_insn) || 2557 TI_KERN_CNTD1 != offsetof(struct thread_info,
2558 TI_FPREGS != offsetof(struct thread_info, fpregs) || 2558 kernel_cntd1) ||
2559 (TI_FPREGS & (64 - 1))) 2559 TI_PCR != offsetof(struct thread_info, pcr_reg) ||
2560 thread_info_offsets_are_bolixed_dave(); 2560 TI_PRE_COUNT != offsetof(struct thread_info,
2561 2561 preempt_count) ||
2562 if (TRAP_PER_CPU_THREAD != offsetof(struct trap_per_cpu, thread) || 2562 TI_NEW_CHILD != offsetof(struct thread_info, new_child) ||
2563 (TRAP_PER_CPU_PGD_PADDR != 2563 TI_SYS_NOERROR != offsetof(struct thread_info,
2564 offsetof(struct trap_per_cpu, pgd_paddr)) || 2564 syscall_noerror) ||
2565 (TRAP_PER_CPU_CPU_MONDO_PA != 2565 TI_RESTART_BLOCK != offsetof(struct thread_info,
2566 offsetof(struct trap_per_cpu, cpu_mondo_pa)) || 2566 restart_block) ||
2567 (TRAP_PER_CPU_DEV_MONDO_PA != 2567 TI_KUNA_REGS != offsetof(struct thread_info,
2568 offsetof(struct trap_per_cpu, dev_mondo_pa)) || 2568 kern_una_regs) ||
2569 (TRAP_PER_CPU_RESUM_MONDO_PA != 2569 TI_KUNA_INSN != offsetof(struct thread_info,
2570 offsetof(struct trap_per_cpu, resum_mondo_pa)) || 2570 kern_una_insn) ||
2571 (TRAP_PER_CPU_RESUM_KBUF_PA != 2571 TI_FPREGS != offsetof(struct thread_info, fpregs) ||
2572 offsetof(struct trap_per_cpu, resum_kernel_buf_pa)) || 2572 (TI_FPREGS & (64 - 1)));
2573 (TRAP_PER_CPU_NONRESUM_MONDO_PA != 2573
2574 offsetof(struct trap_per_cpu, nonresum_mondo_pa)) || 2574 BUILD_BUG_ON(TRAP_PER_CPU_THREAD != offsetof(struct trap_per_cpu,
2575 (TRAP_PER_CPU_NONRESUM_KBUF_PA != 2575 thread) ||
2576 offsetof(struct trap_per_cpu, nonresum_kernel_buf_pa)) || 2576 (TRAP_PER_CPU_PGD_PADDR !=
2577 (TRAP_PER_CPU_FAULT_INFO != 2577 offsetof(struct trap_per_cpu, pgd_paddr)) ||
2578 offsetof(struct trap_per_cpu, fault_info)) || 2578 (TRAP_PER_CPU_CPU_MONDO_PA !=
2579 (TRAP_PER_CPU_CPU_MONDO_BLOCK_PA != 2579 offsetof(struct trap_per_cpu, cpu_mondo_pa)) ||
2580 offsetof(struct trap_per_cpu, cpu_mondo_block_pa)) || 2580 (TRAP_PER_CPU_DEV_MONDO_PA !=
2581 (TRAP_PER_CPU_CPU_LIST_PA != 2581 offsetof(struct trap_per_cpu, dev_mondo_pa)) ||
2582 offsetof(struct trap_per_cpu, cpu_list_pa)) || 2582 (TRAP_PER_CPU_RESUM_MONDO_PA !=
2583 (TRAP_PER_CPU_TSB_HUGE != 2583 offsetof(struct trap_per_cpu, resum_mondo_pa)) ||
2584 offsetof(struct trap_per_cpu, tsb_huge)) || 2584 (TRAP_PER_CPU_RESUM_KBUF_PA !=
2585 (TRAP_PER_CPU_TSB_HUGE_TEMP != 2585 offsetof(struct trap_per_cpu, resum_kernel_buf_pa)) ||
2586 offsetof(struct trap_per_cpu, tsb_huge_temp)) || 2586 (TRAP_PER_CPU_NONRESUM_MONDO_PA !=
2587 (TRAP_PER_CPU_IRQ_WORKLIST_PA != 2587 offsetof(struct trap_per_cpu, nonresum_mondo_pa)) ||
2588 offsetof(struct trap_per_cpu, irq_worklist_pa)) || 2588 (TRAP_PER_CPU_NONRESUM_KBUF_PA !=
2589 (TRAP_PER_CPU_CPU_MONDO_QMASK != 2589 offsetof(struct trap_per_cpu, nonresum_kernel_buf_pa)) ||
2590 offsetof(struct trap_per_cpu, cpu_mondo_qmask)) || 2590 (TRAP_PER_CPU_FAULT_INFO !=
2591 (TRAP_PER_CPU_DEV_MONDO_QMASK != 2591 offsetof(struct trap_per_cpu, fault_info)) ||
2592 offsetof(struct trap_per_cpu, dev_mondo_qmask)) || 2592 (TRAP_PER_CPU_CPU_MONDO_BLOCK_PA !=
2593 (TRAP_PER_CPU_RESUM_QMASK != 2593 offsetof(struct trap_per_cpu, cpu_mondo_block_pa)) ||
2594 offsetof(struct trap_per_cpu, resum_qmask)) || 2594 (TRAP_PER_CPU_CPU_LIST_PA !=
2595 (TRAP_PER_CPU_NONRESUM_QMASK != 2595 offsetof(struct trap_per_cpu, cpu_list_pa)) ||
2596 offsetof(struct trap_per_cpu, nonresum_qmask)) || 2596 (TRAP_PER_CPU_TSB_HUGE !=
2597 (TRAP_PER_CPU_PER_CPU_BASE != 2597 offsetof(struct trap_per_cpu, tsb_huge)) ||
2598 offsetof(struct trap_per_cpu, __per_cpu_base))) 2598 (TRAP_PER_CPU_TSB_HUGE_TEMP !=
2599 trap_per_cpu_offsets_are_bolixed_dave(); 2599 offsetof(struct trap_per_cpu, tsb_huge_temp)) ||
2600 2600 (TRAP_PER_CPU_IRQ_WORKLIST_PA !=
2601 if ((TSB_CONFIG_TSB != 2601 offsetof(struct trap_per_cpu, irq_worklist_pa)) ||
2602 offsetof(struct tsb_config, tsb)) || 2602 (TRAP_PER_CPU_CPU_MONDO_QMASK !=
2603 (TSB_CONFIG_RSS_LIMIT != 2603 offsetof(struct trap_per_cpu, cpu_mondo_qmask)) ||
2604 offsetof(struct tsb_config, tsb_rss_limit)) || 2604 (TRAP_PER_CPU_DEV_MONDO_QMASK !=
2605 (TSB_CONFIG_NENTRIES != 2605 offsetof(struct trap_per_cpu, dev_mondo_qmask)) ||
2606 offsetof(struct tsb_config, tsb_nentries)) || 2606 (TRAP_PER_CPU_RESUM_QMASK !=
2607 (TSB_CONFIG_REG_VAL != 2607 offsetof(struct trap_per_cpu, resum_qmask)) ||
2608 offsetof(struct tsb_config, tsb_reg_val)) || 2608 (TRAP_PER_CPU_NONRESUM_QMASK !=
2609 (TSB_CONFIG_MAP_VADDR != 2609 offsetof(struct trap_per_cpu, nonresum_qmask)) ||
2610 offsetof(struct tsb_config, tsb_map_vaddr)) || 2610 (TRAP_PER_CPU_PER_CPU_BASE !=
2611 (TSB_CONFIG_MAP_PTE != 2611 offsetof(struct trap_per_cpu, __per_cpu_base)));
2612 offsetof(struct tsb_config, tsb_map_pte))) 2612
2613 tsb_config_offsets_are_bolixed_dave(); 2613 BUILD_BUG_ON((TSB_CONFIG_TSB !=
2614 offsetof(struct tsb_config, tsb)) ||
2615 (TSB_CONFIG_RSS_LIMIT !=
2616 offsetof(struct tsb_config, tsb_rss_limit)) ||
2617 (TSB_CONFIG_NENTRIES !=
2618 offsetof(struct tsb_config, tsb_nentries)) ||
2619 (TSB_CONFIG_REG_VAL !=
2620 offsetof(struct tsb_config, tsb_reg_val)) ||
2621 (TSB_CONFIG_MAP_VADDR !=
2622 offsetof(struct tsb_config, tsb_map_vaddr)) ||
2623 (TSB_CONFIG_MAP_PTE !=
2624 offsetof(struct tsb_config, tsb_map_pte)));
2614 2625
2615 /* Attach to the address space of init_task. On SMP we 2626 /* Attach to the address space of init_task. On SMP we
2616 * do this in smp.c:smp_callin for other cpus. 2627 * do this in smp.c:smp_callin for other cpus.