From owner-svn-src-head@freebsd.org Tue Oct 6 12:56:30 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ACB72432837; Tue, 6 Oct 2020 12:56:30 +0000 (UTC) (envelope-from jrtc27@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C5HXZ43qqz4S9M; Tue, 6 Oct 2020 12:56:30 +0000 (UTC) (envelope-from jrtc27@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6AA1A27105; Tue, 6 Oct 2020 12:56:30 +0000 (UTC) (envelope-from jrtc27@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 096CuUG4088179; Tue, 6 Oct 2020 12:56:30 GMT (envelope-from jrtc27@FreeBSD.org) Received: (from jrtc27@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 096CuU2d088178; Tue, 6 Oct 2020 12:56:30 GMT (envelope-from jrtc27@FreeBSD.org) Message-Id: <202010061256.096CuU2d088178@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jrtc27 set sender to jrtc27@FreeBSD.org using -f From: Jessica Clarke Date: Tue, 6 Oct 2020 12:56:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366484 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: jrtc27 X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 366484 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Oct 2020 12:56:30 -0000 Author: jrtc27 Date: Tue Oct 6 12:56:29 2020 New Revision: 366484 URL: https://svnweb.freebsd.org/changeset/base/366484 Log: riscv: De-Arm a few names These names were inherited from the arm64 port and should be changed to the RISC-V terminology. Reviewed by: jhb (mentor), kp, markj Approved by: jhb (mentor), kp, markj Differential Revision: https://reviews.freebsd.org/D26671 Modified: head/sys/riscv/riscv/exception.S head/sys/riscv/riscv/trap.c Modified: head/sys/riscv/riscv/exception.S ============================================================================== --- head/sys/riscv/riscv/exception.S Tue Oct 6 11:29:08 2020 (r366483) +++ head/sys/riscv/riscv/exception.S Tue Oct 6 12:56:29 2020 (r366484) @@ -40,12 +40,12 @@ __FBSDID("$FreeBSD$"); #include #include -.macro save_registers el +.macro save_registers mode addi sp, sp, -(TF_SIZE) sd ra, (TF_RA)(sp) -.if \el == 0 /* We came from userspace. */ +.if \mode == 0 /* We came from userspace. */ sd gp, (TF_GP)(sp) .option push .option norelax @@ -88,7 +88,7 @@ __FBSDID("$FreeBSD$"); sd a6, (TF_A + 6 * 8)(sp) sd a7, (TF_A + 7 * 8)(sp) -.if \el == 1 +.if \mode == 1 /* Store kernel sp */ li t1, TF_SIZE add t0, sp, t1 @@ -110,9 +110,9 @@ __FBSDID("$FreeBSD$"); sd t0, (TF_SCAUSE)(sp) .endm -.macro load_registers el +.macro load_registers mode ld t0, (TF_SSTATUS)(sp) -.if \el == 0 +.if \mode == 0 /* Ensure user interrupts will be enabled on eret */ li t1, SSTATUS_SPIE or t0, t0, t1 @@ -130,7 +130,7 @@ __FBSDID("$FreeBSD$"); ld t0, (TF_SEPC)(sp) csrw sepc, t0 -.if \el == 0 +.if \mode == 0 /* We go to userspace. Load user sp */ ld t0, (TF_SP)(sp) csrw sscratch, t0 Modified: head/sys/riscv/riscv/trap.c ============================================================================== --- head/sys/riscv/riscv/trap.c Tue Oct 6 11:29:08 2020 (r366483) +++ head/sys/riscv/riscv/trap.c Tue Oct 6 12:56:29 2020 (r366484) @@ -158,7 +158,7 @@ dump_regs(struct trapframe *frame) } static void -svc_handler(struct trapframe *frame) +ecall_handler(struct trapframe *frame) { struct thread *td; @@ -172,7 +172,7 @@ svc_handler(struct trapframe *frame) } static void -data_abort(struct trapframe *frame, int usermode) +page_fault_handler(struct trapframe *frame, int usermode) { struct vm_map *map; uint64_t stval; @@ -290,7 +290,7 @@ do_trap_supervisor(struct trapframe *frame) break; case EXCP_STORE_PAGE_FAULT: case EXCP_LOAD_PAGE_FAULT: - data_abort(frame, 0); + page_fault_handler(frame, 0); break; case EXCP_BREAKPOINT: #ifdef KDTRACE_HOOKS @@ -353,11 +353,11 @@ do_trap_user(struct trapframe *frame) case EXCP_STORE_PAGE_FAULT: case EXCP_LOAD_PAGE_FAULT: case EXCP_INST_PAGE_FAULT: - data_abort(frame, 1); + page_fault_handler(frame, 1); break; case EXCP_USER_ECALL: frame->tf_sepc += 4; /* Next instruction */ - svc_handler(frame); + ecall_handler(frame); break; case EXCP_ILLEGAL_INSTRUCTION: #ifdef FPE