Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/sh3/include Since __INTR_MASK + __EXCEPTION_UNBLOCK...



details:   https://anonhg.NetBSD.org/src/rev/3463928ef091
branches:  trunk
changeset: 761647:3463928ef091
user:      uwe <uwe%NetBSD.org@localhost>
date:      Fri Feb 04 04:13:52 2011 +0000

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

diffstat:

 sys/arch/sh3/include/locore.h |  19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)

diffs (33 lines):

diff -r 917e0db9bf32 -r 3463928ef091 sys/arch/sh3/include/locore.h
--- a/sys/arch/sh3/include/locore.h     Fri Feb 04 03:23:33 2011 +0000
+++ b/sys/arch/sh3/include/locore.h     Fri Feb 04 04:13:52 2011 +0000
@@ -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 *);



Home | Main Index | Thread Index | Old Index