Module Name:    src
Committed By:   skrll
Date:           Thu Jan 18 14:18:23 UTC 2018

Modified Files:
        src/sys/arch/arm/arm: syscall.c

Log Message:
Fix test for SMI_IMB{,range} that was broken in 1.46

>From Ramakrishna Rao Desetti


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/arch/arm/arm/syscall.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/arm/arm/syscall.c
diff -u src/sys/arch/arm/arm/syscall.c:1.62 src/sys/arch/arm/arm/syscall.c:1.63
--- src/sys/arch/arm/arm/syscall.c:1.62	Sun Jul  2 16:16:44 2017
+++ src/sys/arch/arm/arm/syscall.c	Thu Jan 18 14:18:23 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: syscall.c,v 1.62 2017/07/02 16:16:44 skrll Exp $	*/
+/*	$NetBSD: syscall.c,v 1.63 2018/01/18 14:18:23 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2003 The NetBSD Foundation, Inc.
@@ -71,7 +71,7 @@
 
 #include <sys/param.h>
 
-__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.62 2017/07/02 16:16:44 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.63 2018/01/18 14:18:23 skrll Exp $");
 
 #include <sys/cpu.h>
 #include <sys/device.h>
@@ -214,8 +214,9 @@ syscall(struct trapframe *tf, lwp_t *l, 
 	/* test new official and old unofficial NetBSD ranges */
 	if (__predict_false(os_mask != SWI_OS_NETBSD)
 	    && __predict_false(os_mask != 0)) {
-		if (os_mask == SWI_OS_ARM
-		    && (code == SWI_IMB || code == SWI_IMBrange)) {
+
+		const uint32_t swi = __SHIFTOUT(insn, __BITS(23,0));
+		if (swi == SWI_IMB || swi == SWI_IMBrange) {
 			userret(l);
 			return;
 		}

Reply via email to