| 1 | /****************************************************************************** |
| 2 | * Copyright (c) 2004, 2008 IBM Corporation |
| 3 | * Copyright (c) 2009 Pattrick Hueper <[email protected]> |
| 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); |
| 68 | extern yabel_handleIntFunc yabel_intFuncArray[256]; |
| 69 | void mainboard_interrupt_handlers(int, yabel_handleIntFunc); |
| 70 | |
| 71 | struct device; |
| 72 | |
| 73 | u32 biosemu(u8 *biosmem, u32 biosmem_size, struct device *dev, unsigned long rom_addr); |
| 74 | #endif |