1 /* -----------------------------------------------------------------------
3 * Copyright 2003-2009 H. Peter Anvin - All Rights Reserved
4 * Copyright 2009 Intel Corporation; author: H. Peter Anvin
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
9 * Boston MA 02110-1301, USA; either version 2 of the License, or
10 * (at your option) any later version; incorporated herein by reference.
12 * ----------------------------------------------------------------------- */
15 * Simple stub to get us to the right point in the 32-bit code;
16 * this module must be linked first
19 .section ".init", "ax"
24 movl $__bss_start, %edi
31 /* Set up the protected-mode IDT and the interrupt jump buffers */
34 movl $0xee000000, %ebx /* Interrupt gate */
35 movw %cs, %bx /* Target segment */
47 * Each entry in the interrupt jump buffer contains the following
51 * b0xx movb $xx, %al # interrupt number
52 * e9xxxxxxxx jmp handle_interrupt
54 movl $0xe900b060, %eax
59 movl $handle_interrupt-8, %edx
67 /* Save arguments, switch stacks */
68 movl %esp, %eax /* Pointer to arguments */
69 movl $__stack_end, %esp
72 jmp *(rm_args) /* First argument is return */
76 .type intcall, @function
78 jmp *(rm_args+1*4) /* Intcall is argument 1 */
79 .size intcall, .-intcall
81 .type handle_interrupt, @function
83 jmp *(rm_args+4*4) /* Interrupt pointer is argument 4 */
84 .size handle_interrupt, .-handle_interrupt
86 .section ".rodata","a"
92 .section ".bss.large","aw"