Stefan Reinauer | 216fa46 | 2011-10-12 14:25:07 -0700 | [diff] [blame] | 1 | /* |
| 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. |
Stefan Reinauer | 216fa46 | 2011-10-12 14:25:07 -0700 | [diff] [blame] | 15 | */ |
| 16 | |
Stefan Reinauer | 399486e | 2012-12-06 13:54:29 -0800 | [diff] [blame] | 17 | #ifndef __DEVICE_OPROM_REALMODE_X86_H__ |
| 18 | #define __DEVICE_OPROM_REALMODE_X86_H__ |
| 19 | |
| 20 | #include <arch/cpu.h> |
| 21 | |
Stefan Reinauer | 216fa46 | 2011-10-12 14:25:07 -0700 | [diff] [blame] | 22 | #define REALMODE_BASE ((void *)0x600) |
| 23 | |
| 24 | struct realmode_idt { |
| 25 | u16 offset, cs; |
| 26 | }; |
| 27 | |
| 28 | void x86_exception(struct eregs *info); |
| 29 | |
| 30 | /* From x86_asm.S */ |
Aaron Durbin | a146d58 | 2013-02-08 16:56:51 -0600 | [diff] [blame] | 31 | extern unsigned char __idt_handler; |
| 32 | extern unsigned int __idt_handler_size; |
| 33 | extern unsigned char __realmode_code; |
| 34 | extern unsigned int __realmode_code_size; |
Stefan Reinauer | 216fa46 | 2011-10-12 14:25:07 -0700 | [diff] [blame] | 35 | |
| 36 | extern void (*realmode_call)(u32 addr, u32 eax, u32 ebx, u32 ecx, u32 edx, |
Stefan Reinauer | 399486e | 2012-12-06 13:54:29 -0800 | [diff] [blame] | 37 | u32 esi, u32 edi) asmlinkage; |
Stefan Reinauer | 216fa46 | 2011-10-12 14:25:07 -0700 | [diff] [blame] | 38 | |
| 39 | extern void (*realmode_interrupt)(u32 intno, u32 eax, u32 ebx, u32 ecx, u32 edx, |
Stefan Reinauer | 399486e | 2012-12-06 13:54:29 -0800 | [diff] [blame] | 40 | u32 esi, u32 edi) asmlinkage; |
Stefan Reinauer | 216fa46 | 2011-10-12 14:25:07 -0700 | [diff] [blame] | 41 | |
| 42 | #define FAKE_MEMORY_SIZE (1024*1024) // only 1MB |
| 43 | #define INITIAL_EBDA_SEGMENT 0xF600 |
| 44 | #define INITIAL_EBDA_SIZE 0x400 |
| 45 | |
Patrick Georgi | 199b09c | 2012-11-22 12:46:12 +0100 | [diff] [blame] | 46 | int int10_handler(void); |
| 47 | int int12_handler(void); |
| 48 | int int16_handler(void); |
| 49 | int int1a_handler(void); |
Stefan Reinauer | 216fa46 | 2011-10-12 14:25:07 -0700 | [diff] [blame] | 50 | |
Edward O'Callaghan | 91810dd | 2014-07-30 13:53:04 +1000 | [diff] [blame] | 51 | #endif /* __DEVICE_OPROM_REALMODE_X86_H__ */ |