Stefan Reinauer | 38cd29e | 2009-08-11 21:28:25 +0000 | [diff] [blame] | 1 | /**************************************************************************** |
| 2 | * YABEL BIOS Emulator |
| 3 | * |
Stefan Reinauer | 38cd29e | 2009-08-11 21:28:25 +0000 | [diff] [blame] | 4 | * Copyright (c) 2008 Pattrick Hueper <phueper@hueper.net> |
Martin Roth | a9e1a22 | 2016-01-14 14:15:24 -0700 | [diff] [blame] | 5 | * |
| 6 | * All rights reserved. |
| 7 | * |
| 8 | * Redistribution and use in source and binary forms, with or without |
| 9 | * modification, are permitted provided that the following conditions are |
| 10 | * met: |
| 11 | * |
| 12 | * Redistributions of source code must retain the above copyright |
| 13 | * notice, this list of conditions and the following disclaimer. |
| 14 | * |
| 15 | * Redistributions in binary form must reproduce the above copyright |
| 16 | * notice, this list of conditions and the following disclaimer |
| 17 | * in the documentation and/or other materials provided with the |
| 18 | * distribution. |
| 19 | * |
| 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 31 | * |
Stefan Reinauer | 38cd29e | 2009-08-11 21:28:25 +0000 | [diff] [blame] | 32 | ****************************************************************************/ |
| 33 | |
| 34 | #ifndef _YABEL_PMM_H_ |
| 35 | #define _YABEL_PMM_H_ |
| 36 | |
| 37 | #include <types.h> |
| 38 | |
| 39 | /* PMM Structure see PMM Spec Version 1.01 Chapter 3.1.1 |
| 40 | * (search web for specspmm101.pdf) |
| 41 | */ |
| 42 | typedef struct { |
| 43 | u8 signature[4]; |
| 44 | u8 struct_rev; |
| 45 | u8 length; |
| 46 | u8 checksum; |
| 47 | u32 entry_point_offset; |
| 48 | u8 reserved[5]; |
Martin Roth | 63373ed | 2013-07-08 16:24:19 -0600 | [diff] [blame] | 49 | /* Code is not part of the specced PMM struct, however, since I cannot |
| 50 | * put the handling of PMM in the virtual memory (I don't want to hack |
| 51 | * it together in x86 assembly ;-)) this code array is pointed to by |
Stefan Reinauer | 38cd29e | 2009-08-11 21:28:25 +0000 | [diff] [blame] | 52 | * entry_point_offset, in code there is only a INT call and a RETF, |
| 53 | * thus every PMM call will issue a PMM INT (only defined in YABEL, |
| 54 | * see interrupt.c) and the INT Handler will do the actual PMM work. |
| 55 | */ |
| 56 | u8 code[3]; |
Stefan Reinauer | 6a00113 | 2017-07-13 02:20:27 +0200 | [diff] [blame] | 57 | } __packed pmm_information_t; |
Stefan Reinauer | 38cd29e | 2009-08-11 21:28:25 +0000 | [diff] [blame] | 58 | |
Stefan Reinauer | 14e2277 | 2010-04-27 06:56:47 +0000 | [diff] [blame] | 59 | /* This function is used to setup the PMM struct in virtual memory |
Stefan Reinauer | 38cd29e | 2009-08-11 21:28:25 +0000 | [diff] [blame] | 60 | * at a certain offset */ |
| 61 | u8 pmm_setup(u16 segment, u16 offset); |
| 62 | |
| 63 | /* This is the INT Handler mentioned above, called by my special PMM INT. */ |
| 64 | void pmm_handleInt(void); |
| 65 | |
| 66 | void pmm_test(void); |
| 67 | |
Martin Roth | fd277d8 | 2016-01-11 12:47:30 -0700 | [diff] [blame] | 68 | #endif /* _YABEL_PMM_H_ */ |