Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sh3/sh3 _cpu_exception_suspend, _cpu_exception_resu...



details:   https://anonhg.NetBSD.org/src/rev/4abe47943dfe
branches:  trunk
changeset: 1012594:4abe47943dfe
user:      uwe <uwe%NetBSD.org@localhost>
date:      Mon Aug 03 03:34:11 2020 +0000

description:
_cpu_exception_suspend, _cpu_exception_resume - cosmetics

Use PSL_BL instead of magic hex in comments.  Use spaces between
operands.  Same object code is generated.

diffstat:

 sys/arch/sh3/sh3/locore_subr.S |  36 ++++++++++++++++++------------------
 1 files changed, 18 insertions(+), 18 deletions(-)

diffs (65 lines):

diff -r 10d8ea134f21 -r 4abe47943dfe sys/arch/sh3/sh3/locore_subr.S
--- a/sys/arch/sh3/sh3/locore_subr.S    Mon Aug 03 01:56:18 2020 +0000
+++ b/sys/arch/sh3/sh3/locore_subr.S    Mon Aug 03 03:34:11 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locore_subr.S,v 1.58 2020/01/08 20:59:19 skrll Exp $   */
+/*     $NetBSD: locore_subr.S,v 1.59 2020/08/03 03:34:11 uwe Exp $     */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
 #include <sh3/mmu_sh3.h>
 #include <sh3/mmu_sh4.h>
 
-__KERNEL_RCSID(0, "$NetBSD: locore_subr.S,v 1.58 2020/01/08 20:59:19 skrll Exp $")
+__KERNEL_RCSID(0, "$NetBSD: locore_subr.S,v 1.59 2020/08/03 03:34:11 uwe Exp $")
 
 
 /*
@@ -298,15 +298,15 @@
  *     if exception occur, jump to 0xa0000000 (hard reset).
  */
 NENTRY(_cpu_exception_suspend)
-       stc     sr,     r0      /* r0 = SR */
-       mov     #0x10,  r1
-       swap.b  r1,     r1
-       mov     r0,     r2      /* r2 = r0 */
-       swap.w  r1,     r1      /* r1 = 0x10000000 */
-       or      r1,     r2      /* r2 |= 0x10000000 */
-       ldc     r2,     sr      /* SR = r2 */
+       stc     sr, r0          /* r0 = SR */
+       mov     #0x10, r1       /* bswap32(PSL_BL) - fits immediate */
+       swap.b  r1, r1
+       mov     r0, r2          /* r2 = r0 */
+       swap.w  r1, r1          /* r1 = PSL_BL */
+       or      r1, r2          /* r2 |= PSL_BL */
+       ldc     r2, sr          /* SR = r2 */
        rts
-        and    r1,     r0      /* r0 &= 0x10000000 */
+        and    r1, r0          /* r0 &= 0x10000000 */
        SET_ENTRY_SIZE(_cpu_exception_suspend)
 
 
@@ -315,14 +315,14 @@
  *     restore 's' exception mask. (SR.BL)
  */
 NENTRY(_cpu_exception_resume)
-       stc     sr,     r0      /* r0 = SR */
-       mov     #0x10,  r1
-       swap.b  r1,     r1
-       swap.w  r1,     r1
-       not     r1,     r1      /* r1 = ~0x10000000 */
-       and     r1,     r0      /* r0 &= ~0x10000000 */
-       or      r4,     r0      /* r0 |= old SR.BL */
-       ldc     r0,     sr      /* SR = r0 (don't move to delay slot) */
+       stc     sr, r0          /* r0 = SR */
+       mov     #0x10, r1       /* bswap32(PSL_BL) - fits immediate */
+       swap.b  r1, r1
+       swap.w  r1, r1
+       not     r1, r1          /* r1 = ~PSL_BL */
+       and     r1, r0          /* r0 &= ~PSL_BL */
+       or      r4, r0          /* r0 |= old SR.BL */
+       ldc     r0, sr          /* SR = r0 (don't move to delay slot) */
        rts
         nop
        SET_ENTRY_SIZE(_cpu_exception_resume)



Home | Main Index | Thread Index | Old Index