blob: b8cc02a51efbbb168b380255e95b663580287e19 [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.
Stefan Reinauer216fa462011-10-12 14:25:07 -070015 */
16
Stefan Reinauer399486e2012-12-06 13:54:29 -080017#ifndef __DEVICE_OPROM_REALMODE_X86_H__
18#define __DEVICE_OPROM_REALMODE_X86_H__
19
20#include <arch/cpu.h>
21
Stefan Reinauer216fa462011-10-12 14:25:07 -070022#define REALMODE_BASE ((void *)0x600)
23
24struct realmode_idt {
25 u16 offset, cs;
26};
27
28void x86_exception(struct eregs *info);
29
30/* From x86_asm.S */
Aaron Durbina146d582013-02-08 16:56:51 -060031extern unsigned char __idt_handler;
32extern unsigned int __idt_handler_size;
33extern unsigned char __realmode_code;
34extern unsigned int __realmode_code_size;
Stefan Reinauer216fa462011-10-12 14:25:07 -070035
36extern void (*realmode_call)(u32 addr, u32 eax, u32 ebx, u32 ecx, u32 edx,
Stefan Reinauer399486e2012-12-06 13:54:29 -080037 u32 esi, u32 edi) asmlinkage;
Stefan Reinauer216fa462011-10-12 14:25:07 -070038
39extern void (*realmode_interrupt)(u32 intno, u32 eax, u32 ebx, u32 ecx, u32 edx,
Stefan Reinauer399486e2012-12-06 13:54:29 -080040 u32 esi, u32 edi) asmlinkage;
Stefan Reinauer216fa462011-10-12 14:25:07 -070041
42#define FAKE_MEMORY_SIZE (1024*1024) // only 1MB
43#define INITIAL_EBDA_SEGMENT 0xF600
44#define INITIAL_EBDA_SIZE 0x400
45
Patrick Georgi199b09c2012-11-22 12:46:12 +010046int int10_handler(void);
47int int12_handler(void);
48int int16_handler(void);
49int int1a_handler(void);
Stefan Reinauer216fa462011-10-12 14:25:07 -070050
Edward O'Callaghan91810dd2014-07-30 13:53:04 +100051#endif /* __DEVICE_OPROM_REALMODE_X86_H__ */