95645dffdc7e6a0894581b4ecf8c458a94a90ea3
[coreboot.git] / src / devices / oprom / yabel / pmm.h
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];
27         /* Code is not part of the speced PMM struct, however, since I cannot
28          * put the handling of PMM in the virtual memory (I dont want to hack it
29          * together in x86 assembly ;-)) this code array is pointed to by
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
37 /* This function is used to setup the PMM struct in virtual memory 
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