Skip to content

Commit f7736b9

Browse files
committed
Compile ide/core only once
Make win2k install hack unconditional as it is still restricted to x86 only in vl.c. Replace TARGET_PAGE_SIZE and 4096 with PAGE_SIZE. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
1 parent b305b9d commit f7736b9

17 files changed

+24
-17
lines changed

Makefile.objs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ hw-obj-$(CONFIG_LAN9118) += lan9118.o
162162
hw-obj-$(CONFIG_NE2000_ISA) += ne2000-isa.o
163163

164164
# IDE
165+
hw-obj-$(CONFIG_IDE_CORE) += ide/core.o
165166
hw-obj-$(CONFIG_IDE_QDEV) += ide/qdev.o
166167
hw-obj-$(CONFIG_IDE_PCI) += ide/pci.o
167168
hw-obj-$(CONFIG_IDE_ISA) += ide/isa.o

Makefile.target

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,7 @@ obj-y += rtl8139.o
181181
obj-y += e1000.o
182182

183183
# Hardware support
184-
obj-i386-y = ide/core.o
185-
obj-i386-y += pckbd.o dma.o
184+
obj-i386-y = pckbd.o dma.o
186185
obj-i386-y += vga.o
187186
obj-i386-y += mc146818rtc.o i8259.o pc.o
188187
obj-i386-y += cirrus_vga.o apic.o ioapic.o acpi.o piix_pci.o
@@ -191,7 +190,7 @@ obj-i386-y += device-hotplug.o pci-hotplug.o smbios.o wdt_ib700.o
191190
obj-i386-y += debugcon.o multiboot.o
192191

193192
# shared objects
194-
obj-ppc-y = ppc.o ide/core.o ide/macio.o
193+
obj-ppc-y = ppc.o ide/macio.o
195194
obj-ppc-y += vga.o dma.o openpic.o
196195
# PREP target
197196
obj-ppc-y += pckbd.o i8259.o mc146818rtc.o
@@ -215,7 +214,6 @@ obj-mips-y += mips_addr.o mips_timer.o mips_int.o
215214
obj-mips-y += dma.o vga.o i8259.o rc4030.o
216215
obj-mips-y += vga-isa-mm.o
217216
obj-mips-y += g364fb.o jazz_led.o dp8393x.o
218-
obj-mips-y += ide/core.o
219217
obj-mips-y += gt64xxx.o pckbd.o mc146818rtc.o acpi.o ds1225y.o
220218
obj-mips-y += piix4.o cirrus_vga.o
221219
obj-mips-y += mipsnet.o
@@ -248,7 +246,6 @@ obj-cris-y += pflash_cfi02.o
248246

249247
ifeq ($(TARGET_ARCH), sparc64)
250248
obj-sparc-y = sun4u.o pckbd.o apb_pci.o
251-
obj-sparc-y += ide/core.o
252249
obj-sparc-y += vga.o
253250
obj-sparc-y += mc146818rtc.o
254251
obj-sparc-y += cirrus_vga.o
@@ -268,7 +265,7 @@ obj-arm-y += arm-semi.o
268265
obj-arm-y += pxa2xx.o pxa2xx_pic.o pxa2xx_gpio.o pxa2xx_timer.o pxa2xx_dma.o
269266
obj-arm-y += pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o pxa2xx_keypad.o
270267
obj-arm-y += pflash_cfi01.o gumstix.o
271-
obj-arm-y += zaurus.o ide/core.o ide/microdrive.o spitz.o tosa.o tc6393xb.o
268+
obj-arm-y += zaurus.o ide/microdrive.o spitz.o tosa.o tc6393xb.o
272269
obj-arm-y += omap1.o omap_lcdc.o omap_dma.o omap_clk.o omap_mmc.o omap_i2c.o
273270
obj-arm-y += omap2.o omap_dss.o soc_dma.o
274271
obj-arm-y += omap_sx1.o palm.o tsc210x.o
@@ -282,7 +279,7 @@ obj-arm-y += syborg_virtio.o
282279

283280
obj-sh4-y = shix.o r2d.o sh7750.o sh7750_regnames.o tc58128.o
284281
obj-sh4-y += sh_timer.o sh_serial.o sh_intc.o sh_pci.o sm501.o
285-
obj-sh4-y += ide/core.o ide/mmio.o
282+
obj-sh4-y += ide/mmio.o
286283

