summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/sgi/localbus/imc.c34
-rw-r--r--sys/arch/sgi/localbus/imcvar.h32
2 files changed, 36 insertions, 30 deletions
diff --git a/sys/arch/sgi/localbus/imc.c b/sys/arch/sgi/localbus/imc.c
index 65a518a8fa5..3d540417b9c 100644
--- a/sys/arch/sgi/localbus/imc.c
+++ b/sys/arch/sgi/localbus/imc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: imc.c,v 1.4 2012/04/15 20:38:10 miod Exp $ */
+/* $OpenBSD: imc.c,v 1.5 2012/04/15 20:42:52 miod Exp $ */
/* $NetBSD: imc.c,v 1.32 2011/07/01 18:53:46 dyoung Exp $ */
/*
@@ -82,36 +82,11 @@ uint32_t imc_bus_error(uint32_t, struct trap_frame *);
void imc_bus_reset(void);
int imc_watchdog_cb(void *, int);
-uint8_t imc_read_1(bus_space_tag_t, bus_space_handle_t, bus_size_t);
-uint16_t imc_read_2(bus_space_tag_t, bus_space_handle_t, bus_size_t);
-void imc_read_raw_2(bus_space_tag_t, bus_space_handle_t, bus_addr_t,
- uint8_t *, bus_size_t);
-void imc_write_1(bus_space_tag_t, bus_space_handle_t, bus_size_t, uint8_t);
-void imc_write_2(bus_space_tag_t, bus_space_handle_t, bus_size_t, uint16_t);
-void imc_write_raw_2(bus_space_tag_t, bus_space_handle_t, bus_addr_t,
- const uint8_t *, bus_size_t);
-uint32_t imc_read_4(bus_space_tag_t, bus_space_handle_t, bus_size_t);
-uint64_t imc_read_8(bus_space_tag_t, bus_space_handle_t, bus_size_t);
-void imc_write_4(bus_space_tag_t, bus_space_handle_t, bus_size_t, uint32_t);
-void imc_write_8(bus_space_tag_t, bus_space_handle_t, bus_size_t, uint64_t);
-void imc_read_raw_4(bus_space_tag_t, bus_space_handle_t, bus_addr_t,
- uint8_t *, bus_size_t);
-void imc_write_raw_4(bus_space_tag_t, bus_space_handle_t, bus_addr_t,
- const uint8_t *, bus_size_t);
-void imc_read_raw_8(bus_space_tag_t, bus_space_handle_t, bus_addr_t,
- uint8_t *, bus_size_t);
-void imc_write_raw_8(bus_space_tag_t, bus_space_handle_t, bus_addr_t,
- const uint8_t *, bus_size_t);
-int imc_space_map(bus_space_tag_t, bus_addr_t, bus_size_t, int,
- bus_space_handle_t *);
-void imc_space_unmap(bus_space_tag_t, bus_space_handle_t, bus_size_t);
-int imc_space_region(bus_space_tag_t, bus_space_handle_t, bus_size_t,
- bus_size_t, bus_space_handle_t *);
-void *imc_space_vaddr(bus_space_tag_t, bus_space_handle_t);
void imc_space_barrier(bus_space_tag_t, bus_space_handle_t, bus_size_t,
bus_size_t, int);
-bus_space_t imcbus_tag = {/* not static for gio_cnattch() */
+/* can't be static for gio_cnattach() */
+bus_space_t imcbus_tag = {
PHYS_TO_XKPHYS(0, CCA_NC),
NULL,
imc_read_1, imc_write_1,
@@ -178,7 +153,8 @@ static bus_space_t imcbus_eisa_mem_tag = {
bus_addr_t imc_pa_to_device(paddr_t);
paddr_t imc_device_to_pa(bus_addr_t);
-struct machine_bus_dma_tag imc_bus_dma_tag = {/* not static for gio_cnattch() */
+/* can't be static for gio_cnattach() */
+struct machine_bus_dma_tag imc_bus_dma_tag = {
NULL, /* _cookie */
_dmamap_create,
_dmamap_destroy,
diff --git a/sys/arch/sgi/localbus/imcvar.h b/sys/arch/sgi/localbus/imcvar.h
index 651d23f9d3e..2b9a9074f58 100644
--- a/sys/arch/sgi/localbus/imcvar.h
+++ b/sys/arch/sgi/localbus/imcvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: imcvar.h,v 1.1 2012/03/28 20:44:23 miod Exp $ */
+/* $OpenBSD: imcvar.h,v 1.2 2012/04/15 20:42:52 miod Exp $ */
/* $NetBSD: imcvar.h,v 1.1 2006/08/30 23:44:52 rumble Exp $ */
/*
@@ -40,3 +40,33 @@ int imc_is_sysad_parity_enabled(void);
*(volatile uint32_t *)PHYS_TO_XKPHYS(IMC_BASE + (o), CCA_NC)
#define imc_write(o,v) \
*(volatile uint32_t *)PHYS_TO_XKPHYS(IMC_BASE + (o), CCA_NC) = (v)
+
+uint8_t imc_read_1(bus_space_tag_t, bus_space_handle_t, bus_size_t);
+uint16_t imc_read_2(bus_space_tag_t, bus_space_handle_t, bus_size_t);
+void imc_read_raw_2(bus_space_tag_t, bus_space_handle_t, bus_addr_t,
+ uint8_t *, bus_size_t);
+void imc_write_1(bus_space_tag_t, bus_space_handle_t, bus_size_t, uint8_t);
+void imc_write_2(bus_space_tag_t, bus_space_handle_t, bus_size_t, uint16_t);
+void imc_write_raw_2(bus_space_tag_t, bus_space_handle_t, bus_addr_t,
+ const uint8_t *, bus_size_t);
+uint32_t imc_read_4(bus_space_tag_t, bus_space_handle_t, bus_size_t);
+uint64_t imc_read_8(bus_space_tag_t, bus_space_handle_t, bus_size_t);
+void imc_write_4(bus_space_tag_t, bus_space_handle_t, bus_size_t, uint32_t);
+void imc_write_8(bus_space_tag_t, bus_space_handle_t, bus_size_t, uint64_t);
+void imc_read_raw_4(bus_space_tag_t, bus_space_handle_t, bus_addr_t,
+ uint8_t *, bus_size_t);
+void imc_write_raw_4(bus_space_tag_t, bus_space_handle_t, bus_addr_t,
+ const uint8_t *, bus_size_t);
+void imc_read_raw_8(bus_space_tag_t, bus_space_handle_t, bus_addr_t,
+ uint8_t *, bus_size_t);
+void imc_write_raw_8(bus_space_tag_t, bus_space_handle_t, bus_addr_t,
+ const uint8_t *, bus_size_t);
+int imc_space_map(bus_space_tag_t, bus_addr_t, bus_size_t, int,
+ bus_space_handle_t *);
+void imc_space_unmap(bus_space_tag_t, bus_space_handle_t, bus_size_t);
+int imc_space_region(bus_space_tag_t, bus_space_handle_t, bus_size_t,
+ bus_size_t, bus_space_handle_t *);
+void *imc_space_vaddr(bus_space_tag_t, bus_space_handle_t);
+
+extern struct machine_bus_dma_tag imc_bus_dma_tag;
+extern bus_space_t imcbus_tag;