diff --git a/usr/src/boot/sys/boot/efi/include/efi.h b/usr/src/boot/sys/boot/efi/include/efi.h index 6815446a2605..b844d16010cd 100644 --- a/usr/src/boot/sys/boot/efi/include/efi.h +++ b/usr/src/boot/sys/boot/efi/include/efi.h @@ -61,4 +61,9 @@ Revision History #include "efipoint.h" #include "efiuga.h" +/* + * illumos UUID + */ +#define ILLUMOS_BOOT_VAR_GUID \ + { 0x8B54B311, 0x7163, 0x40d3, {0xA6, 0x7B, 0xE7, 0xB2, 0x95, 0x1B, 0x3D, 0x56} } #endif diff --git a/usr/src/boot/sys/boot/efi/include/efilib.h b/usr/src/boot/sys/boot/efi/include/efilib.h index e6fd4ee8abb7..d477bf6f1b9f 100644 --- a/usr/src/boot/sys/boot/efi/include/efilib.h +++ b/usr/src/boot/sys/boot/efi/include/efilib.h @@ -1,4 +1,4 @@ -/*- +/* * Copyright (c) 2000 Doug Rabson * Copyright (c) 2006 Marcel Moolenaar * All rights reserved. @@ -106,6 +106,17 @@ int wcscmp(CHAR16 *, CHAR16 *); void cpy8to16(const char *, CHAR16 *, size_t); void cpy16to8(const CHAR16 *, char *, size_t); +/* + * Routines for interacting with EFI's env vars in a more unix-like + * way than the standard APIs. In addition, convenience routines for + * the loader setting / getting illumos specific variables. + */ + +EFI_STATUS efi_illumos_getenv(const char *v, void *data, size_t *len); +EFI_STATUS efi_getenv(EFI_GUID *g, const char *v, void *data, size_t *len); +EFI_STATUS efi_global_getenv(const char *v, void *data, size_t *len); +EFI_STATUS efi_setenv_illumos_wcs(const char *varname, CHAR16 *valstr); + /* guids and names */ bool efi_guid_to_str(const EFI_GUID *, char **); bool efi_str_to_guid(const char *, EFI_GUID *); diff --git a/usr/src/boot/sys/boot/efi/libefi/Makefile b/usr/src/boot/sys/boot/efi/libefi/Makefile index b8b4c5e6d653..0886f0f352d3 100644 --- a/usr/src/boot/sys/boot/efi/libefi/Makefile +++ b/usr/src/boot/sys/boot/efi/libefi/Makefile @@ -30,6 +30,7 @@ SRCS= delay.c \ efi_console.c \ efi_driver_utils.c \ efichar.c \ + efienv.c \ efinet.c \ efipart.c \ efizfs.c \ diff --git a/usr/src/boot/sys/boot/efi/libefi/efienv.c b/usr/src/boot/sys/boot/efi/libefi/efienv.c new file mode 100644 index 000000000000..253d525c1ac0 --- /dev/null +++ b/usr/src/boot/sys/boot/efi/libefi/efienv.c @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2018 Netflix, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include + +#include +#include +#include +#include + +static EFI_GUID illumosBootVarGUID = ILLUMOS_BOOT_VAR_GUID; +static EFI_GUID GlobalBootVarGUID = EFI_GLOBAL_VARIABLE; + +EFI_STATUS +efi_getenv(EFI_GUID *g, const char *v, void *data, size_t *len) +{ + size_t ul; + CHAR16 *uv; + UINT32 attr; + UINTN dl; + EFI_STATUS rv; + + uv = NULL; + if (utf8_to_ucs2(v, &uv, &ul) != 0) + return (EFI_OUT_OF_RESOURCES); + dl = *len; + rv = RS->GetVariable(uv, g, &attr, &dl, data); + if (rv == EFI_SUCCESS) + *len = dl; + free(uv); + return (rv); +} + +EFI_STATUS +efi_global_getenv(const char *v, void *data, size_t *len) +{ + + return (efi_getenv(&GlobalBootVarGUID, v, data, len)); +} + +EFI_STATUS +efi_illumos_getenv(const char *v, void *data, size_t *len) +{ + + return (efi_getenv(&illumosBootVarGUID, v, data, len)); +} + +EFI_STATUS +efi_setenv_illumos_wcs(const char *varname, CHAR16 *valstr) +{ + CHAR16 *var = NULL; + size_t len; + EFI_STATUS rv; + + if (utf8_to_ucs2(varname, &var, &len) != 0) + return (EFI_OUT_OF_RESOURCES); + rv = RS->SetVariable(var, &illumosBootVarGUID, + EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS, + (ucs2len(valstr) + 1) * sizeof (CHAR16), valstr); + free(var); + return (rv); +} diff --git a/usr/src/boot/sys/boot/efi/libefi/env.c b/usr/src/boot/sys/boot/efi/libefi/env.c index 663d343bf374..c43e4b118b03 100644 --- a/usr/src/boot/sys/boot/efi/libefi/env.c +++ b/usr/src/boot/sys/boot/efi/libefi/env.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include /* Partition GUIDS */ #include @@ -46,6 +47,7 @@ static struct efi_uuid_mapping { EFI_GUID efi_guid; } efi_uuid_mapping[] = { { .efi_guid_name = "global", .efi_guid = EFI_GLOBAL_VARIABLE }, + { .efi_guid_name = "illumos", .efi_guid = ILLUMOS_BOOT_VAR_GUID }, /* EFI Systab entry names. */ { .efi_guid_name = "MPS Table", .efi_guid = MPS_TABLE_GUID }, { .efi_guid_name = "ACPI Table", .efi_guid = ACPI_TABLE_GUID }, @@ -102,12 +104,12 @@ static struct efi_uuid_mapping { { .efi_guid_name = "loaded image device path", .efi_guid = EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL_GUID }, { .efi_guid_name = "ISA io", .efi_guid = EFI_ISA_IO_PROTOCOL_GUID }, - { .efi_guid_name = "IDE controller init", + { .efi_guid_name = "IDE controller init", .efi_guid = EFI_IDE_CONTROLLER_INIT_PROTOCOL_GUID }, - { .efi_guid_name = "ISA ACPI", .efi_guid = EFI_ISA_ACPI_PROTOCOL_GUID }, - { .efi_guid_name = "PCI", .efi_guid = EFI_PCI_IO_PROTOCOL_GUID }, - { .efi_guid_name = "PCI root", .efi_guid = EFI_PCI_ROOT_IO_GUID }, - { .efi_guid_name = "PCI enumeration", + { .efi_guid_name = "ISA ACPI", .efi_guid = EFI_ISA_ACPI_PROTOCOL_GUID }, + { .efi_guid_name = "PCI", .efi_guid = EFI_PCI_IO_PROTOCOL_GUID }, + { .efi_guid_name = "PCI root", .efi_guid = EFI_PCI_ROOT_IO_GUID }, + { .efi_guid_name = "PCI enumeration", .efi_guid = EFI_PCI_ENUMERATION_COMPLETE_GUID }, { .efi_guid_name = "Driver diagnostics", .efi_guid = EFI_DRIVER_DIAGNOSTICS_PROTOCOL_GUID }, @@ -443,24 +445,43 @@ efi_print_mem_type(const CHAR16 *varnamearg, uint8_t *data, UINTN datasz) return (CMD_OK); } -/* Print global variables. */ +/* + * Print illumos variables. + * We have LoaderPath and LoaderDev as CHAR16 strings. + */ static int -efi_print_global(const CHAR16 *varnamearg, uint8_t *data, UINTN datasz) +efi_print_illumos(const CHAR16 *varnamearg, uint8_t *data, UINTN datasz) { - int len; int rv = -1; - char *var; + char *var = NULL; + + if (ucs2_to_utf8(varnamearg, &var) != 0) + return (CMD_ERROR); + + if (strcmp("LoaderPath", var) == 0 || + strcmp("LoaderDev", var) == 0) { + printf(" = "); + printf("%S", (CHAR16 *)data); + + if (pager_output("\n")) + rv = CMD_WARN; + else + rv = CMD_OK; + } - for (len = 0; varnamearg[len] != 0; len++) - ; + free(var); + return (rv); +} - if (len == 0) - return (CMD_OK); - len++; +/* Print global variables. */ +static int +efi_print_global(const CHAR16 *varnamearg, uint8_t *data, UINTN datasz) +{ + int rv = -1; + char *var = NULL; - if ((var = malloc(len)) == NULL) + if (ucs2_to_utf8(varnamearg, &var) != 0) return (CMD_ERROR); - cpy16to8(varnamearg, var, len); if (strcmp("AuditMode", var) == 0) { printf(" = "); @@ -667,6 +688,8 @@ efi_print_var(CHAR16 *varnamearg, EFI_GUID *matchguid, int lflag) if (lflag == 0) { if (strcmp(str, "global") == 0) rv = efi_print_global(varnamearg, data, datasz); + else if (strcmp(str, "illumos") == 0) + rv = efi_print_illumos(varnamearg, data, datasz); else if (strcmp(str, EFI_MEMORY_TYPE_INFORMATION_VARIABLE_NAME) == 0) rv = efi_print_mem_type(varnamearg, data, datasz); diff --git a/usr/src/cmd/rcap/rcapd/Makefile b/usr/src/cmd/rcap/rcapd/Makefile index 36d36882f98a..77f4d6812e78 100644 --- a/usr/src/cmd/rcap/rcapd/Makefile +++ b/usr/src/cmd/rcap/rcapd/Makefile @@ -19,45 +19,88 @@ # CDDL HEADER END # # -# Copyright 2009 Sun Microsystems, Inc. All rights reserved. +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -MANIFEST = rcap.xml +include ../../Makefile.cmd +include ../../Makefile.cmd.64 -include ../../Makefile.cmd +.KEEP_STATE: + +PROG = rcapd +ROOTUSRLIBRCAP = $(ROOT)/usr/lib/rcap +ROOTUSRLIBRCAPPROG = $(ROOTUSRLIBRCAP)/$(PROG) -ROOTMANIFESTDIR = $(ROOTSVCSYSTEM) +COMMON_DIR= ../common +MANIFEST = rcap.xml +ROOTMANIFESTDIR = $(ROOTSVCSYSTEM) $(ROOTSVCSYSTEM)/rcap.xml := FILEMODE = 0444 -.KEEP_STATE: -SUBDIRS = $(MACH) -$(BUILD64)SUBDIRS += $(MACH64) +SRCS = rcapd_main.c \ + rcapd_collection.c \ + rcapd_collection_project.c \ + rcapd_collection_zone.c \ + rcapd_mapping.c \ + rcapd_rfd.c \ + rcapd_scanner.c \ + rcapd_stat.c \ + utils.c + +LINTSRCS = rcapd_main.c \ + rcapd_collection.c \ + rcapd_collection_project.c \ + rcapd_collection_zone.c \ + rcapd_mapping.c \ + rcapd_rfd.c \ + rcapd_scanner.c \ + $(COMMON_DIR)/rcapd_stat.c \ + $(COMMON_DIR)/utils.c + +$(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG +CPPFLAGS += -DDEBUG_MSG +CPPFLAGS += -I$(COMMON_DIR) +LDLIBS += -lkstat -lproc -lproject -lzonecfg -lumem -lscf +LDLIBS += $(EXTRA_LDLIBS) + +LINTFLAGS64 += -u + +OBJS = $(SRCS:%.c=%.o) rcapd_conf.o + +POFILES = $(OBJS:%.o=%.po) +POFILE = $(PROG).po + +CLOBBERFILES += $(POFILES) $(POFILE) + +include ../Makefile.com + +.NO_PARALLEL: +.PARALLEL: $(OBJS) -MSGSUBDIRS= $(MACH) +all: $(PROG) -all := TARGET = all -clean := TARGET = clean -clobber := TARGET = clobber -install := TARGET = install -lint := TARGET = lint -_msg := TARGET = _msg +install: all $(ROOTUSRLIBRCAPPROG) $(ROOTUSRLIBRCAP) $(ROOTMANIFEST) -include Makefile.ins +$(PROG): $(OBJS) + $(LINK.c) $(OBJS) -o $@ $(LDLIBS) + $(POST_PROCESS) -all clean clobber lint: $(SUBDIRS) +check: $(CHKMANIFEST) -install: all $(SUBDIRS) $(ROOTMANIFEST) $(ISAEXEC) - -$(RM) $(ROOTUSRLIBRCAPPROG) - $(LN) $(ISAEXEC) $(ROOTUSRLIBRCAPPROG) +clean: + $(RM) $(OBJS) + $(RM) rcapd_conf.c -check: $(CHKMANIFEST) +lint: + $(LINT.c) $(LINTSRCS) $(LDLIBS) -_msg: $(MSGSUBDIRS) +$(POFILE): $(POFILES) + $(RM) $@ + $(CAT) $(POFILES) > $@ -$(SUBDIRS): FRC - @cd $@; pwd; VERSION='$(VERSION)' $(MAKE) $(TARGET) +$(ROOTUSRLIBRCAP)/%: $(ROOTUSRLIBRCAP) % + $(INS.file) -FRC: +include ../../Makefile.targ diff --git a/usr/src/cmd/rcap/rcapd/Makefile.ins b/usr/src/cmd/rcap/rcapd/Makefile.ins deleted file mode 100644 index 97c85e98d8b0..000000000000 --- a/usr/src/cmd/rcap/rcapd/Makefile.ins +++ /dev/null @@ -1,34 +0,0 @@ -# -# CDDL HEADER START -# -# The contents of this file are subject to the terms of the -# Common Development and Distribution License (the "License"). -# You may not use this file except in compliance with the License. -# -# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE -# or http://www.opensolaris.org/os/licensing. -# See the License for the specific language governing permissions -# and limitations under the License. -# -# When distributing Covered Code, include this CDDL HEADER in each -# file and include the License file at usr/src/OPENSOLARIS.LICENSE. -# If applicable, add the following below this CDDL HEADER, with the -# fields enclosed by brackets "[]" replaced with your own identifying -# information: Portions Copyright [yyyy] [name of copyright owner] -# -# CDDL HEADER END -# -# -# Copyright 2007 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# Copyright 2018 Toomas Soome -# - -PROG = rcapd -ROOTUSRLIBRCAP = $(ROOT)/usr/lib/rcap -ROOTUSRLIBRCAP32 = $(ROOTUSRLIBRCAP)/$(MACH32) -ROOTUSRLIBRCAP64 = $(ROOTUSRLIBRCAP)/$(MACH64) -ROOTUSRLIBRCAPPROG = $(ROOTUSRLIBRCAP)/$(PROG) -ROOTUSRLIBRCAPPROG32 = $(ROOTUSRLIBRCAP32)/$(PROG) -ROOTUSRLIBRCAPPROG64 = $(ROOTUSRLIBRCAP64)/$(PROG) diff --git a/usr/src/cmd/rcap/rcapd/Makefile.rcapd b/usr/src/cmd/rcap/rcapd/Makefile.rcapd deleted file mode 100644 index 975ff1388af4..000000000000 --- a/usr/src/cmd/rcap/rcapd/Makefile.rcapd +++ /dev/null @@ -1,106 +0,0 @@ -# -# CDDL HEADER START -# -# The contents of this file are subject to the terms of the -# Common Development and Distribution License (the "License"). -# You may not use this file except in compliance with the License. -# -# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE -# or http://www.opensolaris.org/os/licensing. -# See the License for the specific language governing permissions -# and limitations under the License. -# -# When distributing Covered Code, include this CDDL HEADER in each -# file and include the License file at usr/src/OPENSOLARIS.LICENSE. -# If applicable, add the following below this CDDL HEADER, with the -# fields enclosed by brackets "[]" replaced with your own identifying -# information: Portions Copyright [yyyy] [name of copyright owner] -# -# CDDL HEADER END -# -# -# Copyright 2007 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# - -.KEEP_STATE: -.SUFFIXES: - -# -# subdirs must define COMMON_DIR and include Makefile.com -# - -# For PROG and ROOT* variables -include ../Makefile.ins - -SRCS = rcapd_main.c \ - rcapd_collection.c \ - rcapd_collection_project.c \ - rcapd_collection_zone.c \ - rcapd_mapping.c \ - rcapd_rfd.c \ - rcapd_scanner.c \ - rcapd_stat.c \ - utils.c - -LINTSRCS = ../rcapd_main.c \ - ../rcapd_collection.c \ - ../rcapd_collection_project.c \ - ../rcapd_collection_zone.c \ - ../rcapd_mapping.c \ - ../rcapd_rfd.c \ - ../rcapd_scanner.c \ - $(COMMON_DIR)/rcapd_stat.c \ - $(COMMON_DIR)/utils.c - -$(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG -CPPFLAGS += -DDEBUG_MSG -CPPFLAGS += -I$(COMMON_DIR) -LDLIBS += -lkstat -lproc -lproject -lzonecfg -lumem -lscf -LDLIBS += $(EXTRA_LDLIBS) - -LINTFLAGS += -u -LINTFLAGS64 += -u - -OBJS = $(SRCS:%.c=%.o) rcapd_conf.o - -POFILES = $(OBJS:%.o=%.po) -POFILE = $(PROG).po - -CLOBBERFILES += $(POFILES) $(POFILE) - -.NO_PARALLEL: -.PARALLEL: $(OBJS) - -all: $(PROG) - -$(PROG): $(OBJS) - $(LINK.c) $(OBJS) -o $@ $(LDLIBS) - $(POST_PROCESS) - -%.o: ../%.c - $(COMPILE.c) $< -%.po: ../%.c - $(COMPILE.cpp) $< > $<.i - $(BUILD.po) - - -clean: - $(RM) $(OBJS) - $(RM) rcapd_conf.c - -lint: - $(LINT.c) $(LINTSRCS) $(LDLIBS) - -$(POFILE): $(POFILES) - $(RM) $@ - $(CAT) $(POFILES) > $@ - -$(ROOTUSRLIBRCAP)/%: $(ROOTUSRLIBRCAP) % - $(INS.file) -$(ROOTUSRLIBRCAP32)/%: $(ROOTUSRLIBRCAP32) % - $(INS.file) -$(ROOTUSRLIBRCAP64)/%: $(ROOTUSRLIBRCAP64) % - $(INS.file) - -include ../../../Makefile.targ diff --git a/usr/src/cmd/rcap/rcapd/amd64/Makefile b/usr/src/cmd/rcap/rcapd/amd64/Makefile deleted file mode 100644 index 217cce4e2503..000000000000 --- a/usr/src/cmd/rcap/rcapd/amd64/Makefile +++ /dev/null @@ -1,33 +0,0 @@ -# -# CDDL HEADER START -# -# The contents of this file are subject to the terms of the -# Common Development and Distribution License, Version 1.0 only -# (the "License"). You may not use this file except in compliance -# with the License. -# -# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE -# or http://www.opensolaris.org/os/licensing. -# See the License for the specific language governing permissions -# and limitations under the License. -# -# When distributing Covered Code, include this CDDL HEADER in each -# file and include the License file at usr/src/OPENSOLARIS.LICENSE. -# If applicable, add the following below this CDDL HEADER, with the -# fields enclosed by brackets "[]" replaced with your own identifying -# information: Portions Copyright [yyyy] [name of copyright owner] -# -# CDDL HEADER END -# -# -# Copyright 2004 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# - -include ../../../Makefile.cmd -include ../../../Makefile.cmd.64 -COMMON_DIR= ../../common # for Makefile.com -include ../Makefile.rcapd -include ../../Makefile.com - -install: all $(ROOTUSRLIBRCAPPROG64) $(ROOTUSRLIBRCAP) diff --git a/usr/src/cmd/rcap/rcapd/i386/Makefile b/usr/src/cmd/rcap/rcapd/i386/Makefile deleted file mode 100644 index 1cb37d65f8db..000000000000 --- a/usr/src/cmd/rcap/rcapd/i386/Makefile +++ /dev/null @@ -1,32 +0,0 @@ -# -# CDDL HEADER START -# -# The contents of this file are subject to the terms of the -# Common Development and Distribution License, Version 1.0 only -# (the "License"). You may not use this file except in compliance -# with the License. -# -# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE -# or http://www.opensolaris.org/os/licensing. -# See the License for the specific language governing permissions -# and limitations under the License. -# -# When distributing Covered Code, include this CDDL HEADER in each -# file and include the License file at usr/src/OPENSOLARIS.LICENSE. -# If applicable, add the following below this CDDL HEADER, with the -# fields enclosed by brackets "[]" replaced with your own identifying -# information: Portions Copyright [yyyy] [name of copyright owner] -# -# CDDL HEADER END -# -# -# Copyright 2003 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# - -include ../../../Makefile.cmd -COMMON_DIR= ../../common # for Makefile.com -include ../Makefile.rcapd -include ../../Makefile.com - -install: all $(ROOTUSRLIBRCAPPROG32) $(ROOTUSRLIBRCAP) diff --git a/usr/src/cmd/rcap/rcapd/sparc/Makefile b/usr/src/cmd/rcap/rcapd/sparc/Makefile deleted file mode 100644 index 1cb37d65f8db..000000000000 --- a/usr/src/cmd/rcap/rcapd/sparc/Makefile +++ /dev/null @@ -1,32 +0,0 @@ -# -# CDDL HEADER START -# -# The contents of this file are subject to the terms of the -# Common Development and Distribution License, Version 1.0 only -# (the "License"). You may not use this file except in compliance -# with the License. -# -# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE -# or http://www.opensolaris.org/os/licensing. -# See the License for the specific language governing permissions -# and limitations under the License. -# -# When distributing Covered Code, include this CDDL HEADER in each -# file and include the License file at usr/src/OPENSOLARIS.LICENSE. -# If applicable, add the following below this CDDL HEADER, with the -# fields enclosed by brackets "[]" replaced with your own identifying -# information: Portions Copyright [yyyy] [name of copyright owner] -# -# CDDL HEADER END -# -# -# Copyright 2003 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# - -include ../../../Makefile.cmd -COMMON_DIR= ../../common # for Makefile.com -include ../Makefile.rcapd -include ../../Makefile.com - -install: all $(ROOTUSRLIBRCAPPROG32) $(ROOTUSRLIBRCAP) diff --git a/usr/src/cmd/rcap/rcapd/sparcv9/Makefile b/usr/src/cmd/rcap/rcapd/sparcv9/Makefile deleted file mode 100644 index aedc9bb79389..000000000000 --- a/usr/src/cmd/rcap/rcapd/sparcv9/Makefile +++ /dev/null @@ -1,33 +0,0 @@ -# -# CDDL HEADER START -# -# The contents of this file are subject to the terms of the -# Common Development and Distribution License, Version 1.0 only -# (the "License"). You may not use this file except in compliance -# with the License. -# -# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE -# or http://www.opensolaris.org/os/licensing. -# See the License for the specific language governing permissions -# and limitations under the License. -# -# When distributing Covered Code, include this CDDL HEADER in each -# file and include the License file at usr/src/OPENSOLARIS.LICENSE. -# If applicable, add the following below this CDDL HEADER, with the -# fields enclosed by brackets "[]" replaced with your own identifying -# information: Portions Copyright [yyyy] [name of copyright owner] -# -# CDDL HEADER END -# -# -# Copyright 2003 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# - -include ../../../Makefile.cmd -include ../../../Makefile.cmd.64 -COMMON_DIR= ../../common # for Makefile.com -include ../Makefile.rcapd -include ../../Makefile.com - -install: all $(ROOTUSRLIBRCAPPROG64) $(ROOTUSRLIBRCAP) diff --git a/usr/src/lib/fm/topo/libtopo/common/topo_hc.h b/usr/src/lib/fm/topo/libtopo/common/topo_hc.h index 81492fad3fbd..8d4a4dd2a4cb 100644 --- a/usr/src/lib/fm/topo/libtopo/common/topo_hc.h +++ b/usr/src/lib/fm/topo/libtopo/common/topo_hc.h @@ -21,7 +21,7 @@ /* * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2017, Joyent, Inc. + * Copyright (c) 2018, Joyent, Inc. */ #ifndef _TOPO_HC_H @@ -101,6 +101,7 @@ extern "C" { #define TOPO_PGROUP_IO "io" #define TOPO_IO_DEVTYPE "devtype" #define TOPO_IO_DRIVER "driver" +#define TOPO_IO_INSTANCE "instance" #define TOPO_IO_MODULE "module" #define TOPO_IO_DEV "dev" #define TOPO_IO_DEVID "devid" diff --git a/usr/src/lib/fm/topo/modules/common/pcibus/did_props.c b/usr/src/lib/fm/topo/modules/common/pcibus/did_props.c index 6d900c298981..e216dec9d1b9 100644 --- a/usr/src/lib/fm/topo/modules/common/pcibus/did_props.c +++ b/usr/src/lib/fm/topo/modules/common/pcibus/did_props.c @@ -54,6 +54,8 @@ static int DEVprop_set(tnode_t *, did_t *, const char *, const char *, const char *); static int DRIVERprop_set(tnode_t *, did_t *, const char *, const char *, const char *); +static int INSTprop_set(tnode_t *, did_t *, + const char *, const char *, const char *); static int MODULEprop_set(tnode_t *, did_t *, const char *, const char *, const char *); static int EXCAP_set(tnode_t *, did_t *, @@ -101,6 +103,7 @@ txprop_t Fn_common_props[] = { { DI_DEVTYPPROP, &io_pgroup, TOPO_IO_DEVTYPE, maybe_di_chars_copy }, { DI_DEVIDPROP, &pci_pgroup, TOPO_PCI_DEVID, maybe_di_uint_to_str }, { NULL, &io_pgroup, TOPO_IO_DRIVER, DRIVERprop_set }, + { NULL, &io_pgroup, TOPO_IO_INSTANCE, INSTprop_set }, { NULL, &io_pgroup, TOPO_IO_MODULE, MODULEprop_set }, { "serd_io_device_nonfatal_n", &io_pgroup, "serd_io_device_nonfatal_n", maybe_di_uint_to_dec_str }, @@ -172,6 +175,7 @@ txprop_t Dev_common_props[] = { txprop_t Bus_common_props[] = { { DI_DEVTYPPROP, &io_pgroup, TOPO_IO_DEVTYPE, maybe_di_chars_copy }, { NULL, &io_pgroup, TOPO_IO_DRIVER, DRIVERprop_set }, + { NULL, &io_pgroup, TOPO_IO_INSTANCE, INSTprop_set }, { NULL, &io_pgroup, TOPO_IO_MODULE, MODULEprop_set }, { NULL, &protocol_pgroup, TOPO_PROP_LABEL, label_set }, { NULL, &protocol_pgroup, TOPO_PROP_FRU, FRU_set }, @@ -182,6 +186,7 @@ txprop_t RC_common_props[] = { { NULL, &io_pgroup, TOPO_IO_DEV, DEVprop_set }, { DI_DEVTYPPROP, &io_pgroup, TOPO_IO_DEVTYPE, maybe_di_chars_copy }, { NULL, &io_pgroup, TOPO_IO_DRIVER, DRIVERprop_set }, + { NULL, &io_pgroup, TOPO_IO_INSTANCE, INSTprop_set }, { NULL, &io_pgroup, TOPO_IO_MODULE, MODULEprop_set }, { NULL, &pci_pgroup, TOPO_PCI_EXCAP, EXCAP_set }, { NULL, &pci_pgroup, TOPO_PCI_BDF, BDF_set }, @@ -213,6 +218,7 @@ txprop_t IOB_common_props[] = { txprop_t HB_common_props[] = { { NULL, &io_pgroup, TOPO_IO_DEV, DEVprop_set }, { NULL, &io_pgroup, TOPO_IO_DRIVER, DRIVERprop_set }, + { NULL, &io_pgroup, TOPO_IO_INSTANCE, INSTprop_set }, { NULL, &io_pgroup, TOPO_IO_MODULE, MODULEprop_set }, { NULL, &protocol_pgroup, TOPO_PROP_ASRU, ASRU_set }, /* @@ -776,6 +782,22 @@ DRIVERprop_set(tnode_t *tn, did_t *pd, return (0); } +/*ARGSUSED*/ +static int +INSTprop_set(tnode_t *tn, did_t *pd, + const char *dpnm, const char *tpgrp, const char *tpnm) +{ + int inst, err; + + if ((inst = di_instance(did_dinode(pd))) == -1) + return (0); + if (topo_prop_set_uint32(tn, + tpgrp, tpnm, TOPO_PROP_IMMUTABLE, inst, &err) < 0) + return (topo_mod_seterrno(did_mod(pd), err)); + + return (0); +} + /*ARGSUSED*/ static int MODULEprop_set(tnode_t *tn, did_t *pd, diff --git a/usr/src/pkg/manifests/service-resource-cap.mf b/usr/src/pkg/manifests/service-resource-cap.mf index 49302f476e91..24e7396a7890 100644 --- a/usr/src/pkg/manifests/service-resource-cap.mf +++ b/usr/src/pkg/manifests/service-resource-cap.mf @@ -43,13 +43,11 @@ dir path=usr/share/man/man1 dir path=usr/share/man/man1m file path=lib/svc/manifest/system/rcap.xml group=sys mode=0444 file path=usr/bin/rcapstat mode=0555 -file path=usr/lib/rcap/$(ARCH32)/rcapd mode=0555 -file path=usr/lib/rcap/$(ARCH64)/rcapd mode=0555 +file path=usr/lib/rcap/rcapd mode=0555 file path=usr/sbin/rcapadm mode=0555 file path=usr/share/man/man1/rcapstat.1 file path=usr/share/man/man1m/rcapadm.1m file path=usr/share/man/man1m/rcapd.1m -hardlink path=usr/lib/rcap/rcapd target=../isaexec legacy pkg=SUNWrcapr desc="Solaris Resource Capping Daemon (Root)" \ name="Solaris Resource Capping Daemon (Root)" legacy pkg=SUNWrcapu desc="Solaris Resource Capping Daemon (Usr)" \ diff --git a/usr/src/tools/ctf/cvt/ctfmerge.c b/usr/src/tools/ctf/cvt/ctfmerge.c index 5706cceb1778..1d6d751d9957 100644 --- a/usr/src/tools/ctf/cvt/ctfmerge.c +++ b/usr/src/tools/ctf/cvt/ctfmerge.c @@ -504,9 +504,11 @@ worker_runphase2(workqueue_t *wq) /* * Main loop for worker threads. */ -static void -worker_thread(workqueue_t *wq) +static void * +worker_thread(void *ptr) { + workqueue_t *wq = ptr; + worker_runphase1(wq); debug(2, "%d: entering first barrier\n", pthread_self()); @@ -530,6 +532,7 @@ worker_thread(workqueue_t *wq) debug(2, "%d: phase 1 complete\n", pthread_self()); worker_runphase2(wq); + return (NULL); } /* @@ -692,7 +695,7 @@ start_threads(workqueue_t *wq) for (i = 0; i < wq->wq_nthreads; i++) { pthread_create(&wq->wq_thread[i], NULL, - (void *(*)(void *))worker_thread, wq); + worker_thread, wq); } sigset(SIGINT, handle_sig); diff --git a/usr/src/tools/ctf/cvt/ctftools.h b/usr/src/tools/ctf/cvt/ctftools.h index 708dfd82efd9..79746cba521c 100644 --- a/usr/src/tools/ctf/cvt/ctftools.h +++ b/usr/src/tools/ctf/cvt/ctftools.h @@ -58,11 +58,11 @@ extern "C" { #endif #ifndef MAX -#define MAX(a, b) ((a) < (b) ? (b) : (a)) +#define MAX(a, b) ((a) < (b) ? (b) : (a)) #endif #ifndef MIN -#define MIN(a, b) ((a) > (b) ? (b) : (a)) +#define MIN(a, b) ((a) > (b) ? (b) : (a)) #endif #define TRUE 1 @@ -271,13 +271,13 @@ typedef enum iitype { typedef struct iidesc { iitype_t ii_type; char *ii_name; - tdesc_t *ii_dtype; + tdesc_t *ii_dtype; char *ii_owner; /* File that defined this node */ int ii_flags; /* Function arguments (if any) */ int ii_nargs; - tdesc_t **ii_args; + tdesc_t **ii_args; int ii_vargs; /* Function uses varargs */ } iidesc_t; @@ -358,14 +358,15 @@ void iter_iidescs_by_name(tdata_t *, const char *, iidesc_t *iidesc_dup(iidesc_t *); iidesc_t *iidesc_dup_rename(iidesc_t *, char const *, char const *); void iidesc_add(hash_t *, iidesc_t *); -void iidesc_free(iidesc_t *, void *); +void iidesc_free(iidesc_t *); +void iidesc_free_cb(void *, void *); int iidesc_count_type(void *, void *); void iidesc_stats(hash_t *); int iidesc_dump(iidesc_t *); /* input.c */ typedef enum source_types { - SOURCE_NONE = 0, + SOURCE_NONE = 0, SOURCE_UNKNOWN = 1, SOURCE_C = 2, SOURCE_S = 4 diff --git a/usr/src/tools/ctf/cvt/iidesc.c b/usr/src/tools/ctf/cvt/iidesc.c index b6b9a0c7f235..0d75e3f852d0 100644 --- a/usr/src/tools/ctf/cvt/iidesc.c +++ b/usr/src/tools/ctf/cvt/iidesc.c @@ -23,8 +23,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * Routines for manipulating iidesc_t structures */ @@ -99,7 +97,7 @@ iidesc_add(hash_t *hash, iidesc_t *new) bcopy(new, old, sizeof (*old)); bcopy(&tmp, new, sizeof (*new)); - iidesc_free(new, NULL); + iidesc_free(new); return; } @@ -151,17 +149,22 @@ iidesc_dup_rename(iidesc_t *src, char const *name, char const *owner) /*ARGSUSED*/ void -iidesc_free(iidesc_t *idp, void *private) +iidesc_free_cb(void *ptr, void *private) { - if (idp->ii_name) - free(idp->ii_name); - if (idp->ii_nargs) - free(idp->ii_args); - if (idp->ii_owner) - free(idp->ii_owner); + iidesc_t *idp = ptr; + + free(idp->ii_name); + free(idp->ii_args); + free(idp->ii_owner); free(idp); } +void +iidesc_free(iidesc_t *idp) +{ + iidesc_free_cb(idp, NULL); +} + int iidesc_dump(iidesc_t *ii) { diff --git a/usr/src/tools/ctf/cvt/st_parse.c b/usr/src/tools/ctf/cvt/st_parse.c index 1530734a48c7..03facfd5cb0d 100644 --- a/usr/src/tools/ctf/cvt/st_parse.c +++ b/usr/src/tools/ctf/cvt/st_parse.c @@ -448,7 +448,7 @@ parse_stab(stab_t *stab, char *cp, iidesc_t **iidescp) bzero(&resetbuf, sizeof (resetbuf)); if (rc < 0 || ii->ii_type == II_NOT) { - iidesc_free(ii, NULL); + iidesc_free(ii); return (rc); } diff --git a/usr/src/tools/ctf/cvt/stabs.c b/usr/src/tools/ctf/cvt/stabs.c index f7b3034c6406..53b456585992 100644 --- a/usr/src/tools/ctf/cvt/stabs.c +++ b/usr/src/tools/ctf/cvt/stabs.c @@ -23,8 +23,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * Routines used to read stabs data from a file, and to build a tdata structure * based on the interesting parts of that data. @@ -331,7 +329,7 @@ stabs_read(tdata_t *td, Elf *elf, const char *file) */ if (scope && stab->n_type != N_PSYM) { if (iidescp) - iidesc_free(iidescp, NULL); + iidesc_free(iidescp); goto parse_loop_end; } @@ -356,7 +354,7 @@ stabs_read(tdata_t *td, Elf *elf, const char *file) case II_PSYM: fnarg_add(curfun, iidescp); - iidesc_free(iidescp, NULL); + iidesc_free(iidescp); break; default: aborterr("invalid ii_type %d for stab type %d", diff --git a/usr/src/tools/ctf/cvt/tdata.c b/usr/src/tools/ctf/cvt/tdata.c index 295928586e13..ca71168bcfcd 100644 --- a/usr/src/tools/ctf/cvt/tdata.c +++ b/usr/src/tools/ctf/cvt/tdata.c @@ -246,22 +246,22 @@ static void (*free_cbs[])(tdesc_t *) = { }; /*ARGSUSED1*/ -static int -tdesc_free_cb(tdesc_t *tdp, void *private) +static void +tdesc_free_cb(void *ptr, void *private) { + tdesc_t *tdp = ptr; + if (tdp->t_name) free(tdp->t_name); if (free_cbs[tdp->t_type]) free_cbs[tdp->t_type](tdp); free(tdp); - - return (1); } void tdesc_free(tdesc_t *tdp) { - (void) tdesc_free_cb(tdp, NULL); + tdesc_free_cb(tdp, NULL); } static int @@ -390,8 +390,8 @@ tdata_new(void) void tdata_free(tdata_t *td) { - hash_free(td->td_iihash, (void (*)())iidesc_free, NULL); - hash_free(td->td_layouthash, (void (*)())tdesc_free_cb, NULL); + hash_free(td->td_iihash, iidesc_free_cb, NULL); + hash_free(td->td_layouthash, tdesc_free_cb, NULL); hash_free(td->td_idhash, NULL, NULL); list_free(td->td_fwdlist, NULL, NULL); diff --git a/usr/src/uts/common/io/ldterm.c b/usr/src/uts/common/io/ldterm.c index 6c396db60164..1af97c86ea7f 100644 --- a/usr/src/uts/common/io/ldterm.c +++ b/usr/src/uts/common/io/ldterm.c @@ -22,6 +22,7 @@ * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. * Copyright (c) 2014, Joyent, Inc. All rights reserved. + * Copyright 2018 OmniOS Community Edition (OmniOSce) Association. */ /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ @@ -381,7 +382,7 @@ static struct streamtab ldtrinfo; static struct fmodsw fsw = { "ldterm", &ldtrinfo, - D_MTQPAIR | D_MP + D_MTQPAIR | D_MP | _D_SINGLE_INSTANCE }; static struct modlstrmod modlstrmod = { diff --git a/usr/src/uts/common/io/ptem.c b/usr/src/uts/common/io/ptem.c index 481169daf3dc..e4dc15a3ac4f 100644 --- a/usr/src/uts/common/io/ptem.c +++ b/usr/src/uts/common/io/ptem.c @@ -26,6 +26,7 @@ /* * Copyright 2004 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2018 OmniOS Community Edition (OmniOSce) Association. */ /* @@ -62,7 +63,7 @@ extern struct streamtab pteminfo; static struct fmodsw fsw = { "ptem", &pteminfo, - D_MTQPAIR | D_MP + D_MTQPAIR | D_MP | _D_SINGLE_INSTANCE }; static struct modlstrmod modlstrmod = { diff --git a/usr/src/uts/common/io/ttcompat.c b/usr/src/uts/common/io/ttcompat.c index ab420c82e7e4..22b1442e50fa 100644 --- a/usr/src/uts/common/io/ttcompat.c +++ b/usr/src/uts/common/io/ttcompat.c @@ -21,6 +21,7 @@ /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2018 OmniOS Community Edition (OmniOSce) Association. */ /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ @@ -73,7 +74,7 @@ static struct streamtab ttcoinfo; static struct fmodsw fsw = { "ttcompat", &ttcoinfo, - D_MTQPAIR | D_MP + D_MTQPAIR | D_MP | _D_SINGLE_INSTANCE }; /* diff --git a/usr/src/uts/common/io/usb/clients/hid/hid.c b/usr/src/uts/common/io/usb/clients/hid/hid.c index 249941d03c98..084fa7fedc4b 100644 --- a/usr/src/uts/common/io/usb/clients/hid/hid.c +++ b/usr/src/uts/common/io/usb/clients/hid/hid.c @@ -434,6 +434,7 @@ hid_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) mutex_enter(&hidp->hid_mutex); if (usb_ep_xdescr_fill(USB_EP_XDESCR_CURRENT_VERSION, dip, ep_data, &hidp->hid_ep_intr_xdescr) != USB_SUCCESS) { + mutex_exit(&hidp->hid_mutex); goto fail; } @@ -1072,11 +1073,11 @@ hid_wput(queue_t *q, mblk_t *mp) { hid_state_t *hidp = (hid_state_t *)q->q_ptr; int error = USB_SUCCESS; - struct iocblk *iocbp; + struct iocblk *iocbp; mblk_t *datap; int direction; struct copyresp *crp; - queue_t *tmpq; + queue_t *tmpq; int flag; USB_DPRINTF_L4(PRINT_MASK_ALL, hidp->hid_log_handle, @@ -2576,7 +2577,7 @@ hid_send_async_ctrl_request(hid_default_pipe_arg_t *hid_default_pipe_arg, } ctrl_req->ctrl_bmRequestType = request_type; - ctrl_req->ctrl_bRequest = (uint8_t)request_request; + ctrl_req->ctrl_bRequest = (uint8_t)request_request; ctrl_req->ctrl_wValue = hid_request->hid_req_wValue; ctrl_req->ctrl_wIndex = request_index; ctrl_req->ctrl_wLength = hid_request->hid_req_wLength; diff --git a/usr/src/uts/common/os/streamio.c b/usr/src/uts/common/os/streamio.c index 62569eefed63..509a3cfd40c0 100644 --- a/usr/src/uts/common/os/streamio.c +++ b/usr/src/uts/common/os/streamio.c @@ -25,6 +25,7 @@ /* * Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2017 Joyent, Inc. + * Copyright 2018 OmniOS Community Edition (OmniOSce) Association. */ #include @@ -3783,6 +3784,30 @@ strioctl(struct vnode *vp, int cmd, intptr_t arg, int flag, int copyflag, TRACE_2(TR_FAC_STREAMS_FR, TR_I_PUSH, "I_PUSH:fp %p stp %p", fp, stp); + /* + * If the module is flagged as single-instance, then check + * to see if the module is already pushed. If it is, return + * as if the push was successful. + */ + if (fp->f_qflag & _QSINGLE_INSTANCE) { + queue_t *q; + + claimstr(stp->sd_wrq); + for (q = stp->sd_wrq->q_next; q; q = q->q_next) { + if (q->q_flag & QREADR) { + q = NULL; + break; + } + if (strcmp(mname, Q2NAME(q)) == 0) + break; + } + releasestr(stp->sd_wrq); + if (q != NULL) { + fmodsw_rele(fp); + return (0); + } + } + if (error = strstartplumb(stp, flag, cmd)) { fmodsw_rele(fp); return (error); diff --git a/usr/src/uts/common/os/strsubr.c b/usr/src/uts/common/os/strsubr.c index 87e0c5511d85..8cc27df4ebf1 100644 --- a/usr/src/uts/common/os/strsubr.c +++ b/usr/src/uts/common/os/strsubr.c @@ -26,6 +26,7 @@ * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. * Copyright (c) 2016 by Delphix. All rights reserved. + * Copyright 2018 OmniOS Community Edition (OmniOSce) Association. */ #include @@ -950,7 +951,7 @@ str_sendsig(vnode_t *vp, int event, uchar_t band, int error) */ static void dosendsig(proc_t *proc, int events, int sevent, k_siginfo_t *info, - uchar_t band, int error) + uchar_t band, int error) { ASSERT(MUTEX_HELD(&proc->p_lock)); @@ -2350,7 +2351,7 @@ mux_rmvedge(stdata_t *upstp, int muxid, str_stack_t *ss) */ int devflg_to_qflag(struct streamtab *stp, uint32_t devflag, uint32_t *qflagp, - uint32_t *sqtypep) + uint32_t *sqtypep) { uint32_t qflag = 0; uint32_t sqtype = 0; @@ -2464,6 +2465,17 @@ devflg_to_qflag(struct streamtab *stp, uint32_t devflag, uint32_t *qflagp, qflag |= _QDIRECT; } + /* + * Private flag used to indicate that a streams module should only + * be pushed once. The TTY streams modules have this flag since if + * libc believes itself to be an xpg4 process then it will + * automatically and unconditionally push them when a PTS device is + * opened. If an application is not aware of this then without this + * flag we would end up with duplicate modules. + */ + if (devflag & _D_SINGLE_INSTANCE) + qflag |= _QSINGLE_INSTANCE; + *qflagp = qflag; *sqtypep = sqtype; return (0); @@ -8087,7 +8099,7 @@ strflushrq(vnode_t *vp, int flag) void strsetrputhooks(vnode_t *vp, uint_t flags, - msgfunc_t protofunc, msgfunc_t miscfunc) + msgfunc_t protofunc, msgfunc_t miscfunc) { struct stdata *stp = vp->v_stream; diff --git a/usr/src/uts/common/sys/conf.h b/usr/src/uts/common/sys/conf.h index 7447db408f37..4bf3d5c7e30f 100644 --- a/usr/src/uts/common/sys/conf.h +++ b/usr/src/uts/common/sys/conf.h @@ -24,6 +24,7 @@ /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2018 OmniOS Community Edition (OmniOSce) Association. */ #ifndef _SYS_CONF_H @@ -221,6 +222,8 @@ extern int cdev_prop_op(dev_t, dev_info_t *, ddi_prop_op_t, #define D_OPEN_RETURNS_EINTR 0x100000 /* EINTR expected from open(9E) */ +#define _D_SINGLE_INSTANCE 0x200000 /* Module may only be pushed once */ + #endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */ #ifdef __cplusplus diff --git a/usr/src/uts/common/sys/stream.h b/usr/src/uts/common/sys/stream.h index 4114e5b13e52..7a2f3c9305bc 100644 --- a/usr/src/uts/common/sys/stream.h +++ b/usr/src/uts/common/sys/stream.h @@ -21,6 +21,7 @@ /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2018 OmniOS Community Edition (OmniOSce) Association. */ /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ @@ -189,6 +190,8 @@ typedef struct queue { #define _QASSOCIATED 0x10000000 /* queue is associated with a device */ #define _QDIRECT 0x20000000 /* Private; transport module uses */ /* direct interface to/from sockfs */ +#define _QSINGLE_INSTANCE 0x40000000 /* Private; module may only */ + /* be pushed once */ /* queue sqflags (protected by SQLOCK). */ #define Q_SQQUEUED 0x01 /* Queue is in the syncq list */