Module Name:    src
Committed By:   uwe
Date:           Fri Feb  4 04:13:52 UTC 2011

Modified Files:
        src/sys/arch/sh3/include: locore.h

Log Message:
Since __INTR_MASK + __EXCEPTION_UNBLOCK is common sequence, provide
__INTR_MASK_EXCEPTION_UNBLOCK combo version that does stc/ldc just once.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/sh3/include/locore.h

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/sh3/include/locore.h
diff -u src/sys/arch/sh3/include/locore.h:1.21 src/sys/arch/sh3/include/locore.h:1.22
--- src/sys/arch/sh3/include/locore.h:1.21	Fri Feb  4 03:23:33 2011
+++ src/sys/arch/sh3/include/locore.h	Fri Feb  4 04:13:52 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.h,v 1.21 2011/02/04 03:23:33 uwe Exp $	*/
+/*	$NetBSD: locore.h,v 1.22 2011/02/04 04:13:52 uwe Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -201,6 +201,23 @@
 	and	Rn,	Rm						;\
 	ldc	Rm,	sr	/* unmask all interrupts */
 
+
+/*
+ * Since __INTR_MASK + __EXCEPTION_UNBLOCK is common sequence, provide
+ * this combo version that does stc/ldc just once.
+ */
+#define __INTR_MASK_EXCEPTION_UNBLOCK(Rs, Ri, Rb)			 \
+	mov	#0x78, Ri	/* 0xf0 >> 1 */				;\
+	mov	#0xef, Rb	/* ~0x10 */				;\
+	shll	Ri		/* Ri = PSL_IMASK */			;\
+	swap.b	Rb, Rb							;\
+	stc	sr, Rs							;\
+	swap.w	Rb, Rb		/* Rb = ~PSL_BL */			;\
+	or	Ri, Rs		/* SR |= PSL_IMASK */			;\
+	and	Rb, Rs		/* SR &= ~PSL_BL */			;\
+	ldc	Rs, sr
+
+
 #else /* !_LOCORE */
 
 void sh3_switch_setup(struct lwp *);

Reply via email to