From 123fe3962d5ff66153d2cfe141eadc4f0b3ccd3e Mon Sep 17 00:00:00 2001 From: Ian Lepore Date: Sun, 27 Oct 2013 17:09:23 +0000 Subject: [PATCH] Remove the last dregs of trapframe_t. It turns out only arm was using this type, so remove it to make arm code more consistant with other platforms. Thanks to bde@ for pointing out only arm used trapframe_t. --- sys/arm/arm/cpufunc.c | 4 ++-- sys/arm/arm/trap.c | 42 ++++++++++++++++++++++++---------------- sys/arm/arm/undefined.c | 2 +- sys/arm/arm/vm_machdep.c | 2 +- sys/arm/include/frame.h | 4 ++-- 5 files changed, 31 insertions(+), 23 deletions(-) diff --git a/sys/arm/arm/cpufunc.c b/sys/arm/arm/cpufunc.c index 8286188a1a68..7cc267737e62 100644 --- a/sys/arm/arm/cpufunc.c +++ b/sys/arm/arm/cpufunc.c @@ -1721,7 +1721,7 @@ int early_abort_fixup(arg) void *arg; { - trapframe_t *frame = arg; + struct trapframe *frame = arg; u_int fault_pc; u_int fault_instruction; int saved_lr = 0; @@ -1862,7 +1862,7 @@ int late_abort_fixup(arg) void *arg; { - trapframe_t *frame = arg; + struct trapframe *frame = arg; u_int fault_pc; u_int fault_instruction; int saved_lr = 0; diff --git a/sys/arm/arm/trap.c b/sys/arm/arm/trap.c index 761169cac14b..bc1bc27d9d0f 100644 --- a/sys/arm/arm/trap.c +++ b/sys/arm/arm/trap.c @@ -123,8 +123,8 @@ __FBSDID("$FreeBSD$"); #endif -void swi_handler(trapframe_t *); -void undefinedinstruction(trapframe_t *); +void swi_handler(struct trapframe *); +void undefinedinstruction(struct trapframe *); #include #include @@ -145,13 +145,17 @@ struct ksig { u_long code; }; struct data_abort { - int (*func)(trapframe_t *, u_int, u_int, struct thread *, struct ksig *); + int (*func)(struct trapframe *, u_int, u_int, struct thread *, + struct ksig *); const char *desc; }; -static int dab_fatal(trapframe_t *, u_int, u_int, struct thread *, struct ksig *); -static int dab_align(trapframe_t *, u_int, u_int, struct thread *, struct ksig *); -static int dab_buserr(trapframe_t *, u_int, u_int, struct thread *, struct ksig *); +static int dab_fatal(struct trapframe *, u_int, u_int, struct thread *, + struct ksig *); +static int dab_align(struct trapframe *, u_int, u_int, struct thread *, + struct ksig *); +static int dab_buserr(struct trapframe *, u_int, u_int, struct thread *, + struct ksig *); static const struct data_abort data_aborts[] = { {dab_fatal, "Vector Exception"}, @@ -196,7 +200,8 @@ call_trapsignal(struct thread *td, int sig, u_long code) } static __inline int -data_abort_fixup(trapframe_t *tf, u_int fsr, u_int far, struct thread *td, struct ksig *ksig) +data_abort_fixup(struct trapframe *tf, u_int fsr, u_int far, struct thread *td, + struct ksig *ksig) { #ifdef CPU_ABORT_FIXUP_REQUIRED int error; @@ -226,7 +231,7 @@ data_abort_fixup(trapframe_t *tf, u_int fsr, u_int far, struct thread *td, struc } void -data_abort_handler(trapframe_t *tf) +data_abort_handler(struct trapframe *tf) { struct vm_map *map; struct pcb *pcb; @@ -482,7 +487,8 @@ out: * Note: If 'l' is NULL, we assume we're dealing with a prefetch abort. */ static int -dab_fatal(trapframe_t *tf, u_int fsr, u_int far, struct thread *td, struct ksig *ksig) +dab_fatal(struct trapframe *tf, u_int fsr, u_int far, struct thread *td, + struct ksig *ksig) { const char *mode; @@ -538,7 +544,8 @@ dab_fatal(trapframe_t *tf, u_int fsr, u_int far, struct thread *td, struct ksig * deliver a bus error to the process. */ static int -dab_align(trapframe_t *tf, u_int fsr, u_int far, struct thread *td, struct ksig *ksig) +dab_align(struct trapframe *tf, u_int fsr, u_int far, struct thread *td, + struct ksig *ksig) { /* Alignment faults are always fatal if they occur in kernel mode */ @@ -586,7 +593,8 @@ dab_align(trapframe_t *tf, u_int fsr, u_int far, struct thread *td, struct ksig * In all other cases, these data aborts are considered fatal. */ static int -dab_buserr(trapframe_t *tf, u_int fsr, u_int far, struct thread *td, struct ksig *ksig) +dab_buserr(struct trapframe *tf, u_int fsr, u_int far, struct thread *td, + struct ksig *ksig) { struct pcb *pcb = td->td_pcb; @@ -607,7 +615,7 @@ dab_buserr(trapframe_t *tf, u_int fsr, u_int far, struct thread *td, struct ksig * If the current trapframe is at the top of the kernel stack, * the fault _must_ have come from user mode. */ - if (tf != ((trapframe_t *)pcb->un_32.pcb32_sp) - 1) { + if (tf != ((struct trapframe *)pcb->un_32.pcb32_sp) - 1) { /* * Kernel mode. We're either about to die a * spectacular death, or pcb_onfault will come @@ -660,7 +668,7 @@ dab_buserr(trapframe_t *tf, u_int fsr, u_int far, struct thread *td, struct ksig } static __inline int -prefetch_abort_fixup(trapframe_t *tf, struct ksig *ksig) +prefetch_abort_fixup(struct trapframe *tf, struct ksig *ksig) { #ifdef CPU_ABORT_FIXUP_REQUIRED int error; @@ -691,7 +699,7 @@ prefetch_abort_fixup(trapframe_t *tf, struct ksig *ksig) } /* - * void prefetch_abort_handler(trapframe_t *tf) + * void prefetch_abort_handler(struct trapframe *tf) * * Abort handler called when instruction execution occurs at * a non existent or restricted (access permissions) memory page. @@ -702,7 +710,7 @@ prefetch_abort_fixup(trapframe_t *tf, struct ksig *ksig) * Otherwise fault the page in and try again. */ void -prefetch_abort_handler(trapframe_t *tf) +prefetch_abort_handler(struct trapframe *tf) { struct thread *td; struct proc * p; @@ -907,7 +915,7 @@ cpu_fetch_syscall_args(struct thread *td, struct syscall_args *sa) #include "../../kern/subr_syscall.c" static void -syscall(struct thread *td, trapframe_t *frame) +syscall(struct thread *td, struct trapframe *frame) { struct syscall_args sa; int error; @@ -932,7 +940,7 @@ syscall(struct thread *td, trapframe_t *frame) } void -swi_handler(trapframe_t *frame) +swi_handler(struct trapframe *frame) { struct thread *td = curthread; diff --git a/sys/arm/arm/undefined.c b/sys/arm/arm/undefined.c index 476dd601a8bc..7829ecea5f67 100644 --- a/sys/arm/arm/undefined.c +++ b/sys/arm/arm/undefined.c @@ -166,7 +166,7 @@ undefined_init() void -undefinedinstruction(trapframe_t *frame) +undefinedinstruction(struct trapframe *frame) { struct thread *td; u_int fault_pc; diff --git a/sys/arm/arm/vm_machdep.c b/sys/arm/arm/vm_machdep.c index 4013caac9e48..58cb1945ecf5 100644 --- a/sys/arm/arm/vm_machdep.c +++ b/sys/arm/arm/vm_machdep.c @@ -295,7 +295,7 @@ done: void cpu_set_syscall_retval(struct thread *td, int error) { - trapframe_t *frame; + struct trapframe *frame; int fixup; #ifdef __ARMEB__ uint32_t insn; diff --git a/sys/arm/include/frame.h b/sys/arm/include/frame.h index cd6a89706933..1e6f43a5b544 100644 --- a/sys/arm/include/frame.h +++ b/sys/arm/include/frame.h @@ -59,7 +59,7 @@ * Trap frame. Pushed onto the kernel stack on a trap (synchronous exception). */ -typedef struct trapframe { +struct trapframe { register_t tf_spsr; /* Zero on arm26 */ register_t tf_r0; register_t tf_r1; @@ -80,7 +80,7 @@ typedef struct trapframe { register_t tf_svc_lr; /* Not used on arm26 */ register_t tf_pc; register_t tf_pad; -} trapframe_t; +}; /* Register numbers */ #define tf_r13 tf_usr_sp