[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 09/26] pc: remove global variable rtc_state by using
From: |
Isaku Yamahata |
Subject: |
[Qemu-devel] [PATCH 09/26] pc: remove global variable rtc_state by using qemu_irq. |
Date: |
Fri, 14 May 2010 16:29:07 +0900 |
Remove the reference to the global variable, rtc_state, by passing
function argument to cmos_init_hd(), cmos_init().
Signed-off-by: Isaku Yamahata <address@hidden>
Cc: Paolo Bonzini <address@hidden>
Acked-by: Gerd Hoffmann <address@hidden>
Cc: Blue Swirl <address@hidden>
---
Changes v12 -> v13
Blue already converted the CMOS S3 to use qemu_irq by
the change set of 53b67b3052f39b049bc7c79ae1ce132c90098c6c.
So the patch is simplified.
---
hw/pc.c | 16 +++++++---------
1 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/hw/pc.c b/hw/pc.c
index 3b6da4a..c88158c 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -65,8 +65,6 @@
#define MAX_IDE_BUS 2
-static RTCState *rtc_state;
-
#define E820_NR_ENTRIES 16
struct e820_entry {
@@ -207,9 +205,9 @@ static int cmos_get_fd_drive_type(int fd0)
return val;
}
-static void cmos_init_hd(int type_ofs, int info_ofs, BlockDriverState *hd)
+static void cmos_init_hd(int type_ofs, int info_ofs, BlockDriverState *hd,
+ RTCState *s)
{
- RTCState *s = rtc_state;
int cylinders, heads, sectors;
bdrv_get_geometry_hint(hd, &cylinders, &heads, §ors);
rtc_set_memory(s, type_ofs, 47);
@@ -273,9 +271,8 @@ static int pc_boot_set(void *opaque, const char
*boot_device)
/* hd_table must contain 4 block drivers */
static void cmos_init(ram_addr_t ram_size, ram_addr_t above_4g_mem_size,
const char *boot_device, DriveInfo **hd_table,
- FDCtrl *floppy_controller)
+ FDCtrl *floppy_controller, RTCState *s)
{
- RTCState *s = rtc_state;
int val;
int fd0, fd1, nb;
int i;
@@ -350,9 +347,9 @@ static void cmos_init(ram_addr_t ram_size, ram_addr_t
above_4g_mem_size,
rtc_set_memory(s, 0x12, (hd_table[0] ? 0xf0 : 0) | (hd_table[1] ? 0x0f :
0));
if (hd_table[0])
- cmos_init_hd(0x19, 0x1b, hd_table[0]->bdrv);
+ cmos_init_hd(0x19, 0x1b, hd_table[0]->bdrv, s);
if (hd_table[1])
- cmos_init_hd(0x1a, 0x24, hd_table[1]->bdrv);
+ cmos_init_hd(0x1a, 0x24, hd_table[1]->bdrv, s);
val = 0;
for (i = 0; i < 4; i++) {
@@ -835,6 +832,7 @@ static void pc_init1(ram_addr_t ram_size,
DriveInfo *fd[MAX_FD];
void *fw_cfg;
FDCtrl *floppy_controller;
+ RTCState *rtc_state;
PITState *pit;
if (ram_size >= 0xe0000000 ) {
@@ -1037,7 +1035,7 @@ static void pc_init1(ram_addr_t ram_size,
floppy_controller = fdctrl_init_isa(fd);
cmos_init(below_4g_mem_size, above_4g_mem_size, boot_device, hd,
- floppy_controller);
+ floppy_controller, rtc_state);
if (pci_enabled && usb_enabled) {
usb_uhci_piix3_init(pci_bus, piix3_devfn + 2);
--
1.6.6.1
- [Qemu-devel] [PATCH 00/26] split out piix specific part from pc emulator and some clean ups, Isaku Yamahata, 2010/05/14
- [Qemu-devel] [PATCH 11/26] pc: make pc_init1() not refer ferr_irq directly., Isaku Yamahata, 2010/05/14
- [Qemu-devel] [PATCH 15/26] pc: split out basic device init from pc_init1() into pc_basic_device_init(), Isaku Yamahata, 2010/05/14
- [Qemu-devel] [PATCH 09/26] pc: remove global variable rtc_state by using qemu_irq.,
Isaku Yamahata <=
- [Qemu-devel] [PATCH 04/26] acpi: split acpi.c into the common part and the piix4 part., Isaku Yamahata, 2010/05/14
- [Qemu-devel] [PATCH 01/26] acpi: split out piix4 smbus routines from acpi.c into pm_smbus.c, Isaku Yamahata, 2010/05/14
- [Qemu-devel] [PATCH 10/26] pc: introduce a function to allocate cpu irq., Isaku Yamahata, 2010/05/14
- [Qemu-devel] [PATCH 07/26] pc: make an unnecessary global variable, pit, local., Isaku Yamahata, 2010/05/14
- [Qemu-devel] [PATCH 02/26] acpi: split out apm register emulation from acpi.c, Isaku Yamahata, 2010/05/14
- [Qemu-devel] [PATCH 05/26] pc: initialize ioapic before use., Isaku Yamahata, 2010/05/14
- [Qemu-devel] [PATCH 06/26] pc, i440fx: Make smm enable/disable function i440fx independent., Isaku Yamahata, 2010/05/14
- [Qemu-devel] [PATCH 13/26] pc: split out memory allocation from pc_init1() into pc_memory_init(), Isaku Yamahata, 2010/05/14
- [Qemu-devel] [PATCH 08/26] pc: remove a global variable, floppy_controller., Isaku Yamahata, 2010/05/14
- [Qemu-devel] [PATCH 14/26] pc: split out vga initialization from pc_init1() into pc_vga_init()., Isaku Yamahata, 2010/05/14