From owner-svn-src-head@freebsd.org Wed Feb 17 13:49:40 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 1E54BAAAD6D; Wed, 17 Feb 2016 13:49:40 +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 DFCD71C93; Wed, 17 Feb 2016 13:49:39 +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 u1HDncXp036776; Wed, 17 Feb 2016 13:49:38 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1HDncPV036775; Wed, 17 Feb 2016 13:49:38 GMT (envelope-from br@FreeBSD.org) Message-Id: <201602171349.u1HDncPV036775@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 17 Feb 2016 13:49:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295698 - head/sys/riscv/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: Wed, 17 Feb 2016 13:49:40 -0000 Author: br Date: Wed Feb 17 13:49:38 2016 New Revision: 295698 URL: https://svnweb.freebsd.org/changeset/base/295698 Log: Add the implementation of savectx(). Modified: head/sys/riscv/riscv/swtch.S Modified: head/sys/riscv/riscv/swtch.S ============================================================================== --- head/sys/riscv/riscv/swtch.S Wed Feb 17 13:43:43 2016 (r295697) +++ head/sys/riscv/riscv/swtch.S Wed Feb 17 13:49:38 2016 (r295698) @@ -256,8 +256,27 @@ ENTRY(fork_trampoline) END(fork_trampoline) ENTRY(savectx) - la a0, .Lsavectx_panic_str - call panic -.Lsavectx_panic_str: - .asciz "savectx_panic: %p\0" + /* Store ra, sp and the callee-saved registers */ + sd ra, (PCB_RA)(a0) + sd sp, (PCB_SP)(a0) + + /* s[0-11] */ + sd s0, (PCB_S + 0 * 8)(a0) + sd s1, (PCB_S + 1 * 8)(a0) + sd s2, (PCB_S + 2 * 8)(a0) + sd s3, (PCB_S + 3 * 8)(a0) + sd s4, (PCB_S + 4 * 8)(a0) + sd s5, (PCB_S + 5 * 8)(a0) + sd s6, (PCB_S + 6 * 8)(a0) + sd s7, (PCB_S + 7 * 8)(a0) + sd s8, (PCB_S + 8 * 8)(a0) + sd s9, (PCB_S + 9 * 8)(a0) + sd s10, (PCB_S + 10 * 8)(a0) + sd s11, (PCB_S + 11 * 8)(a0) + + /* Store the VFP registers */ +#ifdef VFP + /* TODO */ +#endif + ret END(savectx)