Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/i386 style



details:   https://anonhg.NetBSD.org/src/rev/92497bdd21cf
branches:  trunk
changeset: 824687:92497bdd21cf
user:      maxv <maxv%NetBSD.org@localhost>
date:      Wed Jun 14 17:02:16 2017 +0000

description:
style

diffstat:

 sys/arch/i386/i386/i386_trap.S   |  101 ++++++++++++++++++++++----------------
 sys/arch/i386/include/frameasm.h |   26 +++++-----
 2 files changed, 71 insertions(+), 56 deletions(-)

diffs (truncated from 340 to 300 lines):

diff -r 658b2b7d12c0 -r 92497bdd21cf sys/arch/i386/i386/i386_trap.S
--- a/sys/arch/i386/i386/i386_trap.S    Wed Jun 14 16:39:41 2017 +0000
+++ b/sys/arch/i386/i386/i386_trap.S    Wed Jun 14 17:02:16 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i386_trap.S,v 1.6 2017/02/27 06:46:59 chs Exp $        */
+/*     $NetBSD: i386_trap.S,v 1.7 2017/06/14 17:02:16 maxv Exp $       */
 
 /*
  * Copyright 2002 (c) Wasabi Systems, Inc.
@@ -35,7 +35,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-/*-
+/*
  * Copyright (c) 1998, 2007, 2009 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
@@ -66,7 +66,7 @@
 
 #if 0
 #include <machine/asm.h>
-__KERNEL_RCSID(0, "$NetBSD: i386_trap.S,v 1.6 2017/02/27 06:46:59 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i386_trap.S,v 1.7 2017/06/14 17:02:16 maxv Exp $");
 #endif
 
 /*
@@ -78,10 +78,10 @@
  * (possibly the next clock tick).  Thus, we disable interrupt before checking,
  * and only enable them again on the final `iret' or before calling the AST
  * handler.
- */ 
+ */
 
-#define TRAP(a)                        pushl $(a) ; jmp _C_LABEL(alltraps)
-#define ZTRAP(a)               pushl $0 ; TRAP(a)
+#define TRAP(a)                pushl $(a) ; jmp _C_LABEL(alltraps)
+#define ZTRAP(a)       pushl $0 ; TRAP(a)
 
 #ifdef IPKDB
 #define BPTTRAP(a)     pushl $0; pushl $(a); jmp _C_LABEL(bpttraps)
@@ -89,29 +89,34 @@
 #define BPTTRAP(a)     ZTRAP(a)
 #endif
 
-
        .text
 IDTVEC(trap00)
        ZTRAP(T_DIVIDE)
 IDTVEC_END(trap00)
+
 IDTVEC(trap01)
        BPTTRAP(T_TRCTRAP)
 IDTVEC_END(trap01)
+
 IDTVEC(trap02)
-       pushl $0
-       pushl $(T_NMI)
+       pushl   $0
+       pushl   $(T_NMI)
        INTRENTRY
-       jmp _C_LABEL(calltrap)
+       jmp     _C_LABEL(calltrap)
 IDTVEC_END(trap02)
+
 IDTVEC(trap03)
        BPTTRAP(T_BPTFLT)
 IDTVEC_END(trap03)
+
 IDTVEC(trap04)
        ZTRAP(T_OFLOW)
 IDTVEC_END(trap04)
+
 IDTVEC(trap05)
        ZTRAP(T_BOUND)
 IDTVEC_END(trap05)
+
 /*
  * Privileged instruction fault.
  */
@@ -124,21 +129,21 @@
 
        /* Check if this is a user fault. */
        /* XXX this was 0x0020 in FreeBSD */
-       cmpl    $GSEL(GCODE_SEL, SEL_KPL), 4(%esp)   /* Check code segment. */
+       cmpl    $GSEL(GCODE_SEL, SEL_KPL),4(%esp) /* Check code segment. */
 
        /* If so, just handle it as a normal trap. */
        jne     norm_ill
-              
+
        /*
         * This is a kernel instruction fault that might have been caused
         * by a DTrace provider.
         */
-       
+
        /*
         * Set our jump address for the jump back in the event that
         * the exception wasn't caused by DTrace at all.
         */
