Commit e20a8dff4c0da3827764924139d3bb73962f5d5a

Authored by Blue Swirl
1 parent 368b90db

Compile fdc, escc and SCSI controllers only once

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Makefile.hw
... ... @@ -21,7 +21,13 @@ OBJS+= fw_cfg.o
21 21 OBJS+= watchdog.o
22 22 OBJS+= nand.o ecc.o
23 23  
24   -OBJS+= m48t59.o
  24 +OBJS+= m48t59.o escc.o
  25 +
  26 +# PC style devices
  27 +OBJS+= fdc.o
  28 +
  29 +# SCSI layer
  30 +OBJS+= lsi53c895a.o esp.o
25 31  
26 32 OBJS+= dma-helpers.o sysbus.o
27 33  
... ...
Makefile.target
... ... @@ -548,9 +548,6 @@ ifeq ($(CONFIG_XEN), yes)
548 548 LIBS += $(XEN_LIBS)
549 549 endif
550 550  
551   -# SCSI layer
552   -OBJS+= lsi53c895a.o esp.o
553   -
554 551 # USB layer
555 552 OBJS+= usb-ohci.o
556 553  
... ... @@ -567,7 +564,7 @@ OBJS += wdt_ib700.o wdt_i6300esb.o
567 564 ifeq ($(TARGET_BASE_ARCH), i386)
568 565 # Hardware support
569 566 OBJS+= ide.o pckbd.o vga.o $(SOUND_HW) dma.o
570   -OBJS+= fdc.o mc146818rtc.o serial.o i8259.o i8254.o pcspk.o pc.o
  567 +OBJS+= mc146818rtc.o serial.o i8259.o i8254.o pcspk.o pc.o
571 568 OBJS+= cirrus_vga.o apic.o ioapic.o parallel.o acpi.o piix_pci.o
572 569 OBJS+= usb-uhci.o vmmouse.o vmport.o vmware_vga.o hpet.o
573 570 OBJS += device-hotplug.o pci-hotplug.o smbios.o
... ... @@ -578,10 +575,10 @@ CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
578 575 # shared objects
579 576 OBJS+= ppc.o ide.o vga.o $(SOUND_HW) dma.o openpic.o
580 577 # PREP target
581   -OBJS+= pckbd.o serial.o i8259.o i8254.o fdc.o mc146818rtc.o
  578 +OBJS+= pckbd.o serial.o i8259.o i8254.o mc146818rtc.o
582 579 OBJS+= prep_pci.o ppc_prep.o
583 580 # Mac shared devices
584   -OBJS+= macio.o cuda.o adb.o mac_nvram.o mac_dbdma.o escc.o
  581 +OBJS+= macio.o cuda.o adb.o mac_nvram.o mac_dbdma.o
585 582 # OldWorld PowerMac
586 583 OBJS+= heathrow_pic.o grackle_pci.o ppc_oldworld.o
587 584 # NewWorld PowerMac
... ... @@ -603,7 +600,7 @@ ifeq ($(TARGET_BASE_ARCH), mips)
603 600 OBJS+= mips_r4k.o mips_jazz.o mips_malta.o mips_mipssim.o
604 601 OBJS+= mips_timer.o mips_int.o dma.o vga.o serial.o i8254.o i8259.o rc4030.o
605 602 OBJS+= g364fb.o jazz_led.o dp8393x.o
606   -OBJS+= ide.o gt64xxx.o pckbd.o fdc.o mc146818rtc.o usb-uhci.o acpi.o ds1225y.o
  603 +OBJS+= ide.o gt64xxx.o pckbd.o mc146818rtc.o usb-uhci.o acpi.o ds1225y.o
607 604 OBJS+= piix_pci.o parallel.o cirrus_vga.o pcspk.o $(SOUND_HW)
608 605 OBJS+= mipsnet.o
609 606 OBJS+= pflash_cfi01.o
... ... @@ -626,11 +623,11 @@ endif
626 623 ifeq ($(TARGET_BASE_ARCH), sparc)
627 624 ifeq ($(TARGET_ARCH), sparc64)
628 625 OBJS+= sun4u.o ide.o pckbd.o vga.o apb_pci.o
629   -OBJS+= fdc.o mc146818rtc.o serial.o
  626 +OBJS+= mc146818rtc.o serial.o
630 627 OBJS+= cirrus_vga.o parallel.o
631 628 else
632 629 OBJS+= sun4m.o tcx.o iommu.o slavio_intctl.o
633   -OBJS+= slavio_timer.o escc.o slavio_misc.o fdc.o sparc32_dma.o
  630 +OBJS+= slavio_timer.o slavio_misc.o sparc32_dma.o
634 631 OBJS+= cs4231.o eccmemctl.o sbi.o sun4c_intctl.o
635 632 endif
636 633 endif
... ...
hw/lsi53c895a.c
... ... @@ -841,14 +841,15 @@ static inline int32_t sxt24(int32_t n)
841 841 return (n << 8) >> 8;
842 842 }
843 843  
  844 +#define LSI_BUF_SIZE 4096
844 845 static void lsi_memcpy(LSIState *s, uint32_t dest, uint32_t src, int count)
845 846 {
846 847 int n;
847   - uint8_t buf[TARGET_PAGE_SIZE];
  848 + uint8_t buf[LSI_BUF_SIZE];
848 849  
849 850 DPRINTF("memcpy dest 0x%08x src 0x%08x count %d\n", dest, src, count);
850 851 while (count) {
851   - n = (count > TARGET_PAGE_SIZE) ? TARGET_PAGE_SIZE : count;
  852 + n = (count > LSI_BUF_SIZE) ? LSI_BUF_SIZE : count;
852 853 cpu_physical_memory_read(src, buf, n);
853 854 cpu_physical_memory_write(dest, buf, n);
854 855 src += n;
... ...