287284
obj-m68k-y = an5206.o mcf5206.o mcf_uart.o mcf_intc.o mcf5208.o mcf_fec.o
288285
obj-m68k-y += m68k-semi.o dummy_m68k.o

default-configs/arm-softmmu.mak

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ CONFIG_ECC=y
88
CONFIG_SERIAL=y
99
CONFIG_PTIMER=y
1010
CONFIG_SD=y
11+
CONFIG_IDE_CORE=y
1112
CONFIG_MAX7310=y
1213
CONFIG_WM8750=y
1314
CONFIG_TWL92230=y

default-configs/i386-softmmu.mak

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ CONFIG_I8254=y
99
CONFIG_PCSPK=y
1010
CONFIG_USB_UHCI=y
1111
CONFIG_FDC=y
12+
CONFIG_IDE_CORE=y
1213
CONFIG_IDE_QDEV=y
1314
CONFIG_IDE_PCI=y
1415
CONFIG_IDE_ISA=y

default-configs/mips-softmmu.mak

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ CONFIG_I8254=y
1010
CONFIG_PCSPK=y
1111
CONFIG_USB_UHCI=y
1212
CONFIG_FDC=y
13+
CONFIG_IDE_CORE=y
1314
CONFIG_IDE_QDEV=y
1415
CONFIG_IDE_PCI=y
1516
CONFIG_IDE_ISA=y

default-configs/mips64-softmmu.mak

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ CONFIG_I8254=y
1010
CONFIG_PCSPK=y
1111
CONFIG_USB_UHCI=y
1212
CONFIG_FDC=y
13+
CONFIG_IDE_CORE=y
1314
CONFIG_IDE_QDEV=y
1415
CONFIG_IDE_PCI=y
1516
CONFIG_IDE_ISA=y

default-configs/mips64el-softmmu.mak

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ CONFIG_I8254=y
1010
CONFIG_PCSPK=y
1111
CONFIG_USB_UHCI=y
1212
CONFIG_FDC=y
13+
CONFIG_IDE_CORE=y
1314
CONFIG_IDE_QDEV=y
1415
CONFIG_IDE_PCI=y
1516
CONFIG_IDE_ISA=y

default-configs/mipsel-softmmu.mak

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ CONFIG_I8254=y
1010
CONFIG_PCSPK=y
1111
CONFIG_USB_UHCI=y
1212
CONFIG_FDC=y
13+
CONFIG_IDE_CORE=y
1314
CONFIG_IDE_QDEV=y
1415
CONFIG_IDE_PCI=y
1516
CONFIG_IDE_ISA=y

default-configs/ppc-softmmu.mak

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ CONFIG_VGA_PCI=y
99
CONFIG_SERIAL=y
1010
CONFIG_I8254=y
1111
CONFIG_FDC=y
12+
CONFIG_IDE_CORE=y
1213
CONFIG_IDE_QDEV=y
1314
CONFIG_IDE_PCI=y
1415
CONFIG_IDE_ISA=y

default-configs/ppc64-softmmu.mak

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ CONFIG_VGA_PCI=y
99
CONFIG_SERIAL=y
1010
CONFIG_I8254=y
1111
CONFIG_FDC=y
12+
CONFIG_IDE_CORE=y
1213
CONFIG_IDE_QDEV=y
1314
CONFIG_IDE_PCI=y
1415
CONFIG_IDE_ISA=y

default-configs/ppcemb-softmmu.mak

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ CONFIG_VGA_PCI=y
99
CONFIG_SERIAL=y
1010
CONFIG_I8254=y
1111
CONFIG_FDC=y
12+
CONFIG_IDE_CORE=y
1213
CONFIG_IDE_QDEV=y
1314
CONFIG_IDE_PCI=y
1415
CONFIG_IDE_ISA=y

default-configs/sh4-softmmu.mak

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ CONFIG_USB_OHCI=y
44
CONFIG_SERIAL=y
55
CONFIG_PTIMER=y
66
CONFIG_VIRTIO_PCI=y
7+
CONFIG_IDE_CORE=y