-       movl    $norm_ill, dtrace_invop_calltrap_addr
+       movl    $norm_ill,dtrace_invop_calltrap_addr
 
        /* Jump to the code hooked in by DTrace. */
        jmpl    *dtrace_invop_jump_addr
@@ -154,8 +159,9 @@
        ZTRAP(T_PRIVINFLT)
 IDTVEC_END(trap06)
 #endif
+
 IDTVEC(trap07)
-       pushl   $0                      # dummy error code
+       pushl   $0                      /* dummy error code */
        pushl   $T_DNA
        INTRENTRY
 #ifdef DIAGNOSTIC
@@ -166,24 +172,31 @@
        addl    $4,%esp
        jmp     _C_LABEL(trapreturn)
 IDTVEC_END(trap07)
+
 IDTVEC(trap08)
        TRAP(T_DOUBLEFLT)
 IDTVEC_END(trap08)
+
 IDTVEC(trap09)
        ZTRAP(T_FPOPFLT)
 IDTVEC_END(trap09)
+
 IDTVEC(trap0a)
        TRAP(T_TSSFLT)
 IDTVEC_END(trap0a)
+
 IDTVEC(trap0b)
        TRAP(T_SEGNPFLT)
 IDTVEC_END(trap0b)
+
 IDTVEC(trap0c)
        TRAP(T_STKFLT)
 IDTVEC_END(trap0c)
+
 IDTVEC(trap0d)
        TRAP(T_PROTFLT)
 IDTVEC_END(trap0d)
+
 IDTVEC(trap0e)
 #ifndef XEN
        pushl   $T_PAGEFLT
@@ -197,9 +210,9 @@
        jne     calltrap
        movb    $T_PRIVINFLT,TF_TRAPNO(%esp)
        jmp     calltrap
-#else /* !XEN */
+#else
        TRAP(T_PAGEFLT)
-#endif /* !XEN */
+#endif
 IDTVEC_END(trap0e)
 
 IDTVEC(intrspurious)
@@ -208,11 +221,11 @@
         * The Pentium Pro local APIC may erroneously call this vector for a
         * default IR7.  Just ignore it.
         *
