root / hw / pam.h @ 16665b94
History | View | Annotate | Download (3.3 kB)
1 | 410edd92 | Isaku Yamahata | #ifndef QEMU_PAM_H
|
---|---|---|---|
2 | 410edd92 | Isaku Yamahata | #define QEMU_PAM_H
|
3 | 410edd92 | Isaku Yamahata | |
4 | 410edd92 | Isaku Yamahata | /*
|
5 | 410edd92 | Isaku Yamahata | * Copyright (c) 2006 Fabrice Bellard
|
6 | 410edd92 | Isaku Yamahata | * Copyright (c) 2011 Isaku Yamahata <yamahata at valinux co jp>
|
7 | 410edd92 | Isaku Yamahata | * VA Linux Systems Japan K.K.
|
8 | 410edd92 | Isaku Yamahata | * Copyright (c) 2012 Jason Baron <jbaron@redhat.com>
|
9 | 410edd92 | Isaku Yamahata | *
|
10 | 410edd92 | Isaku Yamahata | * Split out from piix_pci.c
|
11 | 410edd92 | Isaku Yamahata | *
|
12 | 410edd92 | Isaku Yamahata | * Permission is hereby granted, free of charge, to any person obtaining a copy
|
13 | 410edd92 | Isaku Yamahata | * of this software and associated documentation files (the "Software"), to deal
|
14 | 410edd92 | Isaku Yamahata | * in the Software without restriction, including without limitation the rights
|
15 | 410edd92 | Isaku Yamahata | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
16 | 410edd92 | Isaku Yamahata | * copies of the Software, and to permit persons to whom the Software is
|
17 | 410edd92 | Isaku Yamahata | * furnished to do so, subject to the following conditions:
|
18 | 410edd92 | Isaku Yamahata | *
|
19 | 410edd92 | Isaku Yamahata | * The above copyright notice and this permission notice shall be included in
|
20 | 410edd92 | Isaku Yamahata | * all copies or substantial portions of the Software.
|
21 | 410edd92 | Isaku Yamahata | *
|
22 | 410edd92 | Isaku Yamahata | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
23 | 410edd92 | Isaku Yamahata | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
24 | 410edd92 | Isaku Yamahata | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
25 | 410edd92 | Isaku Yamahata | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
26 | 410edd92 | Isaku Yamahata | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
27 | 410edd92 | Isaku Yamahata | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
28 | 410edd92 | Isaku Yamahata | * THE SOFTWARE.
|
29 | 410edd92 | Isaku Yamahata | */
|
30 | 410edd92 | Isaku Yamahata | |
31 | 410edd92 | Isaku Yamahata | /*
|
32 | 410edd92 | Isaku Yamahata | * SMRAM memory area and PAM memory area in Legacy address range for PC.
|
33 | 410edd92 | Isaku Yamahata | * PAM: Programmable Attribute Map registers
|
34 | 410edd92 | Isaku Yamahata | *
|
35 | 410edd92 | Isaku Yamahata | * 0xa0000 - 0xbffff compatible SMRAM
|
36 | 410edd92 | Isaku Yamahata | *
|
37 | 410edd92 | Isaku Yamahata | * 0xc0000 - 0xc3fff Expansion area memory segments
|
38 | 410edd92 | Isaku Yamahata | * 0xc4000 - 0xc7fff
|
39 | 410edd92 | Isaku Yamahata | * 0xc8000 - 0xcbfff
|
40 | 410edd92 | Isaku Yamahata | * 0xcc000 - 0xcffff
|
41 | 410edd92 | Isaku Yamahata | * 0xd0000 - 0xd3fff
|
42 | 410edd92 | Isaku Yamahata | * 0xd4000 - 0xd7fff
|
43 | 410edd92 | Isaku Yamahata | * 0xd8000 - 0xdbfff
|
44 | 410edd92 | Isaku Yamahata | * 0xdc000 - 0xdffff
|
45 | 410edd92 | Isaku Yamahata | * 0xe0000 - 0xe3fff Extended System BIOS Area Memory Segments
|
46 | 410edd92 | Isaku Yamahata | * 0xe4000 - 0xe7fff
|
47 | 410edd92 | Isaku Yamahata | * 0xe8000 - 0xebfff
|
48 | 410edd92 | Isaku Yamahata | * 0xec000 - 0xeffff
|
49 | 410edd92 | Isaku Yamahata | *
|
50 | 410edd92 | Isaku Yamahata | * 0xf0000 - 0xfffff System BIOS Area Memory Segments
|
51 | 410edd92 | Isaku Yamahata | */
|
52 | 410edd92 | Isaku Yamahata | |
53 | 410edd92 | Isaku Yamahata | #include "qemu-common.h" |
54 | 022c62cb | Paolo Bonzini | #include "exec/memory.h" |
55 | 410edd92 | Isaku Yamahata | |
56 | 410edd92 | Isaku Yamahata | #define SMRAM_C_BASE 0xa0000 |
57 | 410edd92 | Isaku Yamahata | #define SMRAM_C_END 0xc0000 |
58 | 410edd92 | Isaku Yamahata | #define SMRAM_C_SIZE 0x20000 |
59 | 410edd92 | Isaku Yamahata | |
60 | 410edd92 | Isaku Yamahata | #define PAM_EXPAN_BASE 0xc0000 |
61 | 410edd92 | Isaku Yamahata | #define PAM_EXPAN_SIZE 0x04000 |
62 | 410edd92 | Isaku Yamahata | |
63 | 410edd92 | Isaku Yamahata | #define PAM_EXBIOS_BASE 0xe0000 |
64 | 410edd92 | Isaku Yamahata | #define PAM_EXBIOS_SIZE 0x04000 |
65 | 410edd92 | Isaku Yamahata | |
66 | 410edd92 | Isaku Yamahata | #define PAM_BIOS_BASE 0xf0000 |
67 | 410edd92 | Isaku Yamahata | #define PAM_BIOS_END 0xfffff |
68 | 410edd92 | Isaku Yamahata | /* 64KB: Intel 3 series express chipset family p. 58*/
|
69 | 410edd92 | Isaku Yamahata | #define PAM_BIOS_SIZE 0x10000 |
70 | 410edd92 | Isaku Yamahata | |
71 | 410edd92 | Isaku Yamahata | /* PAM registers: log nibble and high nibble*/
|
72 | 410edd92 | Isaku Yamahata | #define PAM_ATTR_WE ((uint8_t)2) |
73 | 410edd92 | Isaku Yamahata | #define PAM_ATTR_RE ((uint8_t)1) |
74 | 410edd92 | Isaku Yamahata | #define PAM_ATTR_MASK ((uint8_t)3) |
75 | 410edd92 | Isaku Yamahata | |
76 | 410edd92 | Isaku Yamahata | /* SMRAM register */
|
77 | 410edd92 | Isaku Yamahata | #define SMRAM_D_OPEN ((uint8_t)(1 << 6)) |
78 | 410edd92 | Isaku Yamahata | #define SMRAM_D_CLS ((uint8_t)(1 << 5)) |
79 | 410edd92 | Isaku Yamahata | #define SMRAM_D_LCK ((uint8_t)(1 << 4)) |
80 | 410edd92 | Isaku Yamahata | #define SMRAM_G_SMRAME ((uint8_t)(1 << 3)) |
81 | 410edd92 | Isaku Yamahata | #define SMRAM_C_BASE_SEG_MASK ((uint8_t)0x7) |
82 | 410edd92 | Isaku Yamahata | #define SMRAM_C_BASE_SEG ((uint8_t)0x2) /* hardwired to b010 */ |
83 | 410edd92 | Isaku Yamahata | |
84 | 410edd92 | Isaku Yamahata | typedef struct PAMMemoryRegion { |
85 | 410edd92 | Isaku Yamahata | MemoryRegion alias[4]; /* index = PAM value */ |
86 | 410edd92 | Isaku Yamahata | unsigned current;
|
87 | 410edd92 | Isaku Yamahata | } PAMMemoryRegion; |
88 | 410edd92 | Isaku Yamahata | |
89 | 410edd92 | Isaku Yamahata | void smram_update(MemoryRegion *smram_region, uint8_t smram,
|
90 | 410edd92 | Isaku Yamahata | uint8_t smm_enabled); |
91 | 410edd92 | Isaku Yamahata | void smram_set_smm(uint8_t *host_smm_enabled, int smm, uint8_t smram, |
92 | 410edd92 | Isaku Yamahata | MemoryRegion *smram_region); |
93 | 410edd92 | Isaku Yamahata | void init_pam(MemoryRegion *ram, MemoryRegion *system, MemoryRegion *pci,
|
94 | 410edd92 | Isaku Yamahata | PAMMemoryRegion *mem, uint32_t start, uint32_t size); |
95 | 410edd92 | Isaku Yamahata | void pam_update(PAMMemoryRegion *mem, int idx, uint8_t val); |
96 | 410edd92 | Isaku Yamahata | |
97 | 410edd92 | Isaku Yamahata | #endif /* QEMU_PAM_H */ |