diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2012-04-15 20:42:53 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2012-04-15 20:42:53 +0000 |
commit | aff35ecb8eedf9fb6b8ce71c3e1ad582bac54500 (patch) | |
tree | 844c4b30001f2e4fb5ce14763153282b5b032256 | |
parent | ddd4a6ae7c06594ec976059318dc36aad02c083a (diff) |
Declare most imc bus_space(9) methods in a visible header; this will be used
to make the hpc3 bus_space_tag (similar to the imc one except for the
bus_space_barrier method) a global, compile-time known, object; which will in
turn help getting glass console to work (pckbc will depend on this).
-rw-r--r-- | sys/arch/sgi/localbus/imc.c | 34 | ||||
-rw-r--r-- | sys/arch/sgi/localbus/imcvar.h | 32 |
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; |