Stefan Reinauer | 38cd29e | 2009-08-11 21:28:25 +0000 | [diff] [blame] | 1 | /**************************************************************************** |
| 2 | * YABEL BIOS Emulator |
| 3 | * |
| 4 | * This program and the accompanying materials |
| 5 | * are made available under the terms of the BSD License |
| 6 | * which accompanies this distribution, and is available at |
| 7 | * http://www.opensource.org/licenses/bsd-license.php |
| 8 | * |
| 9 | * Copyright (c) 2008 Pattrick Hueper <phueper@hueper.net> |
| 10 | ****************************************************************************/ |
| 11 | |
| 12 | #ifndef _YABEL_PMM_H_ |
| 13 | #define _YABEL_PMM_H_ |
| 14 | |
| 15 | #include <types.h> |
| 16 | |
| 17 | /* PMM Structure see PMM Spec Version 1.01 Chapter 3.1.1 |
| 18 | * (search web for specspmm101.pdf) |
| 19 | */ |
| 20 | typedef struct { |
| 21 | u8 signature[4]; |
| 22 | u8 struct_rev; |
| 23 | u8 length; |
| 24 | u8 checksum; |
| 25 | u32 entry_point_offset; |
| 26 | u8 reserved[5]; |
Martin Roth | 63373ed | 2013-07-08 16:24:19 -0600 | [diff] [blame] | 27 | /* Code is not part of the specced PMM struct, however, since I cannot |
| 28 | * put the handling of PMM in the virtual memory (I don't want to hack |
| 29 | * it together in x86 assembly ;-)) this code array is pointed to by |
Stefan Reinauer | 38cd29e | 2009-08-11 21:28:25 +0000 | [diff] [blame] | 30 | * entry_point_offset, in code there is only a INT call and a RETF, |
| 31 | * thus every PMM call will issue a PMM INT (only defined in YABEL, |
| 32 | * see interrupt.c) and the INT Handler will do the actual PMM work. |
| 33 | */ |
| 34 | u8 code[3]; |
| 35 | } __attribute__ ((__packed__)) pmm_information_t; |
| 36 | |
Stefan Reinauer | 14e2277 | 2010-04-27 06:56:47 +0000 | [diff] [blame] | 37 | /* This function is used to setup the PMM struct in virtual memory |
Stefan Reinauer | 38cd29e | 2009-08-11 21:28:25 +0000 | [diff] [blame] | 38 | * at a certain offset */ |
| 39 | u8 pmm_setup(u16 segment, u16 offset); |
| 40 | |
| 41 | /* This is the INT Handler mentioned above, called by my special PMM INT. */ |
| 42 | void pmm_handleInt(void); |
| 43 | |
| 44 | void pmm_test(void); |
| 45 | |
| 46 | #endif // _YABEL_PMM_H |