xref: /netbsd-src/sys/arch/alpha/include/bus_user.h (revision bf158e33f8ddb4806758d116c5263901660763ff)
1 /* $NetBSD: bus_user.h,v 1.3 2019/09/23 16:17:54 skrll Exp $ */
2 /*
3  * XXX This file is a stopgap intended to keep NetBSD/alpha buildable
4  * XXX while developers figure out whether/how to expose to userland
5  * XXX the bus_space(9) and pci(9) facilities used by libalpha (which
6  * XXX is used by X11).
7  * XXX
8  * XXX Do NOT add new definitions to this file.
9  */
10 #ifndef _ALPHA_BUS_USER_H_
11 #define _ALPHA_BUS_USER_H_
12 
13 #include <sys/types.h>
14 
15 /*
16  * Addresses (in bus space).
17  */
18 typedef u_long bus_addr_t;
19 typedef u_long bus_size_t;
20 
21 #define PRIxBUSADDR	"lx"
22 #define PRIxBUSSIZE	"lx"
23 #define PRIuBUSSIZE	"lu"
24 
25 /*
26  * Translation of an Alpha bus address; INTERNAL USE ONLY.
27  */
28 struct alpha_bus_space_translation {
29 	bus_addr_t	abst_bus_start;	/* start of bus window */
30 	bus_addr_t	abst_bus_end;	/* end of bus window */
31 	__paddr_t	abst_sys_start;	/* start of sysBus window */
32 	__paddr_t	abst_sys_end;	/* end of sysBus window */
33 	int		abst_addr_shift;/* address shift */
34 	int		abst_size_shift;/* size shift */
35 	int		abst_flags;	/* flags; see below */
36 };
37 
38 #define	ABST_BWX		0x01	/* use BWX to access the bus */
39 #define	ABST_DENSE		0x02	/* space is dense */
40 
41 #define	BUS_SPACE_MAP_LINEAR		0x02
42 #define	BUS_SPACE_MAP_PREFETCHABLE     	0x04
43 
44 #endif /* _ALPHA_BUS_USER_H_ */
45