From 1560b5a0db2095ba86997c5fe4a4cca8fc306e8e Mon Sep 17 00:00:00 2001
From: Andreas Faerber <andreas.faerber@web.de>
Date: Sat, 5 Jun 2010 13:59:42 +0200
Subject: [PATCH 2/4] Add support for per-CPU fault_handler
---
src/system/kernel/arch/ppc/arch_int.cpp | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/src/system/kernel/arch/ppc/arch_int.cpp b/src/system/kernel/arch/ppc/arch_int.cpp
index 7b2932e..fc445b1 100644
a
|
b
|
ppc_exception_entry(int vector, struct iframe *iframe)
|
124 | 124 | bool kernelDebugger = debug_debugger_running(); |
125 | 125 | |
126 | 126 | if (kernelDebugger) { |
127 | | // if this thread has a fault handler, we're allowed to be here |
| 127 | // if this CPU or this thread has a fault handler, |
| 128 | // we're allowed to be here |
| 129 | cpu_ent* cpu = &gCPU[smp_get_current_cpu()]; |
| 130 | if (cpu->fault_handler != 0) { |
| 131 | iframe->srr0 = cpu->fault_handler; |
| 132 | iframe->r1 = cpu->fault_handler_stack_pointer; |
| 133 | break; |
| 134 | } |
128 | 135 | struct thread *thread = thread_get_current_thread(); |
129 | 136 | if (thread && thread->fault_handler != 0) { |
130 | 137 | iframe->srr0 = thread->fault_handler; |