From owner-svn-src-head@freebsd.org Thu Feb 4 14:30:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5913FA9BB98; Thu, 4 Feb 2016 14:30:48 +0000 (UTC) (envelope-from br@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 mx1.freebsd.org (Postfix) with ESMTPS id 0CCCC6BA; Thu, 4 Feb 2016 14:30:47 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u14EUk6u001358; Thu, 4 Feb 2016 14:30:46 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u14EUkq4001355; Thu, 4 Feb 2016 14:30:46 GMT (envelope-from br@FreeBSD.org) Message-Id: <201602041430.u14EUkq4001355@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Thu, 4 Feb 2016 14:30:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295258 - in head/sys/riscv: include riscv X-SVN-Group: head 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.20 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: Thu, 04 Feb 2016 14:30:48 -0000 Author: br Date: Thu Feb 4 14:30:46 2016 New Revision: 295258 URL: https://svnweb.freebsd.org/changeset/base/295258 Log: Access pcpup using gp register. Modified: head/sys/riscv/include/asm.h head/sys/riscv/riscv/exception.S head/sys/riscv/riscv/swtch.S Modified: head/sys/riscv/include/asm.h ============================================================================== --- head/sys/riscv/include/asm.h Thu Feb 4 14:15:24 2016 (r295257) +++ head/sys/riscv/include/asm.h Thu Feb 4 14:30:46 2016 (r295258) @@ -59,9 +59,7 @@ .set alias,sym #define SET_FAULT_HANDLER(handler, tmp) \ - la tmp, pcpup; \ - ld tmp, 0(tmp); \ - ld tmp, PC_CURTHREAD(tmp); \ + ld tmp, PC_CURTHREAD(gp); \ ld tmp, TD_PCB(tmp); /* Load the pcb */ \ sd handler, PCB_ONFAULT(tmp) /* Set the handler */ Modified: head/sys/riscv/riscv/exception.S ============================================================================== --- head/sys/riscv/riscv/exception.S Thu Feb 4 14:15:24 2016 (r295257) +++ head/sys/riscv/riscv/exception.S Thu Feb 4 14:30:46 2016 (r295258) @@ -182,9 +182,7 @@ __FBSDID("$FreeBSD$"); 1: csrci sstatus, SSTATUS_IE - la a1, pcpup - ld a1, 0(a1) - ld a1, PC_CURTHREAD(a1) + ld a1, PC_CURTHREAD(gp) lw a2, TD_FLAGS(a1) li a3, (TDF_ASTPENDING|TDF_NEEDRESCHED) Modified: head/sys/riscv/riscv/swtch.S ============================================================================== --- head/sys/riscv/riscv/swtch.S Thu Feb 4 14:15:24 2016 (r295257) +++ head/sys/riscv/riscv/swtch.S Thu Feb 4 14:30:46 2016 (r295258) @@ -46,14 +46,11 @@ __FBSDID("$FreeBSD$"); * void cpu_throw(struct thread *old, struct thread *new) */ ENTRY(cpu_throw) - /* Load pcpu */ - la x14, pcpup - ld x14, 0(x14) /* Store the new curthread */ - sd a1, PC_CURTHREAD(x14) + sd a1, PC_CURTHREAD(gp) /* And the new pcb */ ld x13, TD_PCB(a1) - sd x13, PC_CURPCB(x14) + sd x13, PC_CURPCB(gp) sfence.vm @@ -103,14 +100,11 @@ END(cpu_throw) * x3 to x7, x16 and x17 are caller saved */ ENTRY(cpu_switch) - /* Load pcpu */ - la x14, pcpup - ld x14, 0(x14) /* Store the new curthread */ - sd a1, PC_CURTHREAD(x14) + sd a1, PC_CURTHREAD(gp) /* And the new pcb */ ld x13, TD_PCB(a1) - sd x13, PC_CURPCB(x14) + sd x13, PC_CURPCB(gp) /* Save the old context. */ ld x13, TD_PCB(a0)