2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
4 * Copyright (c) 2001 Jake Burkholder.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 #ifndef _MACHINE_VER_H_
32 #define _MACHINE_VER_H_
34 #define VER_MANUF_SHIFT (48)
35 #define VER_IMPL_SHIFT (32)
36 #define VER_MASK_SHIFT (24)
37 #define VER_MAXTL_SHIFT (8)
38 #define VER_MAXWIN_SHIFT (0)
40 #define VER_MANUF_SIZE (16)
41 #define VER_IMPL_SIZE (16)
42 #define VER_MASK_SIZE (8)
43 #define VER_MAXTL_SIZE (8)
44 #define VER_MAXWIN_SIZE (5)
48 #define VER_MANUF_MASK \
49 (((1UL << VER_MANUF_SIZE) - 1) << VER_MANUF_SHIFT)
50 #define VER_IMPL_MASK \
51 (((1UL << VER_IMPL_SIZE) - 1) << VER_IMPL_SHIFT)
52 #define VER_MASK_MASK \
53 (((1UL << VER_MASK_SIZE) - 1) << VER_MASK_SHIFT)
54 #define VER_MAXTL_MASK \
55 (((1UL << VER_MAXTL_SIZE) - 1) << VER_MAXTL_SHIFT)
56 #define VER_MAXWIN_MASK \
57 (((1UL << VER_MAXWIN_SIZE) - 1) << VER_MAXWIN_SHIFT)
59 #define VER_MANUF(ver) \
60 (((ver) & VER_MANUF_MASK) >> VER_MANUF_SHIFT)
61 #define VER_IMPL(ver) \
62 (((ver) & VER_IMPL_MASK) >> VER_IMPL_SHIFT)
63 #define VER_MASK(ver) \
64 (((ver) & VER_MASK_MASK) >> VER_MASK_SHIFT)
65 #define VER_MAXTL(ver) \
66 (((ver) & VER_MAXTL_MASK) >> VER_MAXTL_SHIFT)
67 #define VER_MAXWIN(ver) \
68 (((ver) & VER_MAXWIN_MASK) >> VER_MAXWIN_SHIFT)
70 extern char sparc64_model[];
74 /* Known implementations */
75 #define CPU_IMPL_SPARC64 0x01
76 #define CPU_IMPL_SPARC64II 0x02
77 #define CPU_IMPL_SPARC64III 0x03
78 #define CPU_IMPL_SPARC64IV 0x04
79 #define CPU_IMPL_SPARC64V 0x05
80 #define CPU_IMPL_SPARC64VI 0x06
81 #define CPU_IMPL_SPARC64VII 0x07
82 #define CPU_IMPL_SPARC64VIIIfx 0x08
83 #define CPU_IMPL_ULTRASPARCI 0x10
84 #define CPU_IMPL_ULTRASPARCII 0x11
85 #define CPU_IMPL_ULTRASPARCIIi 0x12
86 #define CPU_IMPL_ULTRASPARCIIe 0x13
87 #define CPU_IMPL_ULTRASPARCIII 0x14
88 #define CPU_IMPL_ULTRASPARCIIIp 0x15
89 #define CPU_IMPL_ULTRASPARCIIIi 0x16
90 #define CPU_IMPL_ULTRASPARCIV 0x18
91 #define CPU_IMPL_ULTRASPARCIVp 0x19
92 #define CPU_IMPL_ULTRASPARCIIIip 0x22
94 #endif /* !_MACHINE_VER_H_ */