Module Name: src Committed By: skrll Date: Sat Mar 14 16:12:16 UTC 2020
Modified Files: src/sys/arch/riscv/conf: Makefile.riscv majors.riscv src/sys/arch/riscv/include: asm.h elf_machdep.h fenv.h frame.h ieeefp.h locore.h mcontext.h pte.h sysreg.h types.h src/sys/arch/riscv/riscv: db_machdep.c kobj_machdep.c locore.S netbsd32_machdep.c pmap_machdep.c process_machdep.c procfs_machdep.c riscv_machdep.c sig_machdep.c spl.S syscall.c trap.c vm_machdep.c Log Message: Trailing whitespace To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/arch/riscv/conf/Makefile.riscv cvs rdiff -u -r1.7 -r1.8 src/sys/arch/riscv/conf/majors.riscv cvs rdiff -u -r1.3 -r1.4 src/sys/arch/riscv/include/asm.h \ src/sys/arch/riscv/include/pte.h cvs rdiff -u -r1.7 -r1.8 src/sys/arch/riscv/include/elf_machdep.h \ src/sys/arch/riscv/include/types.h cvs rdiff -u -r1.2 -r1.3 src/sys/arch/riscv/include/fenv.h cvs rdiff -u -r1.1 -r1.2 src/sys/arch/riscv/include/frame.h \ src/sys/arch/riscv/include/ieeefp.h cvs rdiff -u -r1.4 -r1.5 src/sys/arch/riscv/include/locore.h \ src/sys/arch/riscv/include/sysreg.h cvs rdiff -u -r1.5 -r1.6 src/sys/arch/riscv/include/mcontext.h cvs rdiff -u -r1.3 -r1.4 src/sys/arch/riscv/riscv/db_machdep.c \ src/sys/arch/riscv/riscv/netbsd32_machdep.c cvs rdiff -u -r1.2 -r1.3 src/sys/arch/riscv/riscv/kobj_machdep.c \ src/sys/arch/riscv/riscv/process_machdep.c \ src/sys/arch/riscv/riscv/sig_machdep.c src/sys/arch/riscv/riscv/spl.S \ src/sys/arch/riscv/riscv/vm_machdep.c cvs rdiff -u -r1.11 -r1.12 src/sys/arch/riscv/riscv/locore.S cvs rdiff -u -r1.5 -r1.6 src/sys/arch/riscv/riscv/pmap_machdep.c cvs rdiff -u -r1.1 -r1.2 src/sys/arch/riscv/riscv/procfs_machdep.c \ src/sys/arch/riscv/riscv/syscall.c cvs rdiff -u -r1.9 -r1.10 src/sys/arch/riscv/riscv/riscv_machdep.c cvs rdiff -u -r1.4 -r1.5 src/sys/arch/riscv/riscv/trap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/riscv/conf/Makefile.riscv diff -u src/sys/arch/riscv/conf/Makefile.riscv:1.5 src/sys/arch/riscv/conf/Makefile.riscv:1.6 --- src/sys/arch/riscv/conf/Makefile.riscv:1.5 Sun Jun 16 07:42:52 2019 +++ src/sys/arch/riscv/conf/Makefile.riscv Sat Mar 14 16:12:15 2020 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.riscv,v 1.5 2019/06/16 07:42:52 maxv Exp $ +# $NetBSD: Makefile.riscv,v 1.6 2020/03/14 16:12:15 skrll Exp $ # Makefile for NetBSD # @@ -99,7 +99,7 @@ RAMDISKDIR!= cd ${NETBSDSRCDIR}/distr .if defined(NEED_MDSETIMAGE) && ${NEED_MDSETIMAGE} != "no" \ && defined(RAMDISKDIR) && exists(${RAMDISKDIR}/ramdisk.fs) -SYSTEM_DEP+= ${RAMDISKDIR}/ramdisk.fs +SYSTEM_DEP+= ${RAMDISKDIR}/ramdisk.fs SYSTEM_LD_TAIL_EXTRA+=; \ echo ${TOOL_MDSETIMAGE} -s $@ ${RAMDISKDIR}/ramdisk.fs; \ ${TOOL_MDSETIMAGE} -s $@ ${RAMDISKDIR}/ramdisk.fs Index: src/sys/arch/riscv/conf/majors.riscv diff -u src/sys/arch/riscv/conf/majors.riscv:1.7 src/sys/arch/riscv/conf/majors.riscv:1.8 --- src/sys/arch/riscv/conf/majors.riscv:1.7 Mon Jan 28 02:29:00 2019 +++ src/sys/arch/riscv/conf/majors.riscv Sat Mar 14 16:12:15 2020 @@ -1,4 +1,4 @@ -# $NetBSD: majors.riscv,v 1.7 2019/01/28 02:29:00 dholland Exp $ +# $NetBSD: majors.riscv,v 1.8 2020/03/14 16:12:15 skrll Exp $ # # Device majors for riscv # @@ -32,7 +32,7 @@ device-major kttcp char 71 kttcp #device-major aucom char 73 aucom # Majors up to 143 are reserved for machine-dependent drivers. -# New machine-independent driver majors are assigned in +# New machine-independent driver majors are assigned in # sys/conf/majors. include "conf/majors.ws" Index: src/sys/arch/riscv/include/asm.h diff -u src/sys/arch/riscv/include/asm.h:1.3 src/sys/arch/riscv/include/asm.h:1.4 --- src/sys/arch/riscv/include/asm.h:1.3 Sat Apr 13 12:41:36 2019 +++ src/sys/arch/riscv/include/asm.h Sat Mar 14 16:12:16 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: asm.h,v 1.3 2019/04/13 12:41:36 maya Exp $ */ +/* $NetBSD: asm.h,v 1.4 2020/03/14 16:12:16 skrll Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -49,7 +49,7 @@ REG_L ra, CALLFRAME_RA(sp); \ REG_L a0, CALLFRAME_S0(sp); \ addi sp, sp, CALLFRAME_SIZ; \ - .set pop; + .set pop; #ifdef GPROF #define _PROF_PROLOGUE _KERN_MCOUNT Index: src/sys/arch/riscv/include/pte.h diff -u src/sys/arch/riscv/include/pte.h:1.3 src/sys/arch/riscv/include/pte.h:1.4 --- src/sys/arch/riscv/include/pte.h:1.3 Sun Jun 16 07:42:52 2019 +++ src/sys/arch/riscv/include/pte.h Sat Mar 14 16:12:16 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: pte.h,v 1.3 2019/06/16 07:42:52 maxv Exp $ */ +/* $NetBSD: pte.h,v 1.4 2020/03/14 16:12:16 skrll Exp $ */ /* * Copyright (c) 2014, 2019 The NetBSD Foundation, Inc. @@ -125,8 +125,8 @@ pte_wire_entry(pt_entry_t pte) { return pte | PTE_WIRED; } - -static inline pt_entry_t + +static inline pt_entry_t pte_unwire_entry(pt_entry_t pte) { return pte & ~PTE_WIRED; Index: src/sys/arch/riscv/include/elf_machdep.h diff -u src/sys/arch/riscv/include/elf_machdep.h:1.7 src/sys/arch/riscv/include/elf_machdep.h:1.8 --- src/sys/arch/riscv/include/elf_machdep.h:1.7 Sat Jun 1 12:42:28 2019 +++ src/sys/arch/riscv/include/elf_machdep.h Sat Mar 14 16:12:16 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: elf_machdep.h,v 1.7 2019/06/01 12:42:28 maxv Exp $ */ +/* $NetBSD: elf_machdep.h,v 1.8 2020/03/14 16:12:16 skrll Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -117,13 +117,13 @@ #ifdef _KERNEL #ifdef ELFSIZE #define ELF_MD_PROBE_FUNC ELFNAME2(cpu_netbsd,probe) -#endif - +#endif + struct exec_package; - + int cpu_netbsd_elf32_probe(struct lwp *, struct exec_package *, void *, char *, - vaddr_t *); - + vaddr_t *); + int cpu_netbsd_elf64_probe(struct lwp *, struct exec_package *, void *, char *, vaddr_t *); Index: src/sys/arch/riscv/include/types.h diff -u src/sys/arch/riscv/include/types.h:1.7 src/sys/arch/riscv/include/types.h:1.8 --- src/sys/arch/riscv/include/types.h:1.7 Thu Jul 12 10:46:46 2018 +++ src/sys/arch/riscv/include/types.h Sat Mar 14 16:12:16 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: types.h,v 1.7 2018/07/12 10:46:46 maxv Exp $ */ +/* $NetBSD: types.h,v 1.8 2020/03/14 16:12:16 skrll Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -70,9 +70,9 @@ typedef struct label_t { /* Used by setj __uint32_t lb_sr; } label_t; #endif - + typedef unsigned int __cpu_simple_lock_nv_t; -#ifdef _LP64 +#ifdef _LP64 typedef __int64_t __register_t; #else typedef __int32_t __register_t; Index: src/sys/arch/riscv/include/fenv.h diff -u src/sys/arch/riscv/include/fenv.h:1.2 src/sys/arch/riscv/include/fenv.h:1.3 --- src/sys/arch/riscv/include/fenv.h:1.2 Wed Mar 22 23:11:09 2017 +++ src/sys/arch/riscv/include/fenv.h Sat Mar 14 16:12:16 2020 @@ -1,6 +1,6 @@ -/* $NetBSD: fenv.h,v 1.2 2017/03/22 23:11:09 chs Exp $ */ +/* $NetBSD: fenv.h,v 1.3 2020/03/14 16:12:16 skrll Exp $ */ -/* +/* * Based on ieeefp.h written by J.T. Conklin, Apr 28, 1995 * Public domain. */ Index: src/sys/arch/riscv/include/frame.h diff -u src/sys/arch/riscv/include/frame.h:1.1 src/sys/arch/riscv/include/frame.h:1.2 --- src/sys/arch/riscv/include/frame.h:1.1 Fri Sep 19 17:36:26 2014 +++ src/sys/arch/riscv/include/frame.h Sat Mar 14 16:12:16 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: frame.h,v 1.1 2014/09/19 17:36:26 matt Exp $ */ +/* $NetBSD: frame.h,v 1.2 2020/03/14 16:12:16 skrll Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -36,7 +36,7 @@ struct trapframe { struct reg tf_regs __aligned(8); - register_t tf_badvaddr; + register_t tf_badvaddr; register_t tf_pc; uint32_t tf_cause; // 32-bit register uint32_t tf_sr; // 32-bit register Index: src/sys/arch/riscv/include/ieeefp.h diff -u src/sys/arch/riscv/include/ieeefp.h:1.1 src/sys/arch/riscv/include/ieeefp.h:1.2 --- src/sys/arch/riscv/include/ieeefp.h:1.1 Fri Sep 19 17:36:26 2014 +++ src/sys/arch/riscv/include/ieeefp.h Sat Mar 14 16:12:16 2020 @@ -1,6 +1,6 @@ -/* $NetBSD: ieeefp.h,v 1.1 2014/09/19 17:36:26 matt Exp $ */ +/* $NetBSD: ieeefp.h,v 1.2 2020/03/14 16:12:16 skrll Exp $ */ -/* +/* * Based on ieeefp.h written by J.T. Conklin, Apr 28, 1995 * Public domain. */ Index: src/sys/arch/riscv/include/locore.h diff -u src/sys/arch/riscv/include/locore.h:1.4 src/sys/arch/riscv/include/locore.h:1.5 --- src/sys/arch/riscv/include/locore.h:1.4 Thu Apr 11 11:23:51 2019 +++ src/sys/arch/riscv/include/locore.h Sat Mar 14 16:12:16 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: locore.h,v 1.4 2019/04/11 11:23:51 kamil Exp $ */ +/* $NetBSD: locore.h,v 1.5 2020/03/14 16:12:16 skrll Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. * All rights reserved. @@ -39,7 +39,7 @@ struct trapframe { struct reg tf_regs; - register_t tf_badaddr; + register_t tf_badaddr; uint32_t tf_cause; // 32-bit register uint32_t tf_sr; // 32-bit register #define tf_reg tf_regs.r_reg @@ -80,7 +80,7 @@ struct trapframe { // For COMPAT_NETBSD32 coredumps struct trapframe32 { struct reg32 tf_regs; - register32_t tf_badaddr; + register32_t tf_badaddr; uint32_t tf_cause; // 32-bit register uint32_t tf_sr; // 32-bit register }; Index: src/sys/arch/riscv/include/sysreg.h diff -u src/sys/arch/riscv/include/sysreg.h:1.4 src/sys/arch/riscv/include/sysreg.h:1.5 --- src/sys/arch/riscv/include/sysreg.h:1.4 Sun Jun 16 07:42:52 2019 +++ src/sys/arch/riscv/include/sysreg.h Sat Mar 14 16:12:16 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: sysreg.h,v 1.4 2019/06/16 07:42:52 maxv Exp $ */ +/* $NetBSD: sysreg.h,v 1.5 2020/03/14 16:12:16 skrll Exp $ */ /* * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -179,7 +179,7 @@ riscvreg_cycle_read(void) uint32_t __hi0, __hi1, __lo0; do { __asm __volatile( - "csrr\t%[__hi0], cycleh" + "csrr\t%[__hi0], cycleh" "\n\t" "csrr\t%[__lo0], cycle" "\n\t" "csrr\t%[__hi1], cycleh" : [__hi0] "=r"(__hi0), Index: src/sys/arch/riscv/include/mcontext.h diff -u src/sys/arch/riscv/include/mcontext.h:1.5 src/sys/arch/riscv/include/mcontext.h:1.6 --- src/sys/arch/riscv/include/mcontext.h:1.5 Thu Feb 15 15:53:56 2018 +++ src/sys/arch/riscv/include/mcontext.h Sat Mar 14 16:12:16 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: mcontext.h,v 1.5 2018/02/15 15:53:56 kamil Exp $ */ +/* $NetBSD: mcontext.h,v 1.6 2020/03/14 16:12:16 skrll Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ #define _NFREG 33 /* F0-31, FCSR */ /* - * This fragment is common to <riscv/mcontext.h> and <riscv/reg.h> + * This fragment is common to <riscv/mcontext.h> and <riscv/reg.h> */ #ifndef _BSD_FPREG_T_ union __fpreg { Index: src/sys/arch/riscv/riscv/db_machdep.c diff -u src/sys/arch/riscv/riscv/db_machdep.c:1.3 src/sys/arch/riscv/riscv/db_machdep.c:1.4 --- src/sys/arch/riscv/riscv/db_machdep.c:1.3 Sun Jun 16 07:42:52 2019 +++ src/sys/arch/riscv/riscv/db_machdep.c Sat Mar 14 16:12:16 2020 @@ -29,7 +29,7 @@ #include <sys/cdefs.h> -__RCSID("$NetBSD: db_machdep.c,v 1.3 2019/06/16 07:42:52 maxv Exp $"); +__RCSID("$NetBSD: db_machdep.c,v 1.4 2020/03/14 16:12:16 skrll Exp $"); #include <sys/param.h> @@ -89,7 +89,7 @@ db_rw_ddbreg(const struct db_variable *v { struct trapframe * const tf = curcpu()->ci_ddb_regs; KASSERT(db_regs <= vp && vp < db_regs + __arraycount(db_regs)); - const uintptr_t addr = (uintptr_t)tf + (uintptr_t)vp->valuep; + const uintptr_t addr = (uintptr_t)tf + (uintptr_t)vp->valuep; if (vp->modif != NULL && vp->modif[0] == 'i') { if (rw == DB_VAR_GET) { *valp = *(const uint32_t *)addr; Index: src/sys/arch/riscv/riscv/netbsd32_machdep.c diff -u src/sys/arch/riscv/riscv/netbsd32_machdep.c:1.3 src/sys/arch/riscv/riscv/netbsd32_machdep.c:1.4 --- src/sys/arch/riscv/riscv/netbsd32_machdep.c:1.3 Thu Mar 16 16:13:21 2017 +++ src/sys/arch/riscv/riscv/netbsd32_machdep.c Sat Mar 14 16:12:16 2020 @@ -29,7 +29,7 @@ #include <sys/cdefs.h> -__RCSID("$NetBSD: netbsd32_machdep.c,v 1.3 2017/03/16 16:13:21 chs Exp $"); +__RCSID("$NetBSD: netbsd32_machdep.c,v 1.4 2020/03/14 16:12:16 skrll Exp $"); #include <sys/param.h> #include <sys/ucontext.h> @@ -51,7 +51,7 @@ netbsd32_setregs(struct lwp *l, struct e setregs(l, pack, stack); } -/* +/* * Start a new LWP */ void @@ -179,7 +179,7 @@ netbsd32_sysarch(struct lwp *l, const st vaddr_t netbsd32_vm_default_addr(struct proc *p, vaddr_t base, vsize_t size, int topdown) -{ +{ if (topdown) return VM_DEFAULT_ADDRESS32_TOPDOWN(base, size); else Index: src/sys/arch/riscv/riscv/kobj_machdep.c diff -u src/sys/arch/riscv/riscv/kobj_machdep.c:1.2 src/sys/arch/riscv/riscv/kobj_machdep.c:1.3 --- src/sys/arch/riscv/riscv/kobj_machdep.c:1.2 Fri Nov 3 09:59:08 2017 +++ src/sys/arch/riscv/riscv/kobj_machdep.c Sat Mar 14 16:12:16 2020 @@ -29,7 +29,7 @@ #include <sys/cdefs.h> -__RCSID("$NetBSD: kobj_machdep.c,v 1.2 2017/11/03 09:59:08 maxv Exp $"); +__RCSID("$NetBSD: kobj_machdep.c,v 1.3 2020/03/14 16:12:16 skrll Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -133,7 +133,7 @@ kobj_reloc(kobj_t ko, uintptr_t relocbas *wwhere = ((addend & 0xfff) << 20) | (*wwhere & 0xfffff); break; case R_RISCV_PCREL_LO12_S: - addend += + addend += __SHIFTIN(__SHIFTOUT(addend, __BITS(31,25)), __BITS(11,5)) | __SHIFTIN(__SHIFTOUT(addend, __BITS(11,7)), __BITS(4,0)); /* FALLTHROUGH */ Index: src/sys/arch/riscv/riscv/process_machdep.c diff -u src/sys/arch/riscv/riscv/process_machdep.c:1.2 src/sys/arch/riscv/riscv/process_machdep.c:1.3 --- src/sys/arch/riscv/riscv/process_machdep.c:1.2 Thu Mar 16 16:13:21 2017 +++ src/sys/arch/riscv/riscv/process_machdep.c Sat Mar 14 16:12:16 2020 @@ -29,7 +29,7 @@ #include <sys/cdefs.h> -__RCSID("$NetBSD: process_machdep.c,v 1.2 2017/03/16 16:13:21 chs Exp $"); +__RCSID("$NetBSD: process_machdep.c,v 1.3 2020/03/14 16:12:16 skrll Exp $"); #include <sys/param.h> #include <sys/ptrace.h> @@ -92,7 +92,7 @@ int process_set_pc(struct lwp *l, void *addr) { //struct trapframe * const tf = l->l_md.md_utf; - + l->l_md.md_utf->tf_pc = (register_t)addr; return 0; Index: src/sys/arch/riscv/riscv/sig_machdep.c diff -u src/sys/arch/riscv/riscv/sig_machdep.c:1.2 src/sys/arch/riscv/riscv/sig_machdep.c:1.3 --- src/sys/arch/riscv/riscv/sig_machdep.c:1.2 Tue Nov 27 14:09:54 2018 +++ src/sys/arch/riscv/riscv/sig_machdep.c Sat Mar 14 16:12:16 2020 @@ -30,7 +30,7 @@ #include <sys/cdefs.h> #ifndef COMPATNAME1 -__RCSID("$NetBSD: sig_machdep.c,v 1.2 2018/11/27 14:09:54 maxv Exp $"); +__RCSID("$NetBSD: sig_machdep.c,v 1.3 2020/03/14 16:12:16 skrll Exp $"); #endif #include <sys/param.h> @@ -50,12 +50,12 @@ __RCSID("$NetBSD: sig_machdep.c,v 1.2 20 #define UCLINK_SET(uc,c) ((uc)->uc_link = (c)) #define COPY_SIGINFO(d,s) ((d)->sf_si._info = (s)->ksi_info) -void * +void * cpu_sendsig_getframe(struct lwp *l, int signo, bool *onstack) { struct trapframe * const tf = l->l_md.md_utf; struct proc * const p = l->l_proc; - + /* Do we need to jump onto the signal stack? */ *onstack = (l->l_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0 && (SIGACTION(p, signo).sa_flags & SA_ONSTACK) != 0; Index: src/sys/arch/riscv/riscv/spl.S diff -u src/sys/arch/riscv/riscv/spl.S:1.2 src/sys/arch/riscv/riscv/spl.S:1.3 --- src/sys/arch/riscv/riscv/spl.S:1.2 Tue Mar 31 01:15:26 2015 +++ src/sys/arch/riscv/riscv/spl.S Sat Mar 14 16:12:16 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: spl.S,v 1.2 2015/03/31 01:15:26 matt Exp $ */ +/* $NetBSD: spl.S,v 1.3 2020/03/14 16:12:16 skrll Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. * All rights reserved. @@ -31,7 +31,7 @@ #include <machine/asm.h> #include "assym.h" -__RCSID("$NetBSD: spl.S,v 1.2 2015/03/31 01:15:26 matt Exp $") +__RCSID("$NetBSD: spl.S,v 1.3 2020/03/14 16:12:16 skrll Exp $") .data .globl _C_LABEL(ipl_sr_map) @@ -94,7 +94,7 @@ ENTRY_NP(splhigh) PTR_L a3, L_CPU(tp) // get curcpu() INT_L a0, CI_CPL(a3) // get current IPL li t1, SR_IM // load SR_IM - li t0, IPL_HIGH // + li t0, IPL_HIGH // csrc sstatus, t1 // mask all interrupts INT_S t0, CI_CPL(a3) // set it to IPL_HIGH ret Index: src/sys/arch/riscv/riscv/vm_machdep.c diff -u src/sys/arch/riscv/riscv/vm_machdep.c:1.2 src/sys/arch/riscv/riscv/vm_machdep.c:1.3 --- src/sys/arch/riscv/riscv/vm_machdep.c:1.2 Wed Nov 13 16:11:27 2019 +++ src/sys/arch/riscv/riscv/vm_machdep.c Sat Mar 14 16:12:16 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: vm_machdep.c,v 1.2 2019/11/13 16:11:27 pgoyette Exp $ */ +/* $NetBSD: vm_machdep.c,v 1.3 2020/03/14 16:12:16 skrll Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.2 2019/11/13 16:11:27 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.3 2020/03/14 16:12:16 skrll Exp $"); #define _PMAP_PRIVATE @@ -262,7 +262,7 @@ vunmapbuf(struct buf *bp, vsize_t len) } int -mm_md_physacc(paddr_t pa, vm_prot_t prot) +mm_md_physacc(paddr_t pa, vm_prot_t prot) { return (atop(pa) < physmem) ? 0 : EFAULT; } Index: src/sys/arch/riscv/riscv/locore.S diff -u src/sys/arch/riscv/riscv/locore.S:1.11 src/sys/arch/riscv/riscv/locore.S:1.12 --- src/sys/arch/riscv/riscv/locore.S:1.11 Wed Jan 8 20:59:19 2020 +++ src/sys/arch/riscv/riscv/locore.S Sat Mar 14 16:12:16 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: locore.S,v 1.11 2020/01/08 20:59:19 skrll Exp $ */ +/* $NetBSD: locore.S,v 1.12 2020/03/14 16:12:16 skrll Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. * All rights reserved. @@ -37,7 +37,7 @@ ENTRY_NP(start) // We get loaded and starting running at or near 0, not where we // should be. We need to construct an initial PDETAB - + #ifdef _LP64 li t0, SR_U64|SR_S64 li t1, SR_IM|SR_VM|SR_EI @@ -182,7 +182,7 @@ ENTRY_NP(cpu_switchto) REG_S s11, TF_S11(sp) // save callee saved address csrr t4, sstatus // get status for intr state REG_S t4, TF_SR(sp) // save it - + REG_S sp, L_MD_KTF(a0) // record trapframe pointer csrrci t0, sstatus, SR_EI // # disable interrupts @@ -364,7 +364,7 @@ ENTRY_NP(cpu_exception_handler) REG_S t5, TF_T5(sp) // save t5 REG_S t6, TF_T6(sp) // save t6 - // Now we get the + // Now we get the move a0, sp // trapframe pointer csrr a1, sepc // get execption pc csrr a2, sstatus // get status Index: src/sys/arch/riscv/riscv/pmap_machdep.c diff -u src/sys/arch/riscv/riscv/pmap_machdep.c:1.5 src/sys/arch/riscv/riscv/pmap_machdep.c:1.6 --- src/sys/arch/riscv/riscv/pmap_machdep.c:1.5 Wed Mar 11 13:30:31 2020 +++ src/sys/arch/riscv/riscv/pmap_machdep.c Sat Mar 14 16:12:16 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap_machdep.c,v 1.5 2020/03/11 13:30:31 thorpej Exp $ */ +/* $NetBSD: pmap_machdep.c,v 1.6 2020/03/14 16:12:16 skrll Exp $ */ /* * Copyright (c) 2014, 2019 The NetBSD Foundation, Inc. @@ -33,7 +33,7 @@ #include <sys/cdefs.h> -__RCSID("$NetBSD: pmap_machdep.c,v 1.5 2020/03/11 13:30:31 thorpej Exp $"); +__RCSID("$NetBSD: pmap_machdep.c,v 1.6 2020/03/14 16:12:16 skrll Exp $"); #include <sys/param.h> @@ -141,7 +141,7 @@ pmap_md_tlb_check_entry(void *ctx, vaddr { return false; } - + void pmap_md_pdetab_activate(struct pmap *pmap) { Index: src/sys/arch/riscv/riscv/procfs_machdep.c diff -u src/sys/arch/riscv/riscv/procfs_machdep.c:1.1 src/sys/arch/riscv/riscv/procfs_machdep.c:1.2 --- src/sys/arch/riscv/riscv/procfs_machdep.c:1.1 Sat Mar 28 16:13:56 2015 +++ src/sys/arch/riscv/riscv/procfs_machdep.c Sat Mar 14 16:12:16 2020 @@ -29,23 +29,23 @@ #include <sys/cdefs.h> -__RCSID("$NetBSD: procfs_machdep.c,v 1.1 2015/03/28 16:13:56 matt Exp $"); +__RCSID("$NetBSD: procfs_machdep.c,v 1.2 2020/03/14 16:12:16 skrll Exp $"); #include <sys/param.h> #include <sys/mount.h> #include <sys/vnode.h> #include <miscfs/procfs/procfs.h> - -/* + +/* * Linux-style /proc/cpuinfo. * Only used when procfs is mounted with -o linux. - */ -int + */ +int procfs_getcpuinfstr(char *buf, size_t *len) { *len = 0; - + return 0; -} +} Index: src/sys/arch/riscv/riscv/syscall.c diff -u src/sys/arch/riscv/riscv/syscall.c:1.1 src/sys/arch/riscv/riscv/syscall.c:1.2 --- src/sys/arch/riscv/riscv/syscall.c:1.1 Sat Mar 28 16:13:56 2015 +++ src/sys/arch/riscv/riscv/syscall.c Sat Mar 14 16:12:16 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: syscall.c,v 1.1 2015/03/28 16:13:56 matt Exp $ */ +/* $NetBSD: syscall.c,v 1.2 2020/03/14 16:12:16 skrll Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.1 2015/03/28 16:13:56 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.2 2020/03/14 16:12:16 skrll Exp $"); #include <sys/param.h> #include <sys/cpu.h> @@ -67,7 +67,7 @@ EMULNAME(syscall_intern)(struct proc *p) * System calls are strange beasts. They are passed the syscall number * in t6, and the arguments in the registers (as normal). * The return value (if any) in a0 and possibly a1. The instruction - * directly after the syscall is excepted to contain a jump instruction + * directly after the syscall is excepted to contain a jump instruction * for an error handler. If the syscall completes with no error, the PC * will be advanced past that instruction. */ @@ -142,7 +142,7 @@ EMULNAME(syscall)(struct trapframe *tf) * values and synthesize the 64bit argument. */ for (i = 0; i < nargs + narg64; ) { - register_t arg = *args32++; + register_t arg = *args32++; if (__predict_true((arg64mask & 1) == 0)) { /* * Just copy it with sign extension on @@ -211,7 +211,7 @@ EMULNAME(syscall)(struct trapframe *tf) */ register_t tmp = retval[0]; tf->tf_reg[_X_A0 + _QUAD_LOWWORD] = (int32_t) tmp; - tf->tf_reg[_X_A0 + _QUAD_HIGHWORD] = tmp >> 32; + tf->tf_reg[_X_A0 + _QUAD_HIGHWORD] = tmp >> 32; } #endif #ifdef RISCV_SYSCALL_DEBUG Index: src/sys/arch/riscv/riscv/riscv_machdep.c diff -u src/sys/arch/riscv/riscv/riscv_machdep.c:1.9 src/sys/arch/riscv/riscv/riscv_machdep.c:1.10 --- src/sys/arch/riscv/riscv/riscv_machdep.c:1.9 Wed Mar 11 13:30:31 2020 +++ src/sys/arch/riscv/riscv/riscv_machdep.c Sat Mar 14 16:12:16 2020 @@ -31,7 +31,7 @@ #include "opt_modular.h" -__RCSID("$NetBSD: riscv_machdep.c,v 1.9 2020/03/11 13:30:31 thorpej Exp $"); +__RCSID("$NetBSD: riscv_machdep.c,v 1.10 2020/03/14 16:12:16 skrll Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -80,7 +80,7 @@ delay(unsigned long us) #ifdef MODULAR /* - * Push any modules loaded by the boot loader. + * Push any modules loaded by the boot loader. */ void module_init_md(void) @@ -131,7 +131,7 @@ cpu_spawn_return(struct lwp *l) userret(l); } -/* +/* * Start a new LWP */ void Index: src/sys/arch/riscv/riscv/trap.c diff -u src/sys/arch/riscv/riscv/trap.c:1.4 src/sys/arch/riscv/riscv/trap.c:1.5 --- src/sys/arch/riscv/riscv/trap.c:1.4 Thu Nov 21 19:24:01 2019 +++ src/sys/arch/riscv/riscv/trap.c Sat Mar 14 16:12:16 2020 @@ -32,7 +32,7 @@ #define __PMAP_PRIVATE #define __UFETCHSTORE_PRIVATE -__RCSID("$NetBSD: trap.c,v 1.4 2019/11/21 19:24:01 ad Exp $"); +__RCSID("$NetBSD: trap.c,v 1.5 2020/03/14 16:12:16 skrll Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -398,7 +398,7 @@ cpu_trap(struct trapframe *tf, register_ #ifndef _LP64 // This fault may be cause the kernel's page table got a new // page table page and this pmap's page table doesn't know - // about it. See + // about it. See struct pmap * const pmap = curlwp->l_proc->p_vmspace->vm_map.pmap; if ((intptr_t) addr < 0 && pmap != pmap_kernel() @@ -463,7 +463,7 @@ fetch_user_data(const void *uaddr, void if ((error = cpu_set_onfault(&fb, 1)) != 0) return error; - + switch (size) { case 1: *(uint8_t *)valp = *(volatile const uint8_t *)uaddr; @@ -521,7 +521,7 @@ store_user_data(void *uaddr, const void if ((error = cpu_set_onfault(&fb, 1)) != 0) return error; - + switch (size) { case 1: *(volatile uint8_t *)uaddr = *(const uint8_t *)valp;