summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/sys
diff options
context:
space:
mode:
authorDan McDonald <danmcd@joyent.com>2020-09-22 10:39:49 -0400
committerDan McDonald <danmcd@joyent.com>2020-09-22 10:39:49 -0400
commit267e12a7d9bf6e5fcefb9cc00f46bfff0dc5226e (patch)
tree19a3941920d0039c35d53a5cbee189b5ca51995a /usr/src/uts/common/sys
parent517abc5c668925e6092495bf332233c3599980d2 (diff)
parente9faba760cdf80d7dfa110fe0830917ab94668c2 (diff)
downloadillumos-joyent-vpc.tar.gz
Merge branch 'master' into vpcvpc
Diffstat (limited to 'usr/src/uts/common/sys')
-rw-r--r--usr/src/uts/common/sys/font.h8
-rw-r--r--usr/src/uts/common/sys/ksensor_impl.h2
-rw-r--r--usr/src/uts/common/sys/mac.h4
-rw-r--r--usr/src/uts/common/sys/sensors.h62
-rw-r--r--usr/src/uts/common/sys/smbios.h38
-rw-r--r--usr/src/uts/common/sys/smbios_impl.h18
-rw-r--r--usr/src/uts/common/sys/socket_proto.h10
-rw-r--r--usr/src/uts/common/sys/time.h27
8 files changed, 128 insertions, 41 deletions
diff --git a/usr/src/uts/common/sys/font.h b/usr/src/uts/common/sys/font.h
index 5733686bf3..f8f154f428 100644
--- a/usr/src/uts/common/sys/font.h
+++ b/usr/src/uts/common/sys/font.h
@@ -84,9 +84,11 @@ typedef struct bitmap_data {
} bitmap_data_t;
typedef enum {
- FONT_AUTO,
- FONT_MANUAL,
- FONT_BOOT
+ FONT_AUTO, /* This font is loaded by software */
+ FONT_MANUAL, /* This font is loaded manually by user */
+ FONT_BOOT, /* This font was passed to kernel by bootloader */
+ FONT_BUILTIN, /* This font was built in at compile time */
+ FONT_RELOAD /* This font is marked to be re-read from file */
} FONT_FLAGS;
struct fontlist {
diff --git a/usr/src/uts/common/sys/ksensor_impl.h b/usr/src/uts/common/sys/ksensor_impl.h
index 8d91973bc3..7407a264a2 100644
--- a/usr/src/uts/common/sys/ksensor_impl.h
+++ b/usr/src/uts/common/sys/ksensor_impl.h
@@ -35,7 +35,7 @@ extern void ksensor_init(void);
* Operations vectors.
*/
extern int ksensor_op_kind(id_t, sensor_ioctl_kind_t *);
-extern int ksensor_op_temperature(id_t, sensor_ioctl_temperature_t *);
+extern int ksensor_op_scalar(id_t, sensor_ioctl_scalar_t *);
/*
* Registration callbacks.
diff --git a/usr/src/uts/common/sys/mac.h b/usr/src/uts/common/sys/mac.h
index a5974f6d7d..bd668cdb6b 100644
--- a/usr/src/uts/common/sys/mac.h
+++ b/usr/src/uts/common/sys/mac.h
@@ -171,6 +171,7 @@ typedef enum {
* Please append properties to the end of this list. Do not reorder the list.
*/
typedef enum {
+ MAC_PROP_PRIVATE = -1,
MAC_PROP_DUPLEX = 0x00000001,
MAC_PROP_SPEED,
MAC_PROP_STATUS,
@@ -248,8 +249,7 @@ typedef enum {
MAC_PROP_ADV_50GFDX_CAP,
MAC_PROP_EN_50GFDX_CAP,
MAC_PROP_EN_FEC_CAP,
- MAC_PROP_ADV_FEC_CAP,
- MAC_PROP_PRIVATE = -1
+ MAC_PROP_ADV_FEC_CAP
} mac_prop_id_t;
/*
diff --git a/usr/src/uts/common/sys/sensors.h b/usr/src/uts/common/sys/sensors.h
index a39dfca239..a5d830a933 100644
--- a/usr/src/uts/common/sys/sensors.h
+++ b/usr/src/uts/common/sys/sensors.h
@@ -33,6 +33,8 @@ extern "C" {
*/
#define SENSOR_KIND_UNKNOWN 0x00
#define SENSOR_KIND_TEMPERATURE 0x01
+#define SENSOR_KIND_VOLTAGE 0x02
+#define SENSOR_KIND_CURRENT 0x03
/*
* Lists of units that senors may have.
@@ -41,52 +43,60 @@ extern "C" {
#define SENSOR_UNIT_CELSIUS 0x01
#define SENSOR_UNIT_FAHRENHEIT 0x02
#define SENSOR_UNIT_KELVIN 0x03
+#define SENSOR_UNIT_VOLTS 0x04
+#define SENSOR_UNIT_AMPS 0x05
#define SENSOR_IOCTL (('s' << 24) | ('e' << 16) | ('n' << 8))
/*
* Ask the sensor what kind of sensor it is.
*/
-#define SENSOR_IOCTL_TYPE (SENSOR_IOCTL | 0x01)
+#define SENSOR_IOCTL_KIND (SENSOR_IOCTL | 0x01)
typedef struct sensor_ioctl_kind {
uint64_t sik_kind;
} sensor_ioctl_kind_t;
/*
- * Ask the sensor for a temperature measurement. The sensor is responsible for
- * returning the units it's in. A temperature measurement is broken down into a
+ * Ask the sensor for a scalar measurement. The sensor is responsible for
+ * returning the units it's in. A scalar measurement is broken down into a
* signed value and a notion of its granularity. The sit_gran member indicates
- * the granularity: the number of increments per degree in the temperature
- * measurement (the sit_temp member). sit_gran is signed and the sign indicates
- * whether one needs to multiply or divide the granularity. For example, a
- * value that set sit_gran to 10 would mean that the value in sit_temp was in
- * 10ths of a degree and that to get the actual value in degrees, one would
- * divide by 10. On the other hand, a negative value means that we effectively
- * have to multiply to get there. For example, a value of -2 would indicate that
- * each value in sit_temp indicated two degrees and to get the temperature in
- * degrees you would multiply sit_temp by two.
+ * the granularity: the number of increments per unit in the measurement (the
+ * sit_value member). sit_gran is signed and the sign indicates whether one
+ * needs to multiply or divide the granularity. The sit_prec member describes a
+ * +/- value (taking sit_gran into account) that describes the precision of the
+ * sensor.
+ *
+ * For example, consider a temperature sensor that set sit_gran to 10. This
+ * would mean that the value in sit_value was in 10ths of a degree and that to
+ * get the actual value in degrees, one would divide by 10. On the other hand, a
+ * negative value means that we effectively have to multiply to get there. For
+ * example, a value of -2 would indicate that each value in sit_value indicated
+ * two degrees and to get the temperature in degrees you would multiply
+ * sit_value * by two.
*/
-#define SENSOR_IOCTL_TEMPERATURE (SENSOR_IOCTL | 0x02)
+#define SENSOR_IOCTL_SCALAR (SENSOR_IOCTL | 0x02)
-typedef struct sensor_ioctl_temperature {
- uint32_t sit_unit;
- int32_t sit_gran;
- uint32_t sit_prec;
- uint32_t sit_pad;
- int64_t sit_temp;
-} sensor_ioctl_temperature_t;
+typedef struct sensor_ioctl_scalar {
+ uint32_t sis_unit;
+ int32_t sis_gran;
+ uint32_t sis_prec;
+ uint32_t sis_pad;
+ int64_t sis_value;
+} sensor_ioctl_scalar_t;
#ifdef _KERNEL
typedef int (*ksensor_kind_f)(void *, sensor_ioctl_kind_t *);
-typedef int (*ksensor_temp_f)(void *, sensor_ioctl_temperature_t *);
+typedef int (*ksensor_scalar_f)(void *, sensor_ioctl_scalar_t *);
typedef struct {
- ksensor_kind_f kso_kind;
- ksensor_temp_f kso_temp;
+ ksensor_kind_f kso_kind;
+ ksensor_scalar_f kso_scalar;
} ksensor_ops_t;
extern int ksensor_kind_temperature(void *, sensor_ioctl_kind_t *);
+extern int ksensor_kind_voltage(void *, sensor_ioctl_kind_t *);
+extern int ksensor_kind_current(void *, sensor_ioctl_kind_t *);
/*
* Create a sensor where the class and name is supplied.
@@ -95,11 +105,11 @@ extern int ksensor_create(dev_info_t *, const ksensor_ops_t *, void *,
const char *, const char *, id_t *);
/*
- * Create a temperature sensor for a PCI device. If this is not a device-wide
+ * Create a scalar sensor for a PCI device. If this is not a device-wide
* (e.g. per-function) sensor, this should not be used.
*/
-extern int ksensor_create_temp_pcidev(dev_info_t *, const ksensor_ops_t *,
- void *, const char *, id_t *);
+extern int ksensor_create_scalar_pcidev(dev_info_t *, uint_t,
+ const ksensor_ops_t *, void *, const char *, id_t *);
/*
* Remove a named or all sensors from this driver.
diff --git a/usr/src/uts/common/sys/smbios.h b/usr/src/uts/common/sys/smbios.h
index 55048d549d..b8b470b79a 100644
--- a/usr/src/uts/common/sys/smbios.h
+++ b/usr/src/uts/common/sys/smbios.h
@@ -22,6 +22,7 @@
/*
* Copyright 2015 OmniTI Computer Consulting, Inc. All rights reserved.
* Copyright (c) 2018, Joyent, Inc.
+ * Copyright 2020 Oxide Computer Company
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -527,6 +528,8 @@ typedef struct smbios_processor {
#define SMB_PRU_BGA1392 0x3A /* Socket BGA1392 */
#define SMB_PRU_BGA1510 0x3B /* Socket BGA1510 */
#define SMB_PRU_BGA1528 0x3C /* Socket BGA1528 */
+#define SMB_PRU_LGA4189 0x3D /* Socket LGA4189 */
+#define SMB_PRU_LGA1200 0x3E /* Socket LGA1200 */
#define SMB_PRC_RESERVED 0x0001 /* reserved */
#define SMB_PRC_UNKNOWN 0x0002 /* unknown */
@@ -944,6 +947,9 @@ typedef struct smbios_slot {
uint8_t smbl_df; /* device/function number */
uint8_t smbl_dbw; /* data bus width */
uint8_t smbl_npeers; /* PCIe bifurcation peers */
+ uint8_t smbl_info; /* slot info */
+ uint8_t smbl_pwidth; /* slot physical width */
+ uint32_t smbl_pitch; /* slot pitch in 10um */
} smbios_slot_t;
#define SMB_SLT_OTHER 0x01 /* other */
@@ -976,8 +982,8 @@ typedef struct smbios_slot {
#define SMB_SLT_MXM_V 0x1C /* MXM Type IV */
#define SMB_SLT_MXM3_A 0x1D /* MXM 3.0 Type A */
#define SMB_SLT_MXM3_B 0x1E /* MXM 3.0 Type B */
-#define SMB_SLT_PCIEG2_SFF 0x1F /* PCI Express Gen 2 SFF-8639 */
-#define SMB_SLT_PCIEG3_SFF 0x20 /* PCI Express Gen 3 SFF-8639 */
+#define SMB_SLT_PCIEG2_SFF 0x1F /* PCI Express Gen 2 SFF-8639 (U.2) */
+#define SMB_SLT_PCIEG3_SFF 0x20 /* PCI Express Gen 3 SFF-8639 (U.2) */
/*
* These lines must be on one line for the string generating code.
*/
@@ -986,6 +992,11 @@ typedef struct smbios_slot {
#define SMB_SLT_PCIE_M52_WOBSKO 0x22 /* PCI Express Mini 52-pin without bottom-side keep-outs */
/* END CSTYLED */
#define SMB_SLT_PCIE_M76 0x23 /* PCI Express Mini 72-pin */
+#define SMB_SLT_PCIEG4_SFF 0x24 /* PCI Express Gen 4 SFF-8639 (U.2) */
+#define SMB_SLT_PCIEG5_SFF 0x25 /* PCI Express Gen 5 SFF-8639 (U.2) */
+#define SMB_SLT_OCP3_SFF 0x26 /* OCP NIC 3.0 Small Form Factor */
+#define SMB_SLT_OCP3_LFF 0x27 /* OCP NIC 3.0 Large Form Factor */
+#define SMB_SLT_OCP_PRE 0x28 /* OCP NIC prior to 3.0 */
#define SMB_SLT_CXL1 0x30 /* CXL Flexbus 1.0 */
#define SMB_SLT_PC98_C20 0xA0 /* PC-98/C20 */
#define SMB_SLT_PC98_C24 0xA1 /* PC-98/C24 */
@@ -1016,6 +1027,15 @@ typedef struct smbios_slot {
#define SMB_SLT_PCIE4G4 0xBB /* PCI Exp. Gen 4 x4 */
#define SMB_SLT_PCIE4G8 0xBC /* PCI Exp. Gen 4 x8 */
#define SMB_SLT_PCIE4G16 0xBD /* PCI Exp. Gen 4 x16 */
+#define SMB_SLT_PCIE5G 0xBE /* PCI Exp. Gen 5 */
+#define SMB_SLT_PCIE5G1 0xBF /* PCI Exp. Gen 5 x1 */
+#define SMB_SLT_PCIE5G2 0xC0 /* PCI Exp. Gen 5 x2 */
+#define SMB_SLT_PCIE5G4 0xC1 /* PCI Exp. Gen 5 x4 */
+#define SMB_SLT_PCIE5G8 0xC2 /* PCI Exp. Gen 5 x8 */
+#define SMB_SLT_PCIE5G16 0xC3 /* PCI Exp. Gen 5 x16 */
+#define SMB_SLT_PCIEG6P 0xC4 /* PCI Exp. Gen 6+ */
+#define SMB_SLT_EDSFF_E1 0xC5 /* Ent. and DC 1U E1 Form Factor */
+#define SMB_SLT_EDSFF_E3 0xC6 /* Ent. and DC 3" E3 Form Factor */
#define SMB_SLW_OTHER 0x01 /* other */
#define SMB_SLW_UNKNOWN 0x02 /* unknown */
@@ -1041,6 +1061,8 @@ typedef struct smbios_slot {
#define SMB_SLL_UNKNOWN 0x02 /* unknown */
#define SMB_SLL_SHORT 0x03 /* short length */
#define SMB_SLL_LONG 0x04 /* long length */
+#define SMB_SLL_2IN5 0x05 /* 2.5" drive form factor */
+#define SMB_SLL_3IN5 0x06 /* 3.5" drive form factor */
#define SMB_SLCH1_UNKNOWN 0x01 /* characteristics unknown */
#define SMB_SLCH1_5V 0x02 /* provides 5.0V */
@@ -1055,6 +1077,9 @@ typedef struct smbios_slot {
#define SMB_SLCH2_HOTPLUG 0x02 /* slot supports hot-plug devices */
#define SMB_SLCH2_SMBUS 0x04 /* slot supports SMBus signal */
#define SMB_SLCH2_BIFUR 0x08 /* slot supports PCIe bifurcation */
+#define SMB_SLCH2_SURPREM 0x10 /* slot supports surprise removal */
+#define SMB_SLCH2_CXL1 0x20 /* Flexbus slot, CXL 1.0 capable */
+#define SMB_SLCH2_CXL2 0x40 /* Flexbus slot, CXL 2.0 capable */
/*
* SMBIOS 7.10.9 Slot Peer Devices
@@ -1178,7 +1203,7 @@ typedef struct smbios_memarray {
#define SMB_MAL_PC98C24 0xA1 /* PC-98/C24 add-on card */
#define SMB_MAL_PC98E 0xA2 /* PC-98/E add-on card */
#define SMB_MAL_PC98LB 0xA3 /* PC-98/Local bus add-on card */
-#define SMB_MAL_CXL1 0xA4 /* CXL Flexbus 1.0 add-on card */
+#define SMB_MAL_CXL1 0xA4 /* CXL add-on card */
#define SMB_MAU_OTHER 0x01 /* other */
#define SMB_MAU_UNKNOWN 0x02 /* unknown */
@@ -1285,6 +1310,8 @@ typedef struct smbios_memdevice {
#define SMB_MDT_LOGNV 0x1F /* Logical non-volatile device */
#define SMB_MDT_HBM 0x20 /* High Bandwidth Memory */
#define SMB_MDT_HBM2 0x21 /* High Bandwidth Memory 2 */
+#define SMB_MDT_DDR5 0x22 /* DDR5 */
+#define SMB_MDT_LPDDR5 0x23 /* LPDDR5 */
#define SMB_MDF_OTHER 0x0002 /* other */
#define SMB_MDF_UNKNOWN 0x0004 /* unknown */
@@ -1313,7 +1340,7 @@ typedef struct smbios_memdevice {
#define SMB_MTECH_NVDIMM_N 0x04 /* NVDIMM-N */
#define SMB_MTECH_NVDIMM_F 0x05 /* NVDIMM-F */
#define SMB_MTECH_NVDIMM_P 0x06 /* NVDIMM-P */
-#define SMB_MTECH_INTCPM 0x07 /* Intel Optane DC Persistent Memory */
+#define SMB_MTECH_INTCPM 0x07 /* Intel Optane persistent memory */
#define SMB_MOMC_RESERVED 0x01 /* reserved */
#define SMB_MOMC_OTHER 0x02 /* other */
@@ -1838,7 +1865,8 @@ typedef struct smbios_memdevice_ext {
#define SMB_VERSION_31 0x0301 /* SMBIOS encoding for DMTF spec 3.1 */
#define SMB_VERSION_32 0x0302 /* SMBIOS encoding for DMTF spec 3.2 */
#define SMB_VERSION_33 0x0303 /* SMBIOS encoding for DMTF spec 3.3 */
-#define SMB_VERSION SMB_VERSION_33 /* SMBIOS latest version definitions */
+#define SMB_VERSION_34 0x0304 /* SMBIOS encoding for DMTF spec 3.4 */
+#define SMB_VERSION SMB_VERSION_34 /* SMBIOS latest version definitions */
#define SMB_O_NOCKSUM 0x1 /* do not verify header checksums */
#define SMB_O_NOVERS 0x2 /* do not verify header versions */
diff --git a/usr/src/uts/common/sys/smbios_impl.h b/usr/src/uts/common/sys/smbios_impl.h
index 69ca79e94f..4b951b702f 100644
--- a/usr/src/uts/common/sys/smbios_impl.h
+++ b/usr/src/uts/common/sys/smbios_impl.h
@@ -22,6 +22,7 @@
/*
* Copyright 2015 OmniTI Computer Consulting, Inc. All rights reserved.
* Copyright (c) 2018, Joyent, Inc.
+ * Copyright 2020 Oxide Computer Company
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -250,9 +251,26 @@ typedef struct smb_slot {
uint8_t smbsl_dbw; /* Data bus width */
uint8_t smbsl_npeers; /* Peer bdf groups */
smb_slot_peer_t smbsl_peers[]; /* bifurcation peers */
+ /* There are later additions in 3.4+, see smbios_slot_cont_t */
} smb_slot_t;
/*
+ * After the variable number of smbsl_peers, the smbios_slot has continued in
+ * size and has the following members defined as of version 3.4. These occur
+ * starting at byte 14 + 5 * smbsl_npeers.
+ */
+typedef struct smb_slot_cont {
+ uint8_t smbsl_info; /* slot info */
+ uint8_t smbsl_pwidth; /* slot physical width */
+ uint16_t smbsl_pitch; /* slot pitch */
+} smb_slot_cont_t;
+
+/*
+ * The first byte that the smb_slot_cont_t is defined to start at.
+ */
+#define SMB_SLOT_CONT_START 0x14
+
+/*
* SMBIOS implementation structure for SMB_TYPE_OBDEVS.
*/
typedef struct smb_obdev {
diff --git a/usr/src/uts/common/sys/socket_proto.h b/usr/src/uts/common/sys/socket_proto.h
index 4e1a4a0f35..825d0501c7 100644
--- a/usr/src/uts/common/sys/socket_proto.h
+++ b/usr/src/uts/common/sys/socket_proto.h
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
+ * Copyright 2020 Joyent, Inc.
*/
#ifndef _SYS_SOCKET_PROTO_H_
@@ -202,7 +203,16 @@ struct sock_upcalls_s {
void (*su_signal_oob)(sock_upper_handle_t, ssize_t);
void (*su_zcopy_notify)(sock_upper_handle_t);
void (*su_set_error)(sock_upper_handle_t, int);
+ /*
+ * NOTE: This function frees upper handle items. Caller cannot
+ * rely on them after this upcall.
+ */
void (*su_closed)(sock_upper_handle_t);
+ /*
+ * NOTE: This function MUST be implemented without using lower-level
+ * downcalls or accesses. This allows callers to ensure su_closed()
+ * upcalls can happen indepdently or concurrently.
+ */
vnode_t *(*su_get_vnode)(sock_upper_handle_t);
};
diff --git a/usr/src/uts/common/sys/time.h b/usr/src/uts/common/sys/time.h
index a69bf4dd63..f6cfa1a7e5 100644
--- a/usr/src/uts/common/sys/time.h
+++ b/usr/src/uts/common/sys/time.h
@@ -16,6 +16,8 @@
*
* Copyright 2013 Nexenta Systems, Inc. All rights reserved.
* Copyright 2016 Joyent, Inc.
+ *
+ * Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
*/
/*
@@ -365,14 +367,14 @@ extern todinfo_t utc_to_tod(time_t);
extern time_t tod_to_utc(todinfo_t);
extern int hr_clock_lock(void);
extern void hr_clock_unlock(int);
-extern hrtime_t gethrtime(void);
-extern hrtime_t gethrtime_unscaled(void);
+extern hrtime_t gethrtime(void);
+extern hrtime_t gethrtime_unscaled(void);
extern hrtime_t gethrtime_max(void);
extern hrtime_t gethrtime_waitfree(void);
extern void scalehrtime(hrtime_t *);
extern uint64_t unscalehrtime(hrtime_t);
-extern void gethrestime(timespec_t *);
-extern time_t gethrestime_sec(void);
+extern void gethrestime(timespec_t *);
+extern time_t gethrestime_sec(void);
extern void gethrestime_lasttick(timespec_t *);
extern void hrt2ts(hrtime_t, timestruc_t *);
extern hrtime_t ts2hrt(const timestruc_t *);
@@ -408,6 +410,7 @@ int futimesat(int, const char *, const struct timeval *);
int getitimer(int, struct itimerval *);
int utimes(const char *, const struct timeval *);
+
#if defined(_XPG4_2)
int setitimer(int, const struct itimerval *_RESTRICT_KYWD,
struct itimerval *_RESTRICT_KYWD);
@@ -418,6 +421,22 @@ int setitimer(int, struct itimerval *_RESTRICT_KYWD,
#endif /* !defined(_KERNEL) ... defined(_XPG4_2) */
+#if !defined(_KERNEL) && !defined(_STRICT_SYMBOLS)
+int futimes(int, const struct timeval *);
+int lutimes(const char *, const struct timeval *);
+
+#define TIMESPEC_TO_TIMEVAL(tv, ts) { \
+ (tv)->tv_sec = (ts)->tv_sec; \
+ (tv)->tv_usec = (ts)->tv_nsec / 1000; \
+}
+
+#define TIMEVAL_TO_TIMESPEC(tv, ts) { \
+ (ts)->tv_sec = (tv)->tv_sec; \
+ (ts)->tv_nsec = (tv)->tv_usec * 1000; \
+}
+
+#endif /* !defined(_KERNEL) && !defined(_STRICT_SYMBOLS) */
+
/*
* gettimeofday() and settimeofday() were included in SVr4 due to their
* common use in BSD based applications. They were to be included exactly