blob: 2ecc36e43f62c99f7f295a67514de062da42fc5a [file] [log] [blame]
Stefan Reinauer38cd29e2009-08-11 21:28:25 +00001/****************************************************************************
2 * YABEL BIOS Emulator
3 *
Stefan Reinauer38cd29e2009-08-11 21:28:25 +00004 * Copyright (c) 2008 Pattrick Hueper <phueper@hueper.net>
Martin Rotha9e1a222016-01-14 14:15:24 -07005 *
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 Reinauer38cd29e2009-08-11 21:28:25 +000032 ****************************************************************************/
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 */
42typedef 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 Roth63373ed2013-07-08 16:24:19 -060049 /* 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 Reinauer38cd29e2009-08-11 21:28:25 +000052 * 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 Reinauer6a001132017-07-13 02:20:27 +020057} __packed pmm_information_t;
Stefan Reinauer38cd29e2009-08-11 21:28:25 +000058
Stefan Reinauer14e22772010-04-27 06:56:47 +000059/* This function is used to setup the PMM struct in virtual memory
Stefan Reinauer38cd29e2009-08-11 21:28:25 +000060 * at a certain offset */
61u8 pmm_setup(u16 segment, u16 offset);
62
63/* This is the INT Handler mentioned above, called by my special PMM INT. */
64void pmm_handleInt(void);
65
66void pmm_test(void);
67
Martin Rothfd277d82016-01-11 12:47:30 -070068#endif /* _YABEL_PMM_H_ */