3 * Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 #include <arch/pc/x86common.h>
22 #include <arch/pc/pcbios.h>
26 EXTERN SwitchToReal:PROC
27 EXTERN ContinueAddress:DWORD
35 * int Int386(int ivec, REGS* in, REGS* out);
40 /* Get the function parameters */
41 mov eax, dword ptr [esp + 4]
42 mov dword ptr ds:[BSS_IntVector], eax
43 mov eax, dword ptr [esp + 8]
44 mov dword ptr [Int386_regsin], eax
45 mov eax, dword ptr [esp + 12]
46 mov dword ptr [Int386_regsout], eax
48 /* Save all registers + segment registers */
55 /* Copy input registers */
56 mov esi, dword ptr [Int386_regsin]
57 mov edi, BSS_RegisterSet
58 mov ecx, REGS_SIZE / 4
61 /* Set the function ID */
64 /* Set continue address and switch to real mode */
65 mov dword ptr [ContinueAddress], offset Int386_return
70 /* Copy output registers */
71 mov esi, BSS_RegisterSet
72 mov edi, dword ptr [Int386_regsout]
73 mov ecx, REGS_SIZE / 4