1 /* $NetBSD: schizovar.h,v 1.2 2008/12/10 05:56:22 mrg Exp $ */
2 /* $OpenBSD: schizovar.h,v 1.10 2007/01/14 16:19:49 kettenis Exp $ */
5 * Copyright (c) 2002 Jason L. Wright (jason@thought.net)
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
21 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
25 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
26 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 * POSSIBILITY OF SUCH DAMAGE.
31 struct schizo_softc
*sp_sc
;
33 struct schizo_range
*sp_range
;
34 pci_chipset_tag_t sp_pc
;
39 bus_space_tag_t sp_memt
;
40 bus_space_tag_t sp_iot
;
41 bus_space_tag_t sp_regt
;
42 bus_space_handle_t sp_regh
;
43 bus_space_tag_t sp_cfgt
;
44 bus_space_handle_t sp_cfgh
;
45 bus_dma_tag_t sp_dmat
;
49 struct iommu_state sp_is
;
50 struct strbuf_ctl sp_sb
;
58 bus_dma_tag_t sc_dmat
;
59 bus_space_tag_t sc_bustag
;
61 bus_space_handle_t sc_ctrlh
;
62 bus_space_handle_t sc_confh
;
63 struct upa_reg sc_reg0
;
69 #define schizo_read(sc,r) \
70 bus_space_read_8((sc)->sc_bustag, (sc)->sc_ctrlh, (r))
71 #define schizo_write(sc,r,v) \
72 bus_space_write_8((sc)->sc_bustag, (sc)->sc_ctrlh, (r), (v))
73 #define schizo_pbm_read(pbm,r) \
74 bus_space_read_8((pbm)->sp_regt, (pbm)->sp_regh, (r))
75 #define schizo_pbm_write(pbm,r,v) \
76 bus_space_write_8((pbm)->sp_regt, (pbm)->sp_regh, (r), (v))
77 #define schizo_cfg_read(pbm,r) \
78 bus_space_read_4((pbm)->sp_cfgt, (pbm)->sp_cfgh, (r))
79 #define schizo_cfg_write(pbm,r,v) \
80 bus_space_write_4((pbm)->sp_cfgt, (pbm)->sp_cfgh, (r), (v))