From owner-svn-src-all@FreeBSD.ORG Thu Feb 12 19:35:48 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EFF83A80; Thu, 12 Feb 2015 19:35:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DA481FD5; Thu, 12 Feb 2015 19:35:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1CJZlGZ059420; Thu, 12 Feb 2015 19:35:47 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1CJZl3q059417; Thu, 12 Feb 2015 19:35:47 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201502121935.t1CJZl3q059417@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 12 Feb 2015 19:35:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r278630 - in stable/10/sys/arm: arm include X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Feb 2015 19:35:48 -0000 Author: ian Date: Thu Feb 12 19:35:46 2015 New Revision: 278630 URL: https://svnweb.freebsd.org/changeset/base/278630 Log: 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. Modified: stable/10/sys/arm/arm/exception.S stable/10/sys/arm/arm/trap.c stable/10/sys/arm/include/machdep.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/exception.S ============================================================================== --- stable/10/sys/arm/arm/exception.S Thu Feb 12 19:32:07 2015 (r278629) +++ stable/10/sys/arm/arm/exception.S Thu Feb 12 19:35:46 2015 (r278630) @@ -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) /* Modified: stable/10/sys/arm/arm/trap.c ============================================================================== --- stable/10/sys/arm/arm/trap.c Thu Feb 12 19:32:07 2015 (r278629) +++ stable/10/sys/arm/arm/trap.c Thu Feb 12 19:35:46 2015 (r278630) @@ -152,6 +152,7 @@ static int dab_align(struct trapframe *, 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 s } 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 f * 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; Modified: stable/10/sys/arm/include/machdep.h ============================================================================== --- stable/10/sys/arm/include/machdep.h Thu Feb 12 19:32:07 2015 (r278629) +++ stable/10/sys/arm/include/machdep.h Thu Feb 12 19:35:46 2015 (r278630) @@ -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 *);