aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel/traps_64.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-06-16 20:24:53 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-06-16 20:24:53 -0400
commit492b057c426e4aa747484958e18e9da29003985d (patch)
tree34e08c24618688d8bcc190523028b5f94cce0c0b /arch/sparc/kernel/traps_64.c
parent313485175da221c388f6a8ecf4c30062ba9bea17 (diff)
parent300df7dc89cc276377fc020704e34875d5c473b6 (diff)
Merge commit 'origin/master' into next
Diffstat (limited to 'arch/sparc/kernel/traps_64.c')
-rw-r--r--arch/sparc/kernel/traps_64.c170
1 files changed, 92 insertions, 78 deletions
diff --git a/arch/sparc/kernel/traps_64.c b/arch/sparc/kernel/traps_64.c
index d809c4ebb48f..10f7bb9fc140 100644
--- a/arch/sparc/kernel/traps_64.c
+++ b/arch/sparc/kernel/traps_64.c
@@ -2509,6 +2509,7 @@ void do_getpsr(struct pt_regs *regs)
2509} 2509}
2510 2510
2511struct trap_per_cpu trap_block[NR_CPUS]; 2511struct trap_per_cpu trap_block[NR_CPUS];
2512EXPORT_SYMBOL(trap_block);
2512 2513
2513/* This can get invoked before sched_init() so play it super safe 2514/* This can get invoked before sched_init() so play it super safe
2514 * and use hard_smp_processor_id(). 2515 * and use hard_smp_processor_id().
@@ -2530,84 +2531,97 @@ extern void tsb_config_offsets_are_bolixed_dave(void);
2530void __init trap_init(void) 2531void __init trap_init(void)
2531{ 2532{
2532 /* Compile time sanity check. */ 2533 /* Compile time sanity check. */
2533 if (TI_TASK != offsetof(struct thread_info, task) || 2534 BUILD_BUG_ON(TI_TASK != offsetof(struct thread_info, task) ||
2534 TI_FLAGS != offsetof(struct thread_info, flags) || 2535 TI_FLAGS != offsetof(struct thread_info, flags) ||
2535 TI_CPU != offsetof(struct thread_info, cpu) || 2536 TI_CPU != offsetof(struct thread_info, cpu) ||
2536 TI_FPSAVED != offsetof(struct thread_info, fpsaved) || 2537 TI_FPSAVED != offsetof(struct thread_info, fpsaved) ||
2537 TI_KSP != offsetof(struct thread_info, ksp) || 2538 TI_KSP != offsetof(struct thread_info, ksp) ||
2538 TI_FAULT_ADDR != offsetof(struct thread_info, fault_address) || 2539 TI_FAULT_ADDR != offsetof(struct thread_info,
2539 TI_KREGS != offsetof(struct thread_info, kregs) || 2540 fault_address) ||
2540 TI_UTRAPS != offsetof(struct thread_info, utraps) || 2541 TI_KREGS != offsetof(struct thread_info, kregs) ||
2541 TI_EXEC_DOMAIN != offsetof(struct thread_info, exec_domain) || 2542 TI_UTRAPS != offsetof(struct thread_info, utraps) ||
2542 TI_REG_WINDOW != offsetof(struct thread_info, reg_window) || 2543 TI_EXEC_DOMAIN != offsetof(struct thread_info,
2543 TI_RWIN_SPTRS != offsetof(struct thread_info, rwbuf_stkptrs) || 2544 exec_domain) ||
2544 TI_GSR != offsetof(struct thread_info, gsr) || 2545 TI_REG_WINDOW != offsetof(struct thread_info,
2545 TI_XFSR != offsetof(struct thread_info, xfsr) || 2546 reg_window) ||
2546 TI_USER_CNTD0 != offsetof(struct thread_info, user_cntd0) || 2547 TI_RWIN_SPTRS != offsetof(struct thread_info,
2547 TI_USER_CNTD1 != offsetof(struct thread_info, user_cntd1) || 2548 rwbuf_stkptrs) ||
2548 TI_KERN_CNTD0 != offsetof(struct thread_info, kernel_cntd0) || 2549 TI_GSR != offsetof(struct thread_info, gsr) ||
2549 TI_KERN_CNTD1 != offsetof(struct thread_info, kernel_cntd1) || 2550 TI_XFSR != offsetof(struct thread_info, xfsr) ||
2550 TI_PCR != offsetof(struct thread_info, pcr_reg) || 2551 TI_USER_CNTD0 != offsetof(struct thread_info,
2551 TI_PRE_COUNT != offsetof(struct thread_info, preempt_count) || 2552 user_cntd0) ||
2552 TI_NEW_CHILD != offsetof(struct thread_info, new_child) || 2553 TI_USER_CNTD1 != offsetof(struct thread_info,
2553 TI_SYS_NOERROR != offsetof(struct thread_info, syscall_noerror) || 2554 user_cntd1) ||
2554 TI_RESTART_BLOCK != offsetof(struct thread_info, restart_block) || 2555 TI_KERN_CNTD0 != offsetof(struct thread_info,
2555 TI_KUNA_REGS != offsetof(struct thread_info, kern_una_regs) || 2556 kernel_cntd0) ||
2556 TI_KUNA_INSN != offsetof(struct thread_info, kern_una_insn) || 2557 TI_KERN_CNTD1 != offsetof(struct thread_info,
2557 TI_FPREGS != offsetof(struct thread_info, fpregs) || 2558 kernel_cntd1) ||
2558 (TI_FPREGS & (64 - 1))) 2559 TI_PCR != offsetof(struct thread_info, pcr_reg) ||
2559 thread_info_offsets_are_bolixed_dave(); 2560 TI_PRE_COUNT != offsetof(struct thread_info,
2560 2561 preempt_count) ||
2561 if (TRAP_PER_CPU_THREAD != offsetof(struct trap_per_cpu, thread) || 2562 TI_NEW_CHILD != offsetof(struct thread_info, new_child) ||
2562 (TRAP_PER_CPU_PGD_PADDR != 2563 TI_SYS_NOERROR != offsetof(struct thread_info,
2563 offsetof(struct trap_per_cpu, pgd_paddr)) || 2564 syscall_noerror) ||
2564 (TRAP_PER_CPU_CPU_MONDO_PA != 2565 TI_RESTART_BLOCK != offsetof(struct thread_info,
2565 offsetof(struct trap_per_cpu, cpu_mondo_pa)) || 2566 restart_block) ||
2566 (TRAP_PER_CPU_DEV_MONDO_PA != 2567 TI_KUNA_REGS != offsetof(struct thread_info,
2567 offsetof(struct trap_per_cpu, dev_mondo_pa)) || 2568 kern_una_regs) ||
2568 (TRAP_PER_CPU_RESUM_MONDO_PA != 2569 TI_KUNA_INSN != offsetof(struct thread_info,
2569 offsetof(struct trap_per_cpu, resum_mondo_pa)) || 2570 kern_una_insn) ||
2570 (TRAP_PER_CPU_RESUM_KBUF_PA != 2571 TI_FPREGS != offsetof(struct thread_info, fpregs) ||
2571 offsetof(struct trap_per_cpu, resum_kernel_buf_pa)) || 2572 (TI_FPREGS & (64 - 1)));
2572 (TRAP_PER_CPU_NONRESUM_MONDO_PA != 2573
2573 offsetof(struct trap_per_cpu, nonresum_mondo_pa)) || 2574 BUILD_BUG_ON(TRAP_PER_CPU_THREAD != offsetof(struct trap_per_cpu,
2574 (TRAP_PER_CPU_NONRESUM_KBUF_PA != 2575 thread) ||
2575 offsetof(struct trap_per_cpu, nonresum_kernel_buf_pa)) || 2576 (TRAP_PER_CPU_PGD_PADDR !=
2576 (TRAP_PER_CPU_FAULT_INFO != 2577 offsetof(struct trap_per_cpu, pgd_paddr)) ||
2577 offsetof(struct trap_per_cpu, fault_info)) || 2578 (TRAP_PER_CPU_CPU_MONDO_PA !=
2578 (TRAP_PER_CPU_CPU_MONDO_BLOCK_PA != 2579 offsetof(struct trap_per_cpu, cpu_mondo_pa)) ||
2579 offsetof(struct trap_per_cpu, cpu_mondo_block_pa)) || 2580 (TRAP_PER_CPU_DEV_MONDO_PA !=
2580 (TRAP_PER_CPU_CPU_LIST_PA != 2581 offsetof(struct trap_per_cpu, dev_mondo_pa)) ||
2581 offsetof(struct trap_per_cpu, cpu_list_pa)) || 2582 (TRAP_PER_CPU_RESUM_MONDO_PA !=
2582 (TRAP_PER_CPU_TSB_HUGE != 2583 offsetof(struct trap_per_cpu, resum_mondo_pa)) ||
2583 offsetof(struct trap_per_cpu, tsb_huge)) || 2584 (TRAP_PER_CPU_RESUM_KBUF_PA !=
2584 (TRAP_PER_CPU_TSB_HUGE_TEMP != 2585 offsetof(struct trap_per_cpu, resum_kernel_buf_pa)) ||
2585 offsetof(struct trap_per_cpu, tsb_huge_temp)) || 2586 (TRAP_PER_CPU_NONRESUM_MONDO_PA !=
2586 (TRAP_PER_CPU_IRQ_WORKLIST_PA != 2587 offsetof(struct trap_per_cpu, nonresum_mondo_pa)) ||
2587 offsetof(struct trap_per_cpu, irq_worklist_pa)) || 2588 (TRAP_PER_CPU_NONRESUM_KBUF_PA !=
2588 (TRAP_PER_CPU_CPU_MONDO_QMASK != 2589 offsetof(struct trap_per_cpu, nonresum_kernel_buf_pa)) ||
2589 offsetof(struct trap_per_cpu, cpu_mondo_qmask)) || 2590 (TRAP_PER_CPU_FAULT_INFO !=
2590 (TRAP_PER_CPU_DEV_MONDO_QMASK != 2591 offsetof(struct trap_per_cpu, fault_info)) ||
2591 offsetof(struct trap_per_cpu, dev_mondo_qmask)) || 2592 (TRAP_PER_CPU_CPU_MONDO_BLOCK_PA !=
2592 (TRAP_PER_CPU_RESUM_QMASK != 2593 offsetof(struct trap_per_cpu, cpu_mondo_block_pa)) ||
2593 offsetof(struct trap_per_cpu, resum_qmask)) || 2594 (TRAP_PER_CPU_CPU_LIST_PA !=
2594 (TRAP_PER_CPU_NONRESUM_QMASK != 2595 offsetof(struct trap_per_cpu, cpu_list_pa)) ||
2595 offsetof(struct trap_per_cpu, nonresum_qmask))) 2596 (TRAP_PER_CPU_TSB_HUGE !=
2596 trap_per_cpu_offsets_are_bolixed_dave(); 2597 offsetof(struct trap_per_cpu, tsb_huge)) ||
2597 2598 (TRAP_PER_CPU_TSB_HUGE_TEMP !=
2598 if ((TSB_CONFIG_TSB != 2599 offsetof(struct trap_per_cpu, tsb_huge_temp)) ||
2599 offsetof(struct tsb_config, tsb)) || 2600 (TRAP_PER_CPU_IRQ_WORKLIST_PA !=
2600 (TSB_CONFIG_RSS_LIMIT != 2601 offsetof(struct trap_per_cpu, irq_worklist_pa)) ||
2601 offsetof(struct tsb_config, tsb_rss_limit)) || 2602 (TRAP_PER_CPU_CPU_MONDO_QMASK !=
2602 (TSB_CONFIG_NENTRIES != 2603 offsetof(struct trap_per_cpu, cpu_mondo_qmask)) ||
2603 offsetof(struct tsb_config, tsb_nentries)) || 2604 (TRAP_PER_CPU_DEV_MONDO_QMASK !=
2604 (TSB_CONFIG_REG_VAL != 2605 offsetof(struct trap_per_cpu, dev_mondo_qmask)) ||
2605 offsetof(struct tsb_config, tsb_reg_val)) || 2606 (TRAP_PER_CPU_RESUM_QMASK !=
2606 (TSB_CONFIG_MAP_VADDR != 2607 offsetof(struct trap_per_cpu, resum_qmask)) ||
2607 offsetof(struct tsb_config, tsb_map_vaddr)) || 2608 (TRAP_PER_CPU_NONRESUM_QMASK !=
2608 (TSB_CONFIG_MAP_PTE != 2609 offsetof(struct trap_per_cpu, nonresum_qmask)) ||
2609 offsetof(struct tsb_config, tsb_map_pte))) 2610 (TRAP_PER_CPU_PER_CPU_BASE !=
2610 tsb_config_offsets_are_bolixed_dave(); 2611 offsetof(struct trap_per_cpu, __per_cpu_base)));
2612
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)));
2611 2625
2612 /* Attach to the address space of init_task. On SMP we 2626 /* Attach to the address space of init_task. On SMP we
2613 * do this in smp.c:smp_callin for other cpus. 2627 * do this in smp.c:smp_callin for other cpus.