Module Name: src Committed By: uebayasi Date: Mon Aug 24 12:38:13 UTC 2009
Modified Files: src/sys/arch/mips/mips [matt-nb5-mips64]: syscall.c trap.c Log Message: Don't use an obscure macro (DELAYBRANCH(x)) to check if the BD field (bit 31) is set in Cause Register. To generate a diff of this commit: cvs rdiff -u -r1.37.12.5 -r1.37.12.6 src/sys/arch/mips/mips/syscall.c cvs rdiff -u -r1.217.12.4 -r1.217.12.5 src/sys/arch/mips/mips/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/mips/mips/syscall.c diff -u src/sys/arch/mips/mips/syscall.c:1.37.12.5 src/sys/arch/mips/mips/syscall.c:1.37.12.6 --- src/sys/arch/mips/mips/syscall.c:1.37.12.5 Sun Aug 23 03:52:52 2009 +++ src/sys/arch/mips/mips/syscall.c Mon Aug 24 12:38:13 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: syscall.c,v 1.37.12.5 2009/08/23 03:52:52 matt Exp $ */ +/* $NetBSD: syscall.c,v 1.37.12.6 2009/08/24 12:38:13 uebayasi Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -107,7 +107,7 @@ #include <sys/cdefs.h> /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.37.12.5 2009/08/23 03:52:52 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.37.12.6 2009/08/24 12:38:13 uebayasi Exp $"); #if defined(_KERNEL_OPT) #include "opt_sa.h" @@ -145,8 +145,6 @@ register_t MachEmulateBranch(struct frame *, register_t, u_int, int); -#define DELAYBRANCH(x) ((int)(x)<0) - void EMULNAME(syscall_intern)(struct proc *p) { @@ -189,7 +187,7 @@ uvmexp.syscalls++; - if (DELAYBRANCH(cause)) + if (cause & MIPS_CR_BR_DELAY) frame->f_regs[_R_PC] = MachEmulateBranch(frame, opc, 0, 0); else frame->f_regs[_R_PC] = opc + sizeof(uint32_t); Index: src/sys/arch/mips/mips/trap.c diff -u src/sys/arch/mips/mips/trap.c:1.217.12.4 src/sys/arch/mips/mips/trap.c:1.217.12.5 --- src/sys/arch/mips/mips/trap.c:1.217.12.4 Sun Aug 23 04:38:34 2009 +++ src/sys/arch/mips/mips/trap.c Mon Aug 24 12:38:13 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: trap.c,v 1.217.12.4 2009/08/23 04:38:34 uebayasi Exp $ */ +/* $NetBSD: trap.c,v 1.217.12.5 2009/08/24 12:38:13 uebayasi Exp $ */ /* * Copyright (c) 1992, 1993 @@ -78,7 +78,7 @@ #include <sys/cdefs.h> /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.217.12.4 2009/08/23 04:38:34 uebayasi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.217.12.5 2009/08/24 12:38:13 uebayasi Exp $"); #include "opt_cputype.h" /* which mips CPU levels do we support? */ #include "opt_ddb.h" @@ -164,8 +164,6 @@ void MachEmulateInst(uint32_t, uint32_t, vaddr_t, struct frame *); /* XXX */ void MachFPTrap(uint32_t, uint32_t, vaddr_t, struct frame *); /* XXX */ -#define DELAYBRANCH(x) ((int)(x)<0) - /* * fork syscall returns directly to user process via lwp_trampoline(), * which will be called the very first time when child gets running. @@ -489,7 +487,7 @@ int rv; /* compute address of break instruction */ - va = (DELAYBRANCH(cause)) ? opc + sizeof(int) : opc; + va = (cause & MIPS_CR_BR_DELAY) ? opc + sizeof(int) : opc; /* read break instruction */ instr = fuiword((void *)va);