diff options
author | ian <ian@FreeBSD.org> | 2015-02-12 19:35:46 +0000 |
---|---|---|
committer | ian <ian@FreeBSD.org> | 2015-02-12 19:35:46 +0000 |
commit | a59279fefdfab4a6b42be074372e7c2acbd49a41 (patch) | |
tree | 6dac795e6a35873f6778527bb79f358eb42bdcdb /sys | |
parent | 564d364c5421989022df5e69f2c431b76846f050 (diff) | |
download | FreeBSD-src-a59279fefdfab4a6b42be074372e7c2acbd49a41.zip FreeBSD-src-a59279fefdfab4a6b42be074372e7c2acbd49a41.tar.gz |
MFC r276206:
For data and instruction prefetch aborts, call the same handler in the C
code, passing a 0/1 flag that indicates which type of abort it was. This
sets the stage for unifying the handling of page faults in a single routine.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arm/arm/exception.S | 10 | ||||
-rw-r--r-- | sys/arm/arm/trap.c | 7 | ||||
-rw-r--r-- | sys/arm/include/machdep.h | 3 |
3 files changed, 12 insertions, 8 deletions
diff --git a/sys/arm/arm/exception.S b/sys/arm/arm/exception.S index 8210d32..3886968 100644 --- a/sys/arm/arm/exception.S +++ b/sys/arm/arm/exception.S @@ -320,7 +320,8 @@ ASENTRY_NP(prefetch_abort_entry) PUSHFRAMEINSVC /* mode stack, build trapframe there. */ adr lr, exception_exit /* Return from handler via standard */ mov r0, sp /* exception exit routine. Pass the */ - b prefetch_abort_handler /* trapframe to the handler. */ + mov r1, #1 /* Type flag */ + b _C_LABEL(abort_handler) END(prefetch_abort_entry) /* @@ -337,9 +338,10 @@ ASENTRY_NP(data_abort_entry) #endif sub lr, lr, #8 /* Adjust the lr. Transition to scv32 */ PUSHFRAMEINSVC /* mode stack, build trapframe there. */ - adr lr, exception_exit /* Return from handler via standard */ - mov r0, sp /* exception exit routine. Pass the */ - b data_abort_handler /* trapframe to the handler. */ + adr lr, exception_exit /* Exception exit routine */ + mov r0, sp /* Trapframe to the handler */ + mov r1, #0 /* Type flag */ + b _C_LABEL(abort_handler) END(data_abort_entry) /* diff --git a/sys/arm/arm/trap.c b/sys/arm/arm/trap.c index 6649d88..ccd07c3 100644 --- a/sys/arm/arm/trap.c +++ b/sys/arm/arm/trap.c @@ -152,6 +152,7 @@ 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 void prefetch_abort_handler(struct trapframe *); static const struct data_abort data_aborts[] = { {dab_fatal, "Vector Exception"}, @@ -196,7 +197,7 @@ call_trapsignal(struct thread *td, int sig, u_long code) } void -data_abort_handler(struct trapframe *tf) +abort_handler(struct trapframe *tf, int type) { struct vm_map *map; struct pcb *pcb; @@ -209,6 +210,8 @@ data_abort_handler(struct trapframe *tf) struct ksig ksig; struct proc *p; + if (type == 1) + return (prefetch_abort_handler(tf)); /* Grab FAR/FSR before enabling interrupts */ far = cpu_faultaddress(); @@ -625,7 +628,7 @@ dab_buserr(struct trapframe *tf, u_int fsr, u_int far, struct thread *td, * does no have read permission so send it a signal. * Otherwise fault the page in and try again. */ -void +static void prefetch_abort_handler(struct trapframe *tf) { struct thread *td; diff --git a/sys/arm/include/machdep.h b/sys/arm/include/machdep.h index 67cc9bf..a756d3d 100644 --- a/sys/arm/include/machdep.h +++ b/sys/arm/include/machdep.h @@ -20,8 +20,7 @@ struct trapframe; void arm_lock_cache_line(vm_offset_t); void init_proc0(vm_offset_t kstack); void halt(void); -void data_abort_handler(struct trapframe *); -void prefetch_abort_handler(struct trapframe *); +void abort_handler(struct trapframe *, int ); void set_stackptrs(int cpu); void undefinedinstruction_bounce(struct trapframe *); |