diff options
Diffstat (limited to 'usr/src/uts/i86pc/sys')
-rw-r--r-- | usr/src/uts/i86pc/sys/acpidev.h | 3 | ||||
-rw-r--r-- | usr/src/uts/i86pc/sys/apic.h | 2 | ||||
-rw-r--r-- | usr/src/uts/i86pc/sys/comm_page.h | 102 | ||||
-rw-r--r-- | usr/src/uts/i86pc/sys/machparam.h | 5 | ||||
-rw-r--r-- | usr/src/uts/i86pc/sys/tsc.h | 28 |
5 files changed, 138 insertions, 2 deletions
diff --git a/usr/src/uts/i86pc/sys/acpidev.h b/usr/src/uts/i86pc/sys/acpidev.h index 6d11277aaf..a3bd54d4e3 100644 --- a/usr/src/uts/i86pc/sys/acpidev.h +++ b/usr/src/uts/i86pc/sys/acpidev.h @@ -21,6 +21,7 @@ /* * Copyright (c) 2009-2010, Intel Corporation. * All rights reserved. + * Copyright (c) 2012, Joyent, Inc. All rights reserved. */ #ifndef _SYS_ACPIDEV_H @@ -128,7 +129,7 @@ typedef enum acpidev_class_id { #ifdef _KERNEL /* Common ACPI object names. */ -#define ACPIDEV_OBJECT_NAME_SB ACPI_NS_SYSTEM_BUS +#define ACPIDEV_OBJECT_NAME_SB METHOD_NAME__SB_ #define ACPIDEV_OBJECT_NAME_PR "_PR_" /* Common ACPI method names. */ diff --git a/usr/src/uts/i86pc/sys/apic.h b/usr/src/uts/i86pc/sys/apic.h index 8a87760456..11ae48340a 100644 --- a/usr/src/uts/i86pc/sys/apic.h +++ b/usr/src/uts/i86pc/sys/apic.h @@ -382,7 +382,7 @@ struct apic_io_intr { /* special or reserve vectors */ #define APIC_CHECK_RESERVE_VECTORS(v) \ (((v) == T_FASTTRAP) || ((v) == APIC_SPUR_INTR) || \ - ((v) == T_SYSCALLINT) || ((v) == T_DTRACE_RET)) + ((v) == T_SYSCALLINT) || ((v) == T_DTRACE_RET) || ((v) == 0x80)) /* cmos shutdown code for BIOS */ #define BIOS_SHUTDOWN 0x0a diff --git a/usr/src/uts/i86pc/sys/comm_page.h b/usr/src/uts/i86pc/sys/comm_page.h new file mode 100644 index 0000000000..dbf00bc7a7 --- /dev/null +++ b/usr/src/uts/i86pc/sys/comm_page.h @@ -0,0 +1,102 @@ +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + */ + +/* + * Copyright 2016 Joyent, Inc. + */ + +#ifndef _COMM_PAGE_H +#define _COMM_PAGE_H + +#ifndef _ASM +#include <sys/types.h> +#include <sys/param.h> +#include <sys/time.h> +#endif /* _ASM */ + +#ifdef __cplusplus +extern "C" { +#endif + +#define COMM_PAGE_SIZE PAGESIZE +#define COMM_PAGE_ALIGN 0x4000 + +#ifndef _ASM + +/* + * x86 comm page + * + * This struct defines the data format for the "comm page": kernel data made + * directly available to userspace for read-only operations. This enables + * facilities such as clock_gettime to operate entirely in userspace without + * the need for a trap or fasttrap. + * + * A note about 32-bit/64-bit compatibility: + * The current format of the comm page is designed to be consistent for both + * 32-bit and 64-bit programs running in a 64-bit kernel. On 32-bit kernels, + * the comm page is not exposed to userspace due to the difference in + * timespec_t sizing. + * + * This struct is instantiated "by hand" in assembly to preserve the global + * symbols it contains. That layout must be kept in sync with the structure + * defined here. + * See: "uts/i86pc/ml/comm_page.s" + */ +typedef struct comm_page_s { + hrtime_t cp_tsc_last; + hrtime_t cp_tsc_hrtime_base; + hrtime_t cp_tsc_resume_cap; + uint32_t cp_tsc_type; + uint32_t cp_tsc_max_delta; + + volatile uint32_t cp_hres_lock; /* must be 8-byte aligned */ + uint32_t cp_nsec_scale; + int64_t cp_hrestime_adj; + hrtime_t cp_hres_last_tick; + uint32_t cp_tsc_ncpu; + uint32_t _cp_pad; + volatile int64_t cp_hrestime[2]; +#if defined(_MACHDEP) + hrtime_t cp_tsc_sync_tick_delta[NCPU]; +#else + /* length resides in cp_ncpu */ + hrtime_t cp_tsc_sync_tick_delta[]; +#endif /* defined(_MACHDEP) */ +} comm_page_t; + +#if defined(_KERNEL) +extern comm_page_t comm_page; + +extern caddr_t comm_page_mapin(); + +#if defined(_MACHDEP) +extern hrtime_t tsc_last; +extern hrtime_t tsc_hrtime_base; +extern hrtime_t tsc_resume_cap; +extern uint32_t tsc_type; +extern uint32_t tsc_max_delta; +extern volatile uint32_t hres_lock; +extern uint32_t nsec_scale; +extern int64_t hrestime_adj; +extern hrtime_t hres_last_tick; +extern uint32_t tsc_ncpu; +extern volatile timestruc_t hrestime; +extern hrtime_t tsc_sync_tick_delta[NCPU]; +#endif /* defined(_MACHDEP) */ +#endif /* defined(_KERNEL) */ + +#endif /* _ASM */ + +#ifdef __cplusplus +} +#endif + +#endif /* _COMM_PAGE_H */ diff --git a/usr/src/uts/i86pc/sys/machparam.h b/usr/src/uts/i86pc/sys/machparam.h index 99ae0d4d3b..fc34522307 100644 --- a/usr/src/uts/i86pc/sys/machparam.h +++ b/usr/src/uts/i86pc/sys/machparam.h @@ -21,6 +21,7 @@ /* * Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015 by Delphix. All rights reserved. + * Copyright 2016 Joyent, Inc. */ /* Copyright (c) 1988 AT&T */ @@ -54,6 +55,10 @@ extern "C" { */ #if defined(__amd64) +/* + * If NCPU grows beyond 256, sizing for the x86 comm page will require + * adjustment. + */ #define NCPU 256 #define NCPU_LOG2 8 #elif defined(__i386) diff --git a/usr/src/uts/i86pc/sys/tsc.h b/usr/src/uts/i86pc/sys/tsc.h new file mode 100644 index 0000000000..d4090381c4 --- /dev/null +++ b/usr/src/uts/i86pc/sys/tsc.h @@ -0,0 +1,28 @@ +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + */ + +/* + * Copyright 2016 Joyent, Inc. + */ + +#ifndef _TSC_H +#define _TSC_H + +/* + * flags to patch tsc_read routine. + */ +#define TSC_NONE 0x0 +#define TSC_RDTSC_CPUID 0x1 +#define TSC_RDTSC_MFENCE 0x2 +#define TSC_RDTSC_LFENCE 0x3 +#define TSC_TSCP 0x4 + +#endif /* _TSC_H */ |