Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/m68k/m68k Replace magic numbers with proper macros ...



details:   https://anonhg.NetBSD.org/src/rev/b39916f4ec4a
branches:  trunk
changeset: 1018884:b39916f4ec4a
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Sat Feb 20 18:04:20 2021 +0000

description:
Replace magic numbers with proper macros prepared in assym.h.

No binary changes.
Note this is a preparation for a possible fix of PR port-m68k/55990.

diffstat:

 sys/arch/m68k/m68k/reenter_syscall.s |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (38 lines):

diff -r 3894770a7876 -r b39916f4ec4a sys/arch/m68k/m68k/reenter_syscall.s
--- a/sys/arch/m68k/m68k/reenter_syscall.s      Sat Feb 20 18:02:58 2021 +0000
+++ b/sys/arch/m68k/m68k/reenter_syscall.s      Sat Feb 20 18:04:20 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: reenter_syscall.s,v 1.4 2013/09/07 19:06:29 chs Exp $  */
+/*     $NetBSD: reenter_syscall.s,v 1.5 2021/02/20 18:04:20 tsutsui Exp $      */
 
 /*
  * Written by ITOH Yasufumi.
@@ -6,6 +6,7 @@
  */
 
 #include <m68k/asm.h>
+#include "assym.h"
 
 /*
  * void reenter_syscall(struct frame *fp, int stkadj)
@@ -38,17 +39,17 @@
 .Lcpfr:        movel   (%a0)+,(%a1)+
        dbra    %d0,.Lcpfr
 
-       movew   %d1,%sp@(16*4+2)        | set stack adjust count
+       movew   %d1,%sp@(FR_ADJ)        | set stack adjust count
        movel   (%sp),-(%sp)            | push syscall no (original d0 value)
        jbsr    _C_LABEL(syscall)       | re-enter syscall()
        addql   #4,%sp                  | pop syscall no
 #ifdef DEBUG
-       tstw    %sp@(16*4+2)            | stack adjust must be zero
+       tstw    %sp@(FR_ADJ)            | stack adjust must be zero
        jeq     .Ladjzero
        PANIC("reenter_syscall")
 .Ladjzero:
 #endif
-       moveal  %sp@(15*4),%a0          | grab and restore
+       moveal  %sp@(FR_SP),%a0         | grab and restore
        movel   %a0,%usp                |   user SP
        moveml  (%sp)+,#0x7FFF          | restore user registers
        addql   #8,%sp                  | pop SP and stack adjust



Home | Main Index | Thread Index | Old Index