default-configs/sh4eb-softmmu.mak

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ CONFIG_USB_OHCI=y
44
CONFIG_SERIAL=y
55
CONFIG_PTIMER=y
66
CONFIG_VIRTIO_PCI=y
7+
CONFIG_IDE_CORE=y

default-configs/sparc64-softmmu.mak

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ CONFIG_VGA_PCI=y
77
CONFIG_SERIAL=y
88
CONFIG_PARALLEL=y
99
CONFIG_FDC=y
10+
CONFIG_IDE_CORE=y
1011
CONFIG_IDE_QDEV=y
1112
CONFIG_IDE_PCI=y
1213
CONFIG_IDE_ISA=y

default-configs/x86_64-softmmu.mak

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ CONFIG_I8254=y
99
CONFIG_PCSPK=y
1010
CONFIG_USB_UHCI=y
1111
CONFIG_FDC=y
12+
CONFIG_IDE_CORE=y
1213
CONFIG_IDE_QDEV=y
1314
CONFIG_IDE_PCI=y
1415
CONFIG_IDE_ISA=y

hw/ide/core.c

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#include <hw/pc.h>
2727
#include <hw/pci.h>
2828
#include <hw/scsi.h>
29-
#include <hw/sh.h>
3029
#include "block.h"
3130
#include "block_int.h"
3231
#include "qemu-timer.h"
@@ -434,13 +433,13 @@ static int dma_buf_prepare(BMDMAState *bm, int is_write)
434433
} prd;
435434
int l, len;
436435

437-
qemu_sglist_init(&s->sg, s->nsector / (TARGET_PAGE_SIZE/512) + 1);
436+
qemu_sglist_init(&s->sg, s->nsector / (PAGE_SIZE / 512) + 1);
438437
s->io_buffer_size = 0;
439438
for(;;) {
440439
if (bm->cur_prd_len == 0) {
441440
/* end of table (with a fail safe of one page) */
442441
if (bm->cur_prd_last ||
443-
(bm->cur_addr - bm->addr) >= 4096)
442+
(bm->cur_addr - bm->addr) >= PAGE_SIZE)
444443
return s->io_buffer_size != 0;
445444
cpu_physical_memory_read(bm->cur_addr, (uint8_t *)&prd, 8);
446445
bm->cur_addr += 8;
@@ -523,7 +522,7 @@ static int dma_buf_rw(BMDMAState *bm, int is_write)
523522
if (bm->cur_prd_len == 0) {
524523
/* end of table (with a fail safe of one page) */
525524
if (bm->cur_prd_last ||
526-
(bm->cur_addr - bm->addr) >= 4096)
525+
(bm->cur_addr - bm->addr) >= PAGE_SIZE)
527526
return 0;
528527
cpu_physical_memory_read(bm->cur_addr, (uint8_t *)&prd, 8);
529528
bm->cur_addr += 8;
@@ -651,19 +650,16 @@ static void ide_sector_write(IDEState *s)
651650
}
652651
ide_set_sector(s, sector_num + n);
653652

654-
#ifdef TARGET_I386
655653
if (win2k_install_hack && ((++s->irq_count % 16) == 0)) {
656654
/* It seems there is a bug in the Windows 2000 installer HDD
657655
IDE driver which fills the disk with empty logs when the
658656
IDE write IRQ comes too early. This hack tries to correct
659657
that at the expense of slower write performances. Use this
660658
option _only_ to install Windows 2000. You must disable it
661659
for normal use. */
662-
qemu_mod_timer(s->sector_write_timer,
660+
qemu_mod_timer(s->sector_write_timer,
663661
qemu_get_clock(vm_clock) + (get_ticks_per_sec() / 1000));
664-
} else
665-
#endif
666-
{
662+
} else {
667663
ide_set_irq(s->bus);
668664
}
669665
}

vl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,8 @@ int no_quit = 0;
207207
CharDriverState *serial_hds[MAX_SERIAL_PORTS];
208208
CharDriverState *parallel_hds[MAX_PARALLEL_PORTS];
209209
CharDriverState *virtcon_hds[MAX_VIRTIO_CONSOLES];
210-
#ifdef TARGET_I386
211210
int win2k_install_hack = 0;
211+
#ifdef TARGET_I386
212212
int rtc_td_hack = 0;
213213
#endif
214214
int usb_enabled = 0;

0 commit comments

Comments
 (0)