Print this page
11844 add rdmsr utility
Reviewed by: Dan McDonald <danmcd@joyent.com>
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/sys/cpuid_drv.h
+++ new/usr/src/uts/common/sys/cpuid_drv.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License, Version 1.0 only
6 6 * (the "License"). You may not use this file except in compliance
7 7 * with the License.
8 8 *
9 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 10 * or http://www.opensolaris.org/os/licensing.
11 11 * See the License for the specific language governing permissions
12 12 * and limitations under the License.
13 13 *
14 14 * When distributing Covered Code, include this CDDL HEADER in each
15 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 16 * If applicable, add the following below this CDDL HEADER, with the
↓ open down ↓ |
16 lines elided |
↑ open up ↑ |
17 17 * fields enclosed by brackets "[]" replaced with your own identifying
18 18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 19 *
20 20 * CDDL HEADER END
21 21 */
22 22 /*
23 23 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
24 24 * Use is subject to license terms.
25 25 */
26 26 /*
27 - * Copyright (c) 2012, Joyent, Inc. All rights reserved.
27 + * Copyright 2019 Joyent, Inc.
28 28 */
29 29
30 30 #ifndef _SYS_CPUID_DRV_H
31 31 #define _SYS_CPUID_DRV_H
32 32
33 33 #include <sys/types.h>
34 34
35 35 #ifdef __cplusplus
36 36 extern "C" {
37 37 #endif
38 38
39 39 /*
40 40 * /dev names:
41 41 * /dev/cpu/ - containing directory
42 42 * self/ - describes current cpu
43 43 * cpuid - cpu identification
44 44 */
45 45
46 46 #define CPUID_DRIVER_NAME "cpuid"
47 47 #define CPUID_DRIVER_SELF_NODE "self"
48 48
49 49 #define CPUID_DIR_NAME "cpu"
50 50 #define CPUID_SELF_DIR_NAME "self"
51 51 #define CPUID_NAME "cpuid"
52 52 #define CPUID_SELF_NAME \
53 53 CPUID_DIR_NAME "/" CPUID_SELF_DIR_NAME "/" CPUID_NAME
54 54
55 55 /*
56 56 * This minor number corresponds to the cpu we're running on at
↓ open down ↓ |
19 lines elided |
↑ open up ↑ |
57 57 * the time we invoke its interfaces.
58 58 */
59 59 #define CPUID_SELF_CPUID_MINOR ((minor_t)0x3fffful)
60 60
61 61 /*
62 62 * ioctl numbers: not an exported interface
63 63 */
64 64 #define CPUID_IOC (('c'<<24)|('i'<<16)|('d'<<8))
65 65
66 66 #define CPUID_GET_HWCAP (CPUID_IOC|0)
67 +#define CPUID_RDMSR (CPUID_IOC|1)
67 68
68 69 struct cpuid_get_hwcap {
69 70 char *cgh_archname;
70 71 uint_t cgh_hwcap[2];
71 72 };
72 73
74 +struct cpuid_rdmsr {
75 + uint64_t cr_msr_nr;
76 + uint64_t cr_msr_val;
77 +};
78 +
73 79 #if defined(_SYSCALL32_IMPL)
74 80
75 81 #include <sys/types32.h>
76 82
77 83 struct cpuid_get_hwcap32 {
78 84 caddr32_t cgh_archname;
79 85 uint32_t cgh_hwcap[2];
80 86 };
81 87
82 88 #endif /* _SYSCALL32_IMPL */
83 89
84 90 #ifdef __cplusplus
85 91 }
86 92 #endif
87 93
88 94 #endif /* _SYS_CPUID_DRV_H */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX