2 * Copyright (c) 1989, 1990 William F. Jolitz.
3 * Copyright (c) 1990 The Regents of the University of California.
6 * This code is derived from software contributed to Berkeley by
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by the University of
20 * California, Berkeley and its contributors.
21 * 4. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
45 * Vector interrupt control section
51 * void doreti(struct trapframe)
53 * Handle return from interrupts, traps and syscalls.
56 .type doreti,@function
59 FAKE_MCOUNT(bintr) /* init "from" bintr -> doreti */
61 /* Check for ASTs that can be handled now. */
62 testb $SEL_RPL_MASK,TF_CS(%esp) /* are we in user mode? */
63 jne doreti_ast /* yes, do it now. */
64 testl $PSL_VM,TF_EFLAGS(%esp) /* kernel mode */
65 je doreti_exit /* and not VM86 mode, defer */
66 cmpl $1,in_vm86call /* are we in a VM86 call? */
67 je doreti_exit /* no, defer */
70 pushl %esp /* pass a pointer to the trapframe */
75 * doreti_exit: pop registers, iret.
77 * The segment register pop is a special case, since it may
78 * fault if (for example) a sigreturn specifies bad segment
79 * registers. The fault is handled in trap.c.
100 * doreti_iret_fault and friends. Alternative return code for
101 * the case where we get a fault in the doreti_exit code
102 * above. trap() (i386/i386/trap.c) catches this specific
103 * case, sends the process a signal and continues in the
104 * corresponding place in the code below.
107 .globl doreti_iret_fault
112 .globl doreti_popl_ds_fault
113 doreti_popl_ds_fault:
115 .globl doreti_popl_es_fault
116 doreti_popl_es_fault:
118 .globl doreti_popl_fs_fault
119 doreti_popl_fs_fault:
120 movl $0,TF_ERR(%esp) /* XXX should be the error code */
121 movl $T_PROTFLT,TF_TRAPNO(%esp)
122 jmp alltraps_with_regs_pushed
125 #include "i386/isa/apic_ipl.s"
127 #include "i386/isa/icu_ipl.s"