Module Name: src Committed By: maxv Date: Wed Jun 14 17:02:16 UTC 2017
Modified Files: src/sys/arch/i386/i386: i386_trap.S Log Message: style To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/arch/i386/i386/i386_trap.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/i386/i386/i386_trap.S diff -u src/sys/arch/i386/i386/i386_trap.S:1.6 src/sys/arch/i386/i386/i386_trap.S:1.7 --- src/sys/arch/i386/i386/i386_trap.S:1.6 Mon Feb 27 06:46:59 2017 +++ src/sys/arch/i386/i386/i386_trap.S Wed Jun 14 17:02:16 2017 @@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: i386_trap.S, * (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 @@ __KERNEL_RCSID(0, "$NetBSD: i386_trap.S, #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 @@ IDTVEC(trap06) /* 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 @@ IDTVEC(trap06) 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 @@ IDTVEC(trap07) 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 @@ IDTVEC(trap0e) 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 @@ IDTVEC(trap0f) * 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 @@ IDTVEC(trap10) * 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_END(trap11) 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 @@ IDTVEC(exceptions) .long _C_LABEL(Xtrap1e), _C_LABEL(Xtrap1f) IDTVEC_END(exceptions) - + IDTVEC(tss_trap08) 1: str %ax @@ -331,7 +346,7 @@ IDTVEC_END(tss_trap08) * 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 @@ NENTRY(alltraps) 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 @@ _C_LABEL(trapreturn): .globl trapreturn 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 @@ _C_LABEL(trapreturn): .globl trapreturn 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