-        * (The local APIC does this when CPL is raised while it's on the 
-        * way to delivering an interrupt.. presumably enough has been set 
+        * (The local APIC does this when CPL is raised while it's on the
+        * way to delivering an interrupt.. presumably enough has been set
         * up that it's inconvenient to abort delivery completely..)
         */
-       pushl   $0                      # dummy error code
+       pushl   $0                      /* dummy error code */
        pushl   $T_ASTFLT
        INTRENTRY
        STI(%eax)
@@ -229,18 +242,19 @@
         * error.  It would be better to handle npx interrupts as traps but
         * this is difficult for nested interrupts.
         */
-       pushl   $0                      # dummy error code
+       pushl   $0                      /* dummy error code */
        pushl   $T_ARITHTRAP
 .Ldo_fputrap:
        INTRENTRY
        movl    CPUVAR(ILEVEL),%ebx
        pushl   %esp
-       addl    $1,CPUVAR(NTRAP)        # statistical info
+       addl    $1,CPUVAR(NTRAP)        /* statistical info */
        adcl    $0,CPUVAR(NTRAP)+4
        call    _C_LABEL(fputrap)
        addl    $4,%esp
        jmp     _C_LABEL(trapreturn)
 IDTVEC_END(trap10)
+
 IDTVEC(trap11)
        TRAP(T_ALIGNFLT)
 IDTVEC_END(trap11)
@@ -248,8 +262,9 @@
 IDTVEC(trap12)
        ZTRAP(T_MCA)
 IDTVEC_END(trap12)
+
 IDTVEC(trap13)
-       pushl   $0                      # dummy error code
+       pushl   $0                      /* dummy error code */
        pushl   $T_XMM
        jmp     .Ldo_fputrap
 IDTVEC_END(trap13)
@@ -308,7 +323,7 @@
        .long   _C_LABEL(Xtrap1e), _C_LABEL(Xtrap1f)
 IDTVEC_END(exceptions)
 
- 
+
 IDTVEC(tss_trap08)
 1:
        str     %ax
@@ -331,7 +346,7 @@
  * Typically the code will have raised a SIGSEGV which will be actioned
  * by the code below.
  */
-       .type   _C_LABEL(trap_return_fault_return), @function
+       .type   _C_LABEL(trap_return_fault_return),@function
 LABEL(trap_return_fault_return)
        mov     4(%esp),%esp    /* frame for user return */
        jmp     _C_LABEL(trapreturn)
@@ -344,8 +359,8 @@
 calltrap:
 #ifdef DIAGNOSTIC
        movl    CPUVAR(ILEVEL),%ebx
-#endif /* DIAGNOSTIC */
-       addl    $1,CPUVAR(NTRAP)        # statistical info
+#endif
+       addl    $1,CPUVAR(NTRAP)        /* statistical info */
        adcl    $0,CPUVAR(NTRAP)+4
        pushl   %esp
        call    _C_LABEL(trap)
@@ -367,7 +382,7 @@
 5:     CLEAR_ASTPENDING(%eax)
        STI(%eax)
        movl    $T_ASTFLT,TF_TRAPNO(%esp)
-       addl    $1,CPUVAR(NTRAP)        # statistical info
+       addl    $1,CPUVAR(NTRAP)        /* statistical info */
        adcl    $0,CPUVAR(NTRAP)+4
        pushl   %esp
        call    _C_LABEL(trap)
@@ -377,25 +392,25 @@
        jnz     9f
 #ifdef XEN
        STIC(%eax)
-       jz      6f
-       call    _C_LABEL(stipending)
-       testl   %eax,%eax
-       jz      6f
+       jz      6f
+       call    _C_LABEL(stipending)
+       testl   %eax,%eax
+       jz      6f
        /* process pending interrupts */
        CLI(%eax)
-       movl    CPUVAR(ILEVEL), %ebx
-       movl    $.Lalltraps_resume, %esi # address to resume loop at
+       movl    CPUVAR(ILEVEL),%ebx
+       movl    $.Lalltraps_resume,%esi /* address to resume loop at */
 .Lalltraps_resume:
-       movl    %ebx,%eax               # get cpl
-       movl    CPUVAR(IUNMASK)(,%eax,4),%eax
-       andl    CPUVAR(IPENDING),%eax   # any non-masked bits left?
+       movl    %ebx,%eax               /* get cpl */
+       movl    CPUVAR(IUNMASK)(,%eax,4),%eax
+       andl    CPUVAR(IPENDING),%eax   /* any non-masked bits left? */
        jz      7f
-       bsrl    %eax,%eax
-       btrl    %eax,CPUVAR(IPENDING)
-       movl    CPUVAR(ISOURCES)(,%eax,4),%eax
-       jmp     *IS_RESUME(%eax)
-7:      movl    %ebx, CPUVAR(ILEVEL) #restore cpl
-       jmp     _C_LABEL(trapreturn)
+       bsrl    %eax,%eax
+       btrl    %eax,CPUVAR(IPENDING)
+       movl    CPUVAR(ISOURCES)(,%eax,4),%eax
+       jmp     *IS_RESUME(%eax)
+7:     movl    %ebx,CPUVAR(ILEVEL)     /* restore cpl */
+       jmp     _C_LABEL(trapreturn)
 #endif /* XEN */
 #ifndef DIAGNOSTIC
 6:     INTRFASTEXIT
diff -r 658b2b7d12c0 -r 92497bdd21cf sys/arch/i386/include/frameasm.h
--- a/sys/arch/i386/include/frameasm.h  Wed Jun 14 16:39:41 2017 +0000
+++ b/sys/arch/i386/include/frameasm.h  Wed Jun 14 17:02:16 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: frameasm.h,v 1.15 2011/07/26 12:57:35 yamt Exp $       */
+/*     $NetBSD: frameasm.h,v 1.16 2017/06/14 17:09:00 maxv Exp $       */
 
 #ifndef _I386_FRAMEASM_H_
 #define _I386_FRAMEASM_H_
@@ -9,22 +9,22 @@
 #endif
 



Home | Main Index | Thread Index | Old Index