blob: 0bc24122e1093774f1e1162f6709accc2cf1380d [file] [log] [blame]
Stefan Reinauer216fa462011-10-12 14:25:07 -07001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2007 Advanced Micro Devices, Inc.
5 * Copyright (C) 2009-2010 coresystems GmbH
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
19 */
20
21#define REALMODE_BASE ((void *)0x600)
22
23struct realmode_idt {
24 u16 offset, cs;
25};
26
27void x86_exception(struct eregs *info);
28
29/* From x86_asm.S */
30extern unsigned char __idt_handler, __idt_handler_size;
31extern unsigned char __realmode_code, __realmode_code_size;
32extern unsigned char __realmode_call, __realmode_interrupt;
33
34extern void (*realmode_call)(u32 addr, u32 eax, u32 ebx, u32 ecx, u32 edx,
35 u32 esi, u32 edi) __attribute__((regparm(0)));
36
37extern void (*realmode_interrupt)(u32 intno, u32 eax, u32 ebx, u32 ecx, u32 edx,
38 u32 esi, u32 edi) __attribute__((regparm(0)));
39
40#define FAKE_MEMORY_SIZE (1024*1024) // only 1MB
41#define INITIAL_EBDA_SEGMENT 0xF600
42#define INITIAL_EBDA_SIZE 0x400
43
44int int10_handler(struct eregs *regs);
45int int12_handler(struct eregs *regs);
46int int16_handler(struct eregs *regs);
47int int1a_handler(struct eregs *regs);
48