Module Name: src Committed By: maxv Date: Sun Aug 13 07:16:44 UTC 2017
Modified Files: src/sys/arch/amd64/amd64: process_machdep.c Log Message: Remove unused include, remove dead code, KNF, and fix off-by-one. To generate a diff of this commit: cvs rdiff -u -r1.33 -r1.34 src/sys/arch/amd64/amd64/process_machdep.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/amd64/amd64/process_machdep.c diff -u src/sys/arch/amd64/amd64/process_machdep.c:1.33 src/sys/arch/amd64/amd64/process_machdep.c:1.34 --- src/sys/arch/amd64/amd64/process_machdep.c:1.33 Tue Aug 8 17:27:34 2017 +++ src/sys/arch/amd64/amd64/process_machdep.c Sun Aug 13 07:16:44 2017 @@ -1,6 +1,6 @@ -/* $NetBSD: process_machdep.c,v 1.33 2017/08/08 17:27:34 maxv Exp $ */ +/* $NetBSD: process_machdep.c,v 1.34 2017/08/13 07:16:44 maxv Exp $ */ -/*- +/* * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc. * All rights reserved. * @@ -71,19 +71,16 @@ * * process_set_pc(proc) * Set the process's program counter. - * */ - #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.33 2017/08/08 17:27:34 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.34 2017/08/13 07:16:44 maxv Exp $"); #include <sys/param.h> #include <sys/systm.h> #include <sys/time.h> #include <sys/kernel.h> #include <sys/proc.h> -#include <sys/vnode.h> #include <sys/ptrace.h> #include <machine/psl.h> @@ -93,16 +90,12 @@ __KERNEL_RCSID(0, "$NetBSD: process_mach #include <x86/fpu.h> static inline struct trapframe *process_frame(struct lwp *); -#if 0 -static inline int verr_gdt(struct pmap *, int sel); -static inline int verr_ldt(struct pmap *, int sel); -#endif static inline struct trapframe * process_frame(struct lwp *l) { - return (l->l_md.md_regs); + return l->l_md.md_regs; } int @@ -114,7 +107,7 @@ process_read_regs(struct lwp *l, struct _FRAME_GREG(copy_to_reg) #undef copy_to_reg - return (0); + return 0; } int @@ -162,7 +155,7 @@ process_write_regs(struct lwp *l, const tf->tf_err = err; tf->tf_trapno = trapno; - return (0); + return 0; } int @@ -200,7 +193,7 @@ process_sstep(struct lwp *l, int sstep) else tf->tf_rflags &= ~PSL_T; - return (0); + return 0; } int @@ -208,9 +201,9 @@ process_set_pc(struct lwp *l, void *addr { struct trapframe *tf = process_frame(l); - if ((uint64_t)addr > VM_MAXUSER_ADDRESS) + if ((uint64_t)addr >= VM_MAXUSER_ADDRESS) return EINVAL; tf->tf_rip = (uint64_t)addr; - return (0); + return 0; }