blob: 403d78d0fd208f783a5009d1591966faf69225d6 [file] [log] [blame]
Stefan Reinauer38cd29e2009-08-11 21:28:25 +00001/******************************************************************************
2 * Copyright (c) 2004, 2008 IBM Corporation
3 * Copyright (c) 2009 Pattrick Hueper <phueper@hueper.net>
Martin Rotha9e1a222016-01-14 14:15:24 -07004 *
Stefan Reinauer38cd29e2009-08-11 21:28:25 +00005 * All rights reserved.
Martin Rotha9e1a222016-01-14 14:15:24 -07006 *
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.
Stefan Reinauer38cd29e2009-08-11 21:28:25 +000030 *
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
Martin Roth63373ed2013-07-08 16:24:19 -060048 // will be anything beyond MIN_REQUIRED_MEMORY_SIZE
Stefan Reinauer38cd29e2009-08-11 21:28:25 +000049#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
Martin Roth63373ed2013-07-08 16:24:19 -060062/* array of function pointers to override generic interrupt handlers
Stefan Reinauer38cd29e2009-08-11 21:28:25 +000063 * a YABEL caller can add functions to this array before calling YABEL
Martin Roth63373ed2013-07-08 16:24:19 -060064 * if a interrupt occurs, YABEL checks whether a function is set in
Stefan Reinauer38cd29e2009-08-11 21:28:25 +000065 * this array and only runs the generic interrupt handler code, if
66 * the function pointer is NULL */
67typedef int (* yabel_handleIntFunc)(void);
68extern yabel_handleIntFunc yabel_intFuncArray[256];
Patrick Georgif3a163a2012-08-16 15:39:35 +020069void mainboard_interrupt_handlers(int, yabel_handleIntFunc);
Stefan Reinauer38cd29e2009-08-11 21:28:25 +000070
Uwe Hermann01ce6012010-03-05 10:03:50 +000071struct device;
72
73u32 biosemu(u8 *biosmem, u32 biosmem_size, struct device *dev, unsigned long rom_addr);
Stefan Reinauer38cd29e2009-08-11 21:28:25 +000074#endif