Print this page
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/uts/i86pc/sys/comm_page.h
+++ new/usr/src/uts/i86pc/sys/comm_page.h
1 1 /*
2 2 * This file and its contents are supplied under the terms of the
3 3 * Common Development and Distribution License ("CDDL"), version 1.0.
4 4 * You may only use this file in accordance with the terms of version
5 5 * 1.0 of the CDDL.
6 6 *
7 7 * A full copy of the text of the CDDL should have accompanied this
8 8 * source. A copy of the CDDL is also available via the Internet at
9 9 * http://www.illumos.org/license/CDDL.
10 10 */
11 11
12 12 /*
13 13 * Copyright 2016 Joyent, Inc.
14 14 */
15 15
16 16 #ifndef _COMM_PAGE_H
17 17 #define _COMM_PAGE_H
18 18
19 19 #ifndef _ASM
20 20 #include <sys/types.h>
21 21 #include <sys/param.h>
22 22 #include <sys/time.h>
23 23 #endif /* _ASM */
24 24
25 25 #ifdef __cplusplus
26 26 extern "C" {
27 27 #endif
28 28
29 29 #define COMM_PAGE_SIZE PAGESIZE
30 30 #define COMM_PAGE_ALIGN 0x4000
31 31
32 32 #ifndef _ASM
33 33
34 34 /*
35 35 * x86 comm page
36 36 *
37 37 * This struct defines the data format for the "comm page": kernel data made
38 38 * directly available to userspace for read-only operations. This enables
39 39 * facilities such as clock_gettime to operate entirely in userspace without
40 40 * the need for a trap or fasttrap.
41 41 *
42 42 * A note about 32-bit/64-bit compatibility:
43 43 * The current format of the comm page is designed to be consistent for both
44 44 * 32-bit and 64-bit programs running in a 64-bit kernel. On 32-bit kernels,
45 45 * the comm page is not exposed to userspace due to the difference in
46 46 * timespec_t sizing.
47 47 *
48 48 * This struct is instantiated "by hand" in assembly to preserve the global
49 49 * symbols it contains. That layout must be kept in sync with the structure
50 50 * defined here.
51 51 * See: "uts/i86pc/ml/comm_page.s"
52 52 */
53 53 typedef struct comm_page_s {
54 54 hrtime_t cp_tsc_last;
55 55 hrtime_t cp_tsc_hrtime_base;
56 56 hrtime_t cp_tsc_resume_cap;
57 57 uint32_t cp_tsc_type;
58 58 uint32_t cp_tsc_max_delta;
59 59
60 60 volatile uint32_t cp_hres_lock; /* must be 8-byte aligned */
61 61 uint32_t cp_nsec_scale;
62 62 int64_t cp_hrestime_adj;
63 63 hrtime_t cp_hres_last_tick;
64 64 uint32_t cp_tsc_ncpu;
65 65 uint32_t _cp_pad;
66 66 volatile int64_t cp_hrestime[2];
67 67 #if defined(_MACHDEP)
68 68 hrtime_t cp_tsc_sync_tick_delta[NCPU];
69 69 #else
70 70 /* length resides in cp_ncpu */
71 71 hrtime_t cp_tsc_sync_tick_delta[];
72 72 #endif /* defined(_MACHDEP) */
73 73 } comm_page_t;
74 74
75 75 #if defined(_KERNEL)
76 76 extern comm_page_t comm_page;
77 77
78 78 #if defined(_MACHDEP)
79 79 extern hrtime_t tsc_last;
80 80 extern hrtime_t tsc_hrtime_base;
81 81 extern hrtime_t tsc_resume_cap;
82 82 extern uint32_t tsc_type;
83 83 extern uint32_t tsc_max_delta;
84 84 extern volatile uint32_t hres_lock;
85 85 extern uint32_t nsec_scale;
86 86 extern int64_t hrestime_adj;
87 87 extern hrtime_t hres_last_tick;
88 88 extern uint32_t tsc_ncpu;
89 89 extern volatile timestruc_t hrestime;
90 90 extern hrtime_t tsc_sync_tick_delta[NCPU];
91 91 #endif /* defined(_MACHDEP) */
92 92 #endif /* defined(_KERNEL) */
93 93
94 94 #endif /* _ASM */
95 95
96 96 #ifdef __cplusplus
97 97 }
98 98 #endif
99 99
100 100 #endif /* _COMM_PAGE_H */
|
↓ open down ↓ |
100 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX