Revision 3d53f5c3
b/hw/pc.c | ||
---|---|---|
834 | 834 |
return qemu_allocate_irqs(pic_irq_request, NULL, 1); |
835 | 835 |
} |
836 | 836 |
|
837 |
/* PC hardware initialisation */ |
|
838 |
static void pc_init1(ram_addr_t ram_size, |
|
839 |
const char *boot_device, |
|
840 |
const char *kernel_filename, |
|
841 |
const char *kernel_cmdline, |
|
842 |
const char *initrd_filename, |
|
843 |
const char *cpu_model, |
|
844 |
int pci_enabled) |
|
837 |
static void pc_memory_init(ram_addr_t ram_size, |
|
838 |
const char *kernel_filename, |
|
839 |
const char *kernel_cmdline, |
|
840 |
const char *initrd_filename, |
|
841 |
ram_addr_t *below_4g_mem_size_p, |
|
842 |
ram_addr_t *above_4g_mem_size_p) |
|
845 | 843 |
{ |
846 | 844 |
char *filename; |
847 | 845 |
int ret, linux_boot, i; |
848 | 846 |
ram_addr_t ram_addr, bios_offset, option_rom_offset; |
849 | 847 |
ram_addr_t below_4g_mem_size, above_4g_mem_size = 0; |
850 | 848 |
int bios_size, isa_bios_size; |
851 |
PCIBus *pci_bus; |
|
852 |
PCII440FXState *i440fx_state; |
|
853 |
int piix3_devfn = -1; |
|
854 |
qemu_irq *cpu_irq; |
|
855 |
qemu_irq *isa_irq; |
|
856 |
qemu_irq *i8259; |
|
857 |
qemu_irq *cmos_s3; |
|
858 |
qemu_irq *smi_irq; |
|
859 |
IsaIrqState *isa_irq_state; |
|
860 |
DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS]; |
|
861 |
DriveInfo *fd[MAX_FD]; |
|
862 |
void *fw_cfg; |
|
863 |
FDCtrl *floppy_controller; |
|
864 |
RTCState *rtc_state; |
|
865 |
PITState *pit; |
|
849 |
void **fw_cfg; |
|
866 | 850 |
|
867 | 851 |
if (ram_size >= 0xe0000000 ) { |
868 | 852 |
above_4g_mem_size = ram_size - 0xe0000000; |
... | ... | |
870 | 854 |
} else { |
871 | 855 |
below_4g_mem_size = ram_size; |
872 | 856 |
} |
857 |
*above_4g_mem_size_p = above_4g_mem_size; |
|
858 |
*below_4g_mem_size_p = below_4g_mem_size; |
|
873 | 859 |
|
874 | 860 |
linux_boot = (kernel_filename != NULL); |
875 | 861 |
|
876 |
pc_cpus_init(cpu_model); |
|
877 |
|
|
878 |
vmport_init(); |
|
879 |
|
|
880 | 862 |
/* allocate RAM */ |
881 | 863 |
ram_addr = qemu_ram_alloc(below_4g_mem_size); |
882 | 864 |
cpu_register_physical_memory(0, 0xa0000, ram_addr); |
... | ... | |
939 | 921 |
rom_set_fw(fw_cfg); |
940 | 922 |
|
941 | 923 |
if (linux_boot) { |
942 |
load_linux(fw_cfg, kernel_filename, initrd_filename, kernel_cmdline, below_4g_mem_size); |
|
924 |
load_linux(*fw_cfg, kernel_filename, initrd_filename, kernel_cmdline, below_4g_mem_size);
|
|
943 | 925 |
} |
944 | 926 |
|
945 | 927 |
for (i = 0; i < nb_option_roms; i++) { |
946 | 928 |
rom_add_option(option_rom[i]); |
947 | 929 |
} |
930 |
} |
|
931 |
|
|
932 |
/* PC hardware initialisation */ |
|
933 |
static void pc_init1(ram_addr_t ram_size, |
|
934 |
const char *boot_device, |
|
935 |
const char *kernel_filename, |
|
936 |
const char *kernel_cmdline, |
|
937 |
const char *initrd_filename, |
|
938 |
const char *cpu_model, |
|
939 |
int pci_enabled) |
|
940 |
{ |
|
941 |
int i; |
|
942 |
ram_addr_t below_4g_mem_size, above_4g_mem_size; |
|
943 |
PCIBus *pci_bus; |
|
944 |
PCII440FXState *i440fx_state; |
|
945 |
int piix3_devfn = -1; |
|
946 |
qemu_irq *cpu_irq; |
|
947 |
qemu_irq *isa_irq; |
|
948 |
qemu_irq *i8259; |
|
949 |
qemu_irq *cmos_s3; |
|
950 |
qemu_irq *smi_irq; |
|
951 |
IsaIrqState *isa_irq_state; |
|
952 |
DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS]; |
|
953 |
DriveInfo *fd[MAX_FD]; |
|
954 |
FDCtrl *floppy_controller; |
|
955 |
RTCState *rtc_state; |
|
956 |
PITState *pit; |
|
957 |
|
|
958 |
pc_cpus_init(cpu_model); |
|
959 |
|
|
960 |
vmport_init(); |
|
961 |
|
|
962 |
/* allocate ram and load rom/bios */ |
|
963 |
pc_memory_init(ram_size, kernel_filename, kernel_cmdline, initrd_filename, |
|
964 |
&below_4g_mem_size, &above_4g_mem_size); |
|
948 | 965 |
|
949 | 966 |
cpu_irq = pc_allocate_cpu_irq(); |
950 | 967 |
i8259 = i8259_init(cpu_irq[0]); |
Also available in: Unified diff