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