1 /*	$OpenBSD: rbus_machdep.h,v 1.4 2011/03/23 16:54:37 pirofti Exp $	*/
2 
3 /*
4  * Copyright (c) 2007 Mark Kettenis
5  *
6  * Permission to use, copy, modify, and distribute this software for any
7  * purpose with or without fee is hereby granted, provided that the above
8  * copyright notice and this permission notice appear in all copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17  */
18 
19 #ifndef _MACHINE_RBUS_MACHDEP_H_
20 #define _MACHINE_RBUS_MACHDEP_H_
21 
22 struct pci_attach_args;
23 
24 rbus_tag_t rbus_pccbb_parent_io(struct device *, struct pci_attach_args *);
25 rbus_tag_t rbus_pccbb_parent_mem(struct device *, struct pci_attach_args *);
26 
27 #define md_space_map(rbt, addr, size, flags, hp) \
28 	bus_space_map((rbt)->rb_bt, (addr), (size), (flags), (hp))
29 #define md_space_unmap(rbt, h, size, addrp) \
30 	do { \
31 		*addrp = (rbt)->rb_bt->sparc_bus_addr((rbt)->rb_bt, \
32 		    (rbt)->rb_bt, (h)); \
33 		bus_space_unmap((rbt)->rb_bt, (h), (size)); \
34 	} while (0)
35 
36 void pccbb_attach_hook(struct device *, struct device *,
37 	struct pci_attach_args *);
38 
39 #endif /* _MACHINE_RBUS_MACHDEP_H_ */
40