1 /* SPDX-License-Identifier: GPL-2.0 */
3 * From Coreboot file device/oprom/realmode/x86.h
5 * Copyright (C) 2007 Advanced Micro Devices, Inc.
6 * Copyright (C) 2009-2010 coresystems GmbH
9 #ifndef _X86_LIB_BIOS_H
10 #define _X86_LIB_BIOS_H
12 #include <linux/linkage.h>
14 #define REALMODE_BASE 0x600
18 #define PTR_TO_REAL_MODE(x) (x - asm_realmode_code + REALMODE_BASE)
22 /* Convert a symbol address to our real mode area */
23 #define PTR_TO_REAL_MODE(sym)\
24 (void *)(REALMODE_BASE + ((char *)&(sym) - (char *)&asm_realmode_code))
27 * The following symbols cannot be used directly. They need to be fixed up
28 * to point to the correct address location after the code has been copied
29 * to REALMODE_BASE. Absolute symbols are not used because those symbols are
30 * relocated by U-Boot.
32 extern unsigned char asm_realmode_call, __realmode_interrupt;
33 extern unsigned char asm_realmode_buffer;
79 void x86_exception(struct eregs *info);
82 extern unsigned char __idt_handler;
83 extern unsigned int __idt_handler_size;
84 extern unsigned char asm_realmode_code;
85 extern unsigned int asm_realmode_code_size;
87 asmlinkage void (*realmode_call)(u32 addr, u32 eax, u32 ebx, u32 ecx, u32 edx,
90 asmlinkage void (*realmode_interrupt)(u32 intno, u32 eax, u32 ebx, u32 ecx,
91 u32 edx, u32 esi, u32 edi);
93 int int10_handler(void);
94 int int12_handler(void);
95 int int16_handler(void);
96 int int1a_handler(void);
97 #endif /*__ASSEMBLY__ */