sysarch.h revision 1.6 1 /* $NetBSD: sysarch.h,v 1.6 2000/06/30 18:19:28 simonb Exp $ */
2
3 /*-
4 * Copyright (c) 2000 The NetBSD Foundation, Inc.
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jason R. Thorpe.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. All advertising materials mentioning features or use of this software
19 * must display the following acknowledgement:
20 * This product includes software developed by the NetBSD
21 * Foundation, Inc. and its contributors.
22 * 4. Neither the name of The NetBSD Foundation nor the names of its
23 * contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 * POSSIBILITY OF SUCH DAMAGE.
37 */
38
39 #ifndef _ALPHA_SYSARCH_H_
40 #define _ALPHA_SYSARCH_H_
41
42 #include <machine/bus.h>
43 #include <machine/ieeefp.h>
44
45 /*
46 * Architecture specific syscalls (ALPHA)
47 */
48
49 #define ALPHA_FPGETMASK 0
50 #define ALPHA_FPSETMASK 1
51 #define ALPHA_FPSETSTICKY 2
52 struct alpha_fp_except_args {
53 fp_except mask;
54 };
55
56 #define ALPHA_BUS_GET_WINDOW_COUNT 3
57 struct alpha_bus_get_window_count_args {
58 u_int type;
59 u_int count; /* output */
60 };
61
62 #define ALPHA_BUS_GET_WINDOW 4
63 struct alpha_bus_get_window_args {
64 u_int type;
65 u_int window;
66 struct alpha_bus_space_translation *translation; /* output */
67 };
68
69 #define ALPHA_BUS_TYPE_PCI_IO 0
70 #define ALPHA_BUS_TYPE_PCI_MEM 1
71 #define ALPHA_BUS_TYPE_MAX 1
72
73 #define ALPHA_PCI_CONF_READWRITE 5
74 struct alpha_pci_conf_readwrite_args {
75 int write;
76 u_int bus;
77 u_int device;
78 u_int function;
79 u_int reg;
80 u_int32_t val;
81 };
82
83 #ifdef _KERNEL
84 extern u_int alpha_bus_window_count[];
85 extern int (*alpha_bus_get_window)(int, int,
86 struct alpha_bus_space_translation *);
87 extern struct alpha_pci_chipset *alpha_pci_chipset;
88 #else
89 struct alpha_bus_window {
90 caddr_t abw_addr;
91 size_t abw_size;
92 struct alpha_bus_space_translation abw_abst;
93 };
94
95 int alpha_bus_getwindows(int, struct alpha_bus_window **);
96 int alpha_bus_mapwindow(struct alpha_bus_window *);
97 void alpha_bus_unmapwindow(struct alpha_bus_window *);
98
99 void *alpha_pci_mem_map(bus_addr_t, bus_size_t, int,
100 struct alpha_bus_space_translation *);
101 void alpha_pci_mem_unmap(struct alpha_bus_space_translation *,
102 void *addr, bus_size_t);
103
104 u_int32_t alpha_pci_conf_read(u_int, u_int, u_int, u_int);
105 void alpha_pci_conf_write(u_int, u_int, u_int, u_int, u_int32_t);
106
107 int sysarch(int, void *);
108 #endif /* _KERNEL */
109
110 #endif /* !_ALPHA_SYSARCH_H_ */
111