coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
biosemu.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright (c) 2004, 2008 IBM Corporation
3  * Copyright (c) 2009 Pattrick Hueper <phueper@hueper.net>
4  *
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions are
9  * met:
10  *
11  * Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  *
14  * Redistributions in binary form must reproduce the above copyright
15  * notice, this list of conditions and the following disclaimer
16  * in the documentation and/or other materials provided with the
17  * distribution.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23  * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30  *
31  * Contributors:
32  * IBM Corporation - initial implementation
33  *****************************************************************************/
34 
35 #ifndef _BIOSEMU_BIOSEMU_H_
36 #define _BIOSEMU_BIOSEMU_H_
37 
38 #define MIN_REQUIRED_VMEM_SIZE 0x100000 // 1MB
39 
40 //define default segments for different components
41 #define STACK_SEGMENT 0x1000 //1000:xxxx
42 #define STACK_START_OFFSET 0xfffe
43 
44 #define DATA_SEGMENT 0x2000
45 #define VBE_SEGMENT 0x3000
46 
47 #define PMM_CONV_SEGMENT 0x4000 // 4000:xxxx is PMM conventional memory area, extended memory area
48  // will be anything beyond MIN_REQUIRED_MEMORY_SIZE
49 #define PNP_DATA_SEGMENT 0x5000
50 
51 #define OPTION_ROM_CODE_SEGMENT 0xc000
52 
53 #define BIOS_DATA_SEGMENT 0xF000
54 // both EBDA values are _initial_ values, they may (and will be) changed at runtime by option ROMs!!
55 #define INITIAL_EBDA_SEGMENT 0xF600 // segment of the Extended BIOS Data Area
56 #define INITIAL_EBDA_SIZE 0x400 // size of the EBDA (at least 1KB!! since size is stored in KB!)
57 
58 #define PMM_INT_NUM 0xFC // we misuse INT FC for PMM functionality, at the PMM Entry Point
59  // Address, there will only be a call to this INT and a RETF
60 #define PNP_INT_NUM 0xFD
61 
62 /* array of function pointers to override generic interrupt handlers
63  * a YABEL caller can add functions to this array before calling YABEL
64  * if a interrupt occurs, YABEL checks whether a function is set in
65  * this array and only runs the generic interrupt handler code, if
66  * the function pointer is NULL */
67 typedef int (* yabel_handleIntFunc)(void);
70 
71 struct device;
72 
73 u32 biosemu(u8 *biosmem, u32 biosmem_size, struct device *dev, unsigned long rom_addr);
74 #endif
void mainboard_interrupt_handlers(int, yabel_handleIntFunc)
Definition: x86.c:120
u32 biosemu(u8 *biosmem, u32 biosmem_size, struct device *dev, unsigned long rom_addr)
Definition: biosemu.c:87
int(* yabel_handleIntFunc)(void)
Definition: biosemu.h:67
yabel_handleIntFunc yabel_intFuncArray[256]
Definition: biosemu.c:71
u8 * biosmem
Definition: vbe.c:74
uint32_t u32
Definition: stdint.h:51
uint8_t u8
Definition: stdint.h:45
Definition: device.h:107
u32 biosmem_size
Definition: vbe.c:75
typedef void(X86APIP X86EMU_intrFuncs)(int num)