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