Sync usage with man page.
[netbsd-mini2440.git] / sys / arch / mips / include / types.h
blob71c9338aea4fa6bef0cc57a98b77663920ebc2ba
1 /* $NetBSD: types.h,v 1.44 2009/10/21 21:12:01 rmind Exp $ */
3 /*-
4 * Copyright (c) 1992, 1993
5 * The Regents of the University of California. All rights reserved.
7 * This code is derived from software contributed to Berkeley by
8 * Ralph Campbell.
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. Neither the name of the University nor the names of its contributors
19 * may be used to endorse or promote products derived from this software
20 * without specific prior written permission.
22 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
34 * @(#)types.h 8.3 (Berkeley) 1/5/94
37 #ifndef _MACHTYPES_H_
38 #define _MACHTYPES_H_
40 #include <sys/cdefs.h>
41 #include <sys/featuretest.h>
42 #include <mips/int_types.h>
45 * Note that mips_reg_t is distinct from the register_t defined
46 * in <types.h> to allow these structures to be as hidden from
47 * the rest of the operating system as possible.
51 /* NB: This should probably be if defined(_KERNEL) */
52 #if defined(_NETBSD_SOURCE)
53 #if defined(_MIPS_PADDR_T_64BIT) || defined(_LP64)
54 typedef __uint64_t paddr_t;
55 typedef __uint64_t psize_t;
56 #define PRIxPADDR PRIx64
57 #define PRIxPSIZE PRIx64
58 #define PRIdPSIZE PRId64
59 #else
60 typedef __uint32_t paddr_t;
61 typedef __uint32_t psize_t;
62 #define PRIxPADDR PRIx32
63 #define PRIxPSIZE PRIx32
64 #define PRIdPSIZE PRId32
65 #endif
66 #ifdef _LP64
67 typedef __uint64_t vaddr_t;
68 typedef __uint64_t vsize_t;
69 #define PRIxVADDR PRIx64
70 #define PRIxVSIZE PRIx64
71 #define PRIdVSIZE PRId64
72 #else
73 typedef __uint32_t vaddr_t;
74 typedef __uint32_t vsize_t;
75 #define PRIxVADDR PRIx32
76 #define PRIxVSIZE PRIx32
77 #define PRIdVSIZE PRId32
78 #endif
79 #endif
81 /* Make sure this is signed; we need pointers to be sign-extended. */
82 #if defined(__mips_o64) || defined(__mips_o32)
83 typedef __uint32_t fpregister_t;
84 typedef __uint32_t mips_fpreg_t; /* do not use */
85 #else
86 typedef __uint64_t fpregister_t;
87 typedef __uint64_t mips_fpreg_t; /* do not use */
88 #endif
89 #if defined(__mips_o32)
90 typedef __int32_t register_t;
91 typedef __uint32_t uregister_t;
92 typedef __int32_t mips_reg_t; /* do not use */
93 typedef __uint32_t mips_ureg_t; /* do not use */
94 #define PRIxREGISTER PRIx32
95 #define PRIxUREGISTER PRIx32
96 #else
97 typedef __int64_t register_t;
98 typedef __uint64_t uregister_t;
99 typedef __int64_t mips_reg_t; /* do not use */
100 typedef __uint64_t mips_ureg_t; /* do not use */
101 typedef __int64_t register32_t;
102 typedef __uint64_t uregister32_t;
103 #define PRIxREGISTER PRIx64
104 #define PRIxUREGISTER PRIx64
105 #endif /* __mips_o32 */
107 #if defined(_KERNEL) || defined(_NETBSD_SOURCE)
108 typedef struct label_t {
109 register_t val[14];
110 } label_t;
111 #define _L_S0 0
112 #define _L_S1 1
113 #define _L_S2 2
114 #define _L_S3 3
115 #define _L_S4 4
116 #define _L_S5 5
117 #define _L_S6 6
118 #define _L_S7 7
119 #define _L_GP 8
120 #define _L_SP 9
121 #define _L_S8 10
122 #define _L_RA 11
123 #define _L_SR 12
124 #endif
126 typedef volatile int __cpu_simple_lock_t;
128 #define __SIMPLELOCK_LOCKED 1
129 #define __SIMPLELOCK_UNLOCKED 0
131 #define __HAVE_AST_PERPROC
132 #define __HAVE_SYSCALL_INTERN
133 #define __HAVE_PROCESS_XFPREGS
134 #ifdef MIPS3_PLUS /* XXX bogus! */
135 #define __HAVE_CPU_COUNTER
136 #endif
138 #if !defined(__mips_o32)
139 #define __HAVE_ATOMIC64_OPS
140 #endif
142 #if defined(_KERNEL)
143 #define __HAVE_RAS
144 #endif
146 #endif /* _MACHTYPES_H_ */