blob: a0c7a9002c499b8e60bcd49832880b0f7cc16e7e [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
Stefan Reinauer399486e2012-12-06 13:54:29 -080021#ifndef __DEVICE_OPROM_REALMODE_X86_H__
22#define __DEVICE_OPROM_REALMODE_X86_H__
23
24#include <arch/cpu.h>
25
Stefan Reinauer216fa462011-10-12 14:25:07 -070026#define REALMODE_BASE ((void *)0x600)
27
28struct realmode_idt {
29 u16 offset, cs;
30};
31
32void x86_exception(struct eregs *info);
33
34/* From x86_asm.S */
Aaron Durbina146d582013-02-08 16:56:51 -060035extern unsigned char __idt_handler;
36extern unsigned int __idt_handler_size;
37extern unsigned char __realmode_code;
38extern unsigned int __realmode_code_size;
Stefan Reinauer216fa462011-10-12 14:25:07 -070039
40extern void (*realmode_call)(u32 addr, u32 eax, u32 ebx, u32 ecx, u32 edx,
Stefan Reinauer399486e2012-12-06 13:54:29 -080041 u32 esi, u32 edi) asmlinkage;
Stefan Reinauer216fa462011-10-12 14:25:07 -070042
43extern void (*realmode_interrupt)(u32 intno, u32 eax, u32 ebx, u32 ecx, u32 edx,
Stefan Reinauer399486e2012-12-06 13:54:29 -080044 u32 esi, u32 edi) asmlinkage;
Stefan Reinauer216fa462011-10-12 14:25:07 -070045
46#define FAKE_MEMORY_SIZE (1024*1024) // only 1MB
47#define INITIAL_EBDA_SEGMENT 0xF600
48#define INITIAL_EBDA_SIZE 0x400
49
Patrick Georgi199b09c2012-11-22 12:46:12 +010050int int10_handler(void);
51int int12_handler(void);
52int int16_handler(void);
53int int1a_handler(void);
Stefan Reinauer216fa462011-10-12 14:25:07 -070054
Edward O'Callaghan91810dd2014-07-30 13:53:04 +100055#endif /* __DEVICE_OPROM_REALMODE_X86_H__ */