xtensa: clean up PS_WOE_BIT usage
authorMax Filippov <jcmvbkbc@gmail.com>
Fri, 30 Aug 2019 18:16:06 +0000 (11:16 -0700)
committerMax Filippov <jcmvbkbc@gmail.com>
Sun, 1 Sep 2019 20:11:57 +0000 (13:11 -0700)
PS_WOE_BIT is mainly used to generate PS.WOE mask in the code. Introduce
PS_WOE_MASK macro and use it instead.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
arch/xtensa/include/asm/processor.h
arch/xtensa/include/asm/regs.h
arch/xtensa/kernel/entry.S
arch/xtensa/kernel/head.S

index 19f6b54e358b1d53594896bb6c2f29113ec0b849..0b4efec9e19e271c094d305450ff9b281b0f0ba9 100644 (file)
@@ -179,7 +179,7 @@ struct thread_struct {
  * Note: We set-up ps as if we did a call4 to the new pc.
  *       set_thread_state in signal.c depends on it.
  */
-#define USER_PS_VALUE ((1 << PS_WOE_BIT) |                             \
+#define USER_PS_VALUE (PS_WOE_MASK |                                   \
                       (1 << PS_CALLINC_SHIFT) |                        \
                       (USER_RING << PS_RING_SHIFT) |                   \
                       (1 << PS_UM_BIT) |                               \
index 477594e5817f2f2bd04dfadd5c2454803eeb05df..ce184e7dee91e70b76dde38b9121db0be99a55bc 100644 (file)
@@ -81,6 +81,7 @@
 /*  PS register fields.  */
 
 #define PS_WOE_BIT             18
+#define PS_WOE_MASK            0x00040000
 #define PS_CALLINC_SHIFT       16
 #define PS_CALLINC_MASK                0x00030000
 #define PS_OWB_SHIFT           8
index 183fa8e0bb5b80366a5344e22cefcf69aac0e8be..9afe8f612f2392c8e00e01f9c5b04ff589769e7a 100644 (file)
@@ -414,7 +414,7 @@ common_exception:
        movi    a3, LOCKLEVEL
 
 .Lexception:
-       movi    a0, 1 << PS_WOE_BIT
+       movi    a0, PS_WOE_MASK
        or      a3, a3, a0
 #else
        addi    a2, a2, -EXCCAUSE_LEVEL1_INTERRUPT
@@ -422,7 +422,7 @@ common_exception:
        extui   a3, a3, PS_INTLEVEL_SHIFT, PS_INTLEVEL_WIDTH
                                        # a3 = PS.INTLEVEL
        moveqz  a3, a0, a2              # a3 = LOCKLEVEL iff interrupt
-       movi    a2, 1 << PS_WOE_BIT
+       movi    a2, PS_WOE_MASK
        or      a3, a3, a2
        rsr     a2, exccause
 #endif
@@ -922,7 +922,7 @@ ENTRY(unrecoverable_exception)
        wsr     a1, windowbase
        rsync
 
-       movi    a1, (1 << PS_WOE_BIT) | LOCKLEVEL
+       movi    a1, PS_WOE_MASK | LOCKLEVEL
        wsr     a1, ps
        rsync
 
@@ -1359,7 +1359,7 @@ ENTRY(fast_syscall_spill_registers)
        rsr     a3, excsave1
        l32i    a1, a3, EXC_TABLE_KSTK
 
-       movi    a4, (1 << PS_WOE_BIT) | LOCKLEVEL
+       movi    a4, PS_WOE_MASK | LOCKLEVEL
        wsr     a4, ps
        rsync
 
index 7f009719304efeaf29bd998043e37a729ef77636..4ae998b5a3480631bf8f0fd1dc24156c9e3d3d06 100644 (file)
@@ -193,7 +193,7 @@ ENTRY(_startup)
        movi    a1, start_info
        l32i    a1, a1, 0
 
-       movi    a2, (1 << PS_WOE_BIT) | LOCKLEVEL
+       movi    a2, PS_WOE_MASK | LOCKLEVEL
                                        # WOE=1, INTLEVEL=LOCKLEVEL, UM=0
        wsr     a2, ps                  # (enable reg-windows; progmode stack)
        rsync