]>
Commit | Line | Data |
---|---|---|
92e74dc3 MP |
1 | Index: qemu-snapshot-2007-02-09_05/hw/piix_pci.c |
2 | =================================================================== | |
3 | --- qemu-snapshot-2007-02-09_05.orig/hw/piix_pci.c | |
4 | +++ qemu-snapshot-2007-02-09_05/hw/piix_pci.c | |
5 | @@ -155,7 +155,7 @@ static int i440fx_load(QEMUFile* f, void | |
6 | return 0; | |
7 | } | |
8 | ||
9 | -PCIBus *i440fx_init(PCIDevice **pi440fx_state, qemu_irq *pic) | |
10 | +PCIBus *i440fx_init(PCIDevice **pi440fx_state, qemu_irq *pic, int ram_size) | |
11 | { | |
12 | PCIBus *b; | |
13 | PCIDevice *d; | |
14 | @@ -186,6 +186,10 @@ PCIBus *i440fx_init(PCIDevice **pi440fx_ | |
15 | d->config[0x0a] = 0x00; // class_sub = host2pci | |
16 | d->config[0x0b] = 0x06; // class_base = PCI_bridge | |
17 | d->config[0x0e] = 0x00; // header_type | |
18 | + ram_size = ram_size / 8 / 1024 / 1024; | |
19 | + if (ram_size > 255) | |
20 | + ram_size = 255; | |
21 | + d->config[0x57] = ram_size; | |
22 | ||
23 | d->config[0x72] = 0x02; /* SMRAM */ | |
24 | ||
25 | Index: qemu-snapshot-2007-02-09_05/hw/pc.c | |
26 | =================================================================== | |
27 | --- qemu-snapshot-2007-02-09_05.orig/hw/pc.c | |
28 | +++ qemu-snapshot-2007-02-09_05/hw/pc.c | |
29 | @@ -623,7 +623,7 @@ static void pc_init1(int ram_size, int v | |
30 | } | |
31 | ||
32 | if (pci_enabled) { | |
33 | - pci_bus = i440fx_init(&i440fx_state, i8259); | |
34 | + pci_bus = i440fx_init(&i440fx_state, i8259, ram_size); | |
35 | piix3_devfn = piix3_init(pci_bus, -1); | |
36 | } else { | |
37 | pci_bus = NULL; | |
38 | Index: qemu-snapshot-2007-02-09_05/hw/pc.h | |
39 | =================================================================== | |
40 | --- qemu-snapshot-2007-02-09_05.orig/hw/pc.h | |
41 | +++ qemu-snapshot-2007-02-09_05/hw/pc.h | |
42 | @@ -841,7 +841,7 @@ PCIBus *pci_apb_init(target_ulong specia | |
43 | PCIBus *pci_vpb_init(void *pic, int irq, int realview); | |
44 | ||
45 | /* piix_pci.c */ | |
46 | -PCIBus *i440fx_init(PCIDevice **pi440fx_state, qemu_irq *pic); | |
47 | +PCIBus *i440fx_init(PCIDevice **pi440fx_state, qemu_irq *pic, int ram_size); | |
48 | void i440fx_set_smm(PCIDevice *d, int val); | |
49 | int piix3_init(PCIBus *bus, int devfn); | |
50 | void i440fx_init_memory_mappings(PCIDevice *d); |