3 * This file and its contents are supplied under the terms of the
4 * Common Development and Distribution License ("CDDL"), version 1.0.
5 * You may only use this file in accordance with the terms of version
8 * A full copy of the text of the CDDL should have accompanied this
9 * source. A copy of the CDDL is also available via the Internet at
10 * http://www.illumos.org/license/CDDL.
14 * Copyright 2016 Joyent, Inc.
17 #include <sys/asm_linkage.h>
18 #include <sys/asm_misc.h>
19 #include <sys/param.h>
20 #include <sys/comm_page.h>
26 hrtime_t tsc_resume_cap;
27 hrtime_t tsc_hrtime_base;
28 uint32_t tsc_max_delta;
29 volatile uint32_t hres_lock;
33 hrtime_t hres_last_tick;
35 volatile timestruc_t hrestime;
36 hrtime_t tsc_sync_tick_delta
[NCPU
];
38 comm_page_t comm_page;
40 #else /* defined(_GENCTF) */
47 * This is the definition for the comm page on x86. The purpose of this struct
48 * is to consolidate certain pieces of kernel state into one contiguous section
49 * of memory in order for it to be exposed (read-only) to userspace. The
50 * struct contents are defined by hand so that member variables will maintain
51 * their original symbols for use throughout the rest of the kernel. This
52 * layout must exactly match the C definition of comm_page_t.
53 * See: "uts/i86pc/sys/comm_page.h"
57 DGDEF3
(comm_page
, COMM_PAGE_S_SIZE
, 4096)
60 DGDEF2
(tsc_hrtime_base
, 8)
62 DGDEF2
(tsc_resume_cap
, 8)
65 .fill 1, 4, _CONST(TSC_RDTSC_CPUID)
66 DGDEF2
(tsc_max_delta
, 4);
70 DGDEF2
(nsec_scale
, 4);
72 DGDEF2
(hrestime_adj
, 8)
74 DGDEF2
(hres_last_tick
, 8)
80 DGDEF2
(hrestime
, _MUL
(2, 8))
82 DGDEF2
(tsc_sync_tick_delta
, _MUL
(NCPU
, 8))
83 .fill _CONST(NCPU), 8, 0
85 /* pad out the rest of the page from the struct end */
86 .fill _CONST(COMM_PAGE_SIZE - COMM_PAGE_S_SIZE), 1, 0
88 #endif /* defined(_GENCTF) */