* [Qemu-devel] [PATCH] Let ESP SCSI adapter to be usable outside sun4m
@ 2008-02-24 21:07 Hervé Poussineau
2008-02-29 18:59 ` Blue Swirl
0 siblings, 1 reply; 2+ messages in thread
From: Hervé Poussineau @ 2008-02-24 21:07 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 313 bytes --]
Hi,
At the moment, ESP SCSI adapter can only be used inside sun4m machines.
Attached patch moves the declaration outside sun4m.h, so other machines
can also use it.
I've moved the declaration to devices.h because I found no better place
to put it. If you know a better place, please tell me :)
Hervé
[-- Attachment #2: esp.patch --]
[-- Type: text/plain, Size: 3235 bytes --]
Index: Makefile.target
===================================================================
RCS file: /sources/qemu/qemu/Makefile.target,v
retrieving revision 1.245
diff -u -r1.245 Makefile.target
--- Makefile.target 10 Feb 2008 16:33:12 -0000 1.245
+++ Makefile.target 24 Feb 2008 20:43:50 -0000
@@ -511,7 +511,7 @@
endif
# SCSI layer
-OBJS+= lsi53c895a.o
+OBJS+= lsi53c895a.o esp.o
# USB layer
OBJS+= usb-ohci.o
@@ -573,7 +573,7 @@
OBJS+= cirrus_vga.o parallel.o ptimer.o
else
OBJS+= sun4m.o tcx.o pcnet.o iommu.o m48t59.o slavio_intctl.o
-OBJS+= slavio_timer.o slavio_serial.o slavio_misc.o fdc.o esp.o sparc32_dma.o
+OBJS+= slavio_timer.o slavio_serial.o slavio_misc.o fdc.o sparc32_dma.o
OBJS+= cs4231.o ptimer.o eccmemctl.o sbi.o sun4c_intctl.o
endif
endif
Index: hw/devices.h
===================================================================
RCS file: /sources/qemu/qemu/hw/devices.h,v
retrieving revision 1.2
diff -u -r1.2 devices.h
--- hw/devices.h 18 Nov 2007 14:36:08 -0000 1.2
+++ hw/devices.h 24 Feb 2008 20:57:22 -0000
@@ -16,6 +16,16 @@
void ads7846_write(void *opaque, uint32_t value);
struct ads7846_state_s *ads7846_init(qemu_irq penirq);
+/* esp.c */
+#ifdef CPU_DEFS_H
+#define ESP_MAX_DEVS 7
+void esp_scsi_attach(void *opaque, BlockDriverState *bd, int id);
+void *esp_init(target_phys_addr_t espaddr,
+ void *dma_opaque, qemu_irq irq, qemu_irq *reset);
+void espdma_memory_read(void *opaque, uint8_t *buf, int len);
+void espdma_memory_write(void *opaque, uint8_t *buf, int len);
+#endif
+
/* stellaris_input.c */
void stellaris_gamepad_init(int n, qemu_irq *irq, const int *keycode);
Index: hw/esp.c
===================================================================
RCS file: /sources/qemu/qemu/hw/esp.c,v
retrieving revision 1.33
diff -u -r1.33 esp.c
--- hw/esp.c 1 Jan 2008 17:06:38 -0000 1.33
+++ hw/esp.c 24 Feb 2008 20:50:30 -0000
@@ -24,9 +24,7 @@
#include "hw.h"
#include "block.h"
#include "scsi-disk.h"
-#include "sun4m.h"
-/* FIXME: Only needed for MAX_DISKS, which is probably wrong. */
-#include "sysemu.h"
+#include "devices.h"
/* debug ESP card */
//#define DEBUG_ESP
Index: hw/sun4m.c
===================================================================
RCS file: /sources/qemu/qemu/hw/sun4m.c,v
retrieving revision 1.84
diff -u -r1.84 sun4m.c
--- hw/sun4m.c 11 Feb 2008 20:01:36 -0000 1.84
+++ hw/sun4m.c 24 Feb 2008 20:46:24 -0000
@@ -31,6 +31,7 @@
#include "net.h"
#include "boards.h"
#include "firmware_abi.h"
+#include "devices.h"
//#define DEBUG_IRQ
Index: hw/sun4m.h
===================================================================
RCS file: /sources/qemu/qemu/hw/sun4m.h,v
retrieving revision 1.10
diff -u -r1.10 sun4m.h
--- hw/sun4m.h 27 Jan 2008 09:49:28 -0000 1.10
+++ hw/sun4m.h 24 Feb 2008 20:45:42 -0000
@@ -59,12 +59,6 @@
CPUState *env);
void slavio_set_power_fail(void *opaque, int power_failing);
-/* esp.c */
-#define ESP_MAX_DEVS 7
-void esp_scsi_attach(void *opaque, BlockDriverState *bd, int id);
-void *esp_init(target_phys_addr_t espaddr,
- void *dma_opaque, qemu_irq irq, qemu_irq *reset);
-
/* cs4231.c */
void cs_init(target_phys_addr_t base, int irq, void *intctl);
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] Let ESP SCSI adapter to be usable outside sun4m
2008-02-24 21:07 [Qemu-devel] [PATCH] Let ESP SCSI adapter to be usable outside sun4m Hervé Poussineau
@ 2008-02-29 18:59 ` Blue Swirl
0 siblings, 0 replies; 2+ messages in thread
From: Blue Swirl @ 2008-02-29 18:59 UTC (permalink / raw)
To: qemu-devel
On 2/24/08, Hervé Poussineau <hpoussin@reactos.org> wrote:
> Hi,
>
> At the moment, ESP SCSI adapter can only be used inside sun4m machines.
> Attached patch moves the declaration outside sun4m.h, so other machines
> can also use it.
> I've moved the declaration to devices.h because I found no better place
> to put it. If you know a better place, please tell me :)
Good idea, but the patch breaks compiling other targets than Sparc32,
because the DMA functions are not defined. Before we have the generic
DMA, it may be possible to add #defines to use other DMA controllers'
functions. Or the correct access functions could be registered at init
time for small performance penalty.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-02-29 19:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-24 21:07 [Qemu-devel] [PATCH] Let ESP SCSI adapter to be usable outside sun4m Hervé Poussineau
2008-02-29 18:59 ` Blue Swirl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).