sysarch.h revision 1.19 1 1.19 dyoung /* $NetBSD: sysarch.h,v 1.19 2011/08/12 22:22:49 dyoung 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 *
19 1.4 thorpej * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 1.4 thorpej * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 1.4 thorpej * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 1.4 thorpej * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 1.4 thorpej * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 1.4 thorpej * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 1.4 thorpej * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 1.4 thorpej * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 1.4 thorpej * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 1.4 thorpej * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 1.4 thorpej * POSSIBILITY OF SUCH DAMAGE.
30 1.4 thorpej */
31 1.3 ross
32 1.3 ross #ifndef _ALPHA_SYSARCH_H_
33 1.3 ross #define _ALPHA_SYSARCH_H_
34 1.3 ross
35 1.19 dyoung #include <machine/bus_user.h>
36 1.3 ross #include <machine/ieeefp.h>
37 1.1 cgd
38 1.1 cgd /*
39 1.3 ross * Architecture specific syscalls (ALPHA)
40 1.1 cgd */
41 1.1 cgd
42 1.4 thorpej #define ALPHA_FPGETMASK 0
43 1.4 thorpej #define ALPHA_FPSETMASK 1
44 1.4 thorpej #define ALPHA_FPSETSTICKY 2
45 1.17 dyoung #define ALPHA_BUS_GET_WINDOW_COUNT 3
46 1.17 dyoung #define ALPHA_BUS_GET_WINDOW 4
47 1.17 dyoung #define ALPHA_PCI_CONF_READWRITE 5
48 1.8 ross #define ALPHA_FPGETSTICKY 6
49 1.9 thorpej #define ALPHA_GET_FP_C 7
50 1.9 thorpej #define ALPHA_SET_FP_C 8
51 1.7 ross
52 1.3 ross struct alpha_fp_except_args {
53 1.3 ross fp_except mask;
54 1.9 thorpej };
55 1.9 thorpej
56 1.9 thorpej struct alpha_fp_c_args {
57 1.9 thorpej uint64_t fp_c;
58 1.3 ross };
59 1.1 cgd
60 1.4 thorpej struct alpha_bus_get_window_count_args {
61 1.4 thorpej u_int type;
62 1.4 thorpej u_int count; /* output */
63 1.4 thorpej };
64 1.4 thorpej
65 1.4 thorpej struct alpha_bus_get_window_args {
66 1.4 thorpej u_int type;
67 1.4 thorpej u_int window;
68 1.4 thorpej struct alpha_bus_space_translation *translation; /* output */
69 1.4 thorpej };
70 1.4 thorpej
71 1.4 thorpej #define ALPHA_BUS_TYPE_PCI_IO 0
72 1.4 thorpej #define ALPHA_BUS_TYPE_PCI_MEM 1
73 1.4 thorpej #define ALPHA_BUS_TYPE_MAX 1
74 1.4 thorpej
75 1.16 dyoung struct alpha_pci_conf_readwrite_args {
76 1.16 dyoung int write;
77 1.16 dyoung u_int bus;
78 1.16 dyoung u_int device;
79 1.16 dyoung u_int function;
80 1.16 dyoung u_int reg;
81 1.16 dyoung u_int32_t val;
82 1.16 dyoung };
83 1.16 dyoung
84 1.17 dyoung #ifdef _KERNEL
85 1.4 thorpej extern u_int alpha_bus_window_count[];
86 1.5 thorpej extern int (*alpha_bus_get_window)(int, int,
87 1.5 thorpej struct alpha_bus_space_translation *);
88 1.4 thorpej extern struct alpha_pci_chipset *alpha_pci_chipset;
89 1.4 thorpej #else
90 1.10 kleink #include <sys/cdefs.h>
91 1.10 kleink
92 1.17 dyoung struct alpha_bus_window {
93 1.17 dyoung void * abw_addr;
94 1.17 dyoung size_t abw_size;
95 1.17 dyoung struct alpha_bus_space_translation abw_abst;
96 1.17 dyoung };
97 1.17 dyoung
98 1.10 kleink __BEGIN_DECLS
99 1.17 dyoung int alpha_bus_getwindows(int, struct alpha_bus_window **);
100 1.17 dyoung int alpha_bus_mapwindow(struct alpha_bus_window *);
101 1.17 dyoung void alpha_bus_unmapwindow(struct alpha_bus_window *);
102 1.17 dyoung
103 1.17 dyoung void *alpha_pci_mem_map(bus_addr_t, bus_size_t, int,
104 1.17 dyoung struct alpha_bus_space_translation *);
105 1.17 dyoung void alpha_pci_mem_unmap(struct alpha_bus_space_translation *,
106 1.17 dyoung void *addr, bus_size_t);
107 1.17 dyoung
108 1.17 dyoung u_int32_t alpha_pci_conf_read(u_int, u_int, u_int, u_int);
109 1.17 dyoung void alpha_pci_conf_write(u_int, u_int, u_int, u_int, u_int32_t);
110 1.17 dyoung
111 1.5 thorpej int sysarch(int, void *);
112 1.10 kleink __END_DECLS
113 1.4 thorpej #endif /* _KERNEL */
114 1.1 cgd
115 1.3 ross #endif /* !_ALPHA_SYSARCH_H_ */
116