summaryrefslogtreecommitdiffstats
path: root/sys/powerpc
diff options
context:
space:
mode:
authorbenno <benno@FreeBSD.org>2002-07-09 13:40:37 +0000
committerbenno <benno@FreeBSD.org>2002-07-09 13:40:37 +0000
commitdca19fc0355c63e4b650c383604d4473a3d4978a (patch)
tree74c45fe1d0ca8b360d6a3a0e92c39535839a2807 /sys/powerpc
parent73aaaf9a29090d6472dd2d4bcb682b937dd9fc83 (diff)
downloadFreeBSD-src-dca19fc0355c63e4b650c383604d4473a3d4978a.zip
FreeBSD-src-dca19fc0355c63e4b650c383604d4473a3d4978a.tar.gz
Tidy up trap vector and external interrupt setup.
Diffstat (limited to 'sys/powerpc')
-rw-r--r--sys/powerpc/aim/machdep.c41
-rw-r--r--sys/powerpc/powerpc/machdep.c41
2 files changed, 16 insertions, 66 deletions
diff --git a/sys/powerpc/aim/machdep.c b/sys/powerpc/aim/machdep.c
index cedcf73..38431d7 100644
--- a/sys/powerpc/aim/machdep.c
+++ b/sys/powerpc/aim/machdep.c
@@ -221,6 +221,7 @@ cpu_startup(void *dummy)
*/
bufinit();
vm_pager_bufferinit();
+
EVENTHANDLER_REGISTER(shutdown_final, powerpc_ofw_shutdown, 0,
SHUTDOWN_PRI_LAST);
@@ -320,6 +321,7 @@ extern void *decrint, *decrsize;
extern void *tlbimiss, *tlbimsize;
extern void *tlbdlmiss, *tlbdlmsize;
extern void *tlbdsmiss, *tlbdsmsize;
+extern void *extint, *extsize;
#if 0 /* XXX: interrupt handler. We'll get to this later */
extern void ext_intr(void);
@@ -346,11 +348,12 @@ powerpc_init(u_int startkernel, u_int endkernel, u_int basekernel, char *args)
/*
* XXX: Initialize the interrupt tables.
*/
- bcopy(&decrint, (void *)EXC_DECR, (size_t)&decrsize);
- bcopy(&dsitrap, (void *)EXC_DSI, (size_t)&dsisize);
- bcopy(&isitrap, (void *)EXC_ISI, (size_t)&isisize);
- bcopy(&trapcode, (void *)EXC_SC, (size_t)&trapsize);
- bcopy(&trapcode, (void *)EXC_FPU, (size_t)&trapsize);
+ bcopy(&trapcode, (void *)EXC_DECR, (size_t)&trapsize);
+ bcopy(&dsitrap, (void *)EXC_DSI, (size_t)&dsisize);
+ bcopy(&isitrap, (void *)EXC_ISI, (size_t)&isisize);
+ bcopy(&trapcode, (void *)EXC_SC, (size_t)&trapsize);
+ bcopy(&trapcode, (void *)EXC_FPU, (size_t)&trapsize);
+ bcopy(&trapcode, (void *)EXC_EXI, (size_t)&trapsize);
/*
* Start initializing proc0 and thread0.
@@ -377,7 +380,6 @@ powerpc_init(u_int startkernel, u_int endkernel, u_int basekernel, char *args)
/*
* Initialise virtual memory.
*/
- ofmsr |= PSL_IR | PSL_DR;
pmap_bootstrap(startkernel, endkernel);
/*
@@ -849,33 +851,6 @@ setregs(struct thread *td, u_long entry, u_long stack, u_long ps_strings)
td->td_pcb->pcb_flags = 0;
}
-extern void *extint, *extsize;
-extern u_long extint_call;
-
-void
-install_extint(void (*handler)(void))
-{
- u_long offset;
- int omsr, msr;
-
- offset = (u_long)handler - (u_long)&extint_call;
-
-#ifdef DIAGNOSTIC
- if (offset > 0x1ffffff)
- panic("install_extint: too far away");
-#endif
-
- msr = mfmsr();
- mtmsr(msr & ~(PSL_EE|PSL_RI));
-
- extint_call = (extint_call & 0xfc000003) | offset;
- bcopy(&extint, (void *)EXC_EXI, (size_t)&extsize);
- __syncicache((void *)&extint_call, sizeof extint_call);
- __syncicache((void *)EXC_EXI, (int)&extsize);
-
- mtmsr(msr);
-}
-
#if !defined(DDB)
void
Debugger(const char *msg)
diff --git a/sys/powerpc/powerpc/machdep.c b/sys/powerpc/powerpc/machdep.c
index cedcf73..38431d7 100644
--- a/sys/powerpc/powerpc/machdep.c
+++ b/sys/powerpc/powerpc/machdep.c
@@ -221,6 +221,7 @@ cpu_startup(void *dummy)
*/
bufinit();
vm_pager_bufferinit();
+
EVENTHANDLER_REGISTER(shutdown_final, powerpc_ofw_shutdown, 0,
SHUTDOWN_PRI_LAST);
@@ -320,6 +321,7 @@ extern void *decrint, *decrsize;
extern void *tlbimiss, *tlbimsize;
extern void *tlbdlmiss, *tlbdlmsize;
extern void *tlbdsmiss, *tlbdsmsize;
+extern void *extint, *extsize;
#if 0 /* XXX: interrupt handler. We'll get to this later */
extern void ext_intr(void);
@@ -346,11 +348,12 @@ powerpc_init(u_int startkernel, u_int endkernel, u_int basekernel, char *args)
/*
* XXX: Initialize the interrupt tables.
*/
- bcopy(&decrint, (void *)EXC_DECR, (size_t)&decrsize);
- bcopy(&dsitrap, (void *)EXC_DSI, (size_t)&dsisize);
- bcopy(&isitrap, (void *)EXC_ISI, (size_t)&isisize);
- bcopy(&trapcode, (void *)EXC_SC, (size_t)&trapsize);
- bcopy(&trapcode, (void *)EXC_FPU, (size_t)&trapsize);
+ bcopy(&trapcode, (void *)EXC_DECR, (size_t)&trapsize);
+ bcopy(&dsitrap, (void *)EXC_DSI, (size_t)&dsisize);
+ bcopy(&isitrap, (void *)EXC_ISI, (size_t)&isisize);
+ bcopy(&trapcode, (void *)EXC_SC, (size_t)&trapsize);
+ bcopy(&trapcode, (void *)EXC_FPU, (size_t)&trapsize);
+ bcopy(&trapcode, (void *)EXC_EXI, (size_t)&trapsize);
/*
* Start initializing proc0 and thread0.
@@ -377,7 +380,6 @@ powerpc_init(u_int startkernel, u_int endkernel, u_int basekernel, char *args)
/*
* Initialise virtual memory.
*/
- ofmsr |= PSL_IR | PSL_DR;
pmap_bootstrap(startkernel, endkernel);
/*
@@ -849,33 +851,6 @@ setregs(struct thread *td, u_long entry, u_long stack, u_long ps_strings)
td->td_pcb->pcb_flags = 0;
}
-extern void *extint, *extsize;
-extern u_long extint_call;
-
-void
-install_extint(void (*handler)(void))
-{
- u_long offset;
- int omsr, msr;
-
- offset = (u_long)handler - (u_long)&extint_call;
-
-#ifdef DIAGNOSTIC
- if (offset > 0x1ffffff)
- panic("install_extint: too far away");
-#endif
-
- msr = mfmsr();
- mtmsr(msr & ~(PSL_EE|PSL_RI));
-
- extint_call = (extint_call & 0xfc000003) | offset;
- bcopy(&extint, (void *)EXC_EXI, (size_t)&extsize);
- __syncicache((void *)&extint_call, sizeof extint_call);
- __syncicache((void *)EXC_EXI, (int)&extsize);
-
- mtmsr(msr);
-}
-
#if !defined(DDB)
void
Debugger(const char *msg)
OpenPOWER on IntegriCloud