summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/cmd/stat/kstat/kstat.c5
-rw-r--r--usr/src/lib/libbe/common/be_activate.c1
-rw-r--r--usr/src/man/man1m/mount_nfs.1m4
-rw-r--r--usr/src/man/man1m/zpool.1m6
-rw-r--r--usr/src/man/man3c/Makefile3
-rw-r--r--usr/src/man/man3c/atomic_bits.3c13
-rw-r--r--usr/src/man/man3c/ctype.3c22
-rw-r--r--usr/src/man/man3c/mktime.3c57
-rw-r--r--usr/src/man/man3c/string.3c13
-rw-r--r--usr/src/man/man3c/thr_sigsetmask.3c14
-rw-r--r--usr/src/man/man3lib/libnvpair.3lib10
-rw-r--r--usr/src/man/man3nvpair/Makefile2
-rw-r--r--usr/src/man/man3nvpair/nvlist_lookup_nvpair.3nvpair23
-rw-r--r--usr/src/man/man5/mdoc.56
-rw-r--r--usr/src/man/man9e/tran_setup_pkt.9e18
-rw-r--r--usr/src/man/man9e/tran_tgt_init.9e9
-rw-r--r--usr/src/man/man9f/Makefile6
-rw-r--r--usr/src/man/man9f/avl.9f6
-rw-r--r--usr/src/man/man9f/ddi_fm_service_impact.9f10
-rw-r--r--usr/src/man/man9f/string.9f31
-rw-r--r--usr/src/pkg/manifests/driver-network-iprb.mf1
-rw-r--r--usr/src/pkg/manifests/system-header.mf3
-rw-r--r--usr/src/pkg/manifests/system-kernel.man9f.inc2
-rw-r--r--usr/src/pkg/manifests/system-library.man3c.inc1
-rw-r--r--usr/src/pkg/manifests/system-library.man3nvpair.inc2
-rw-r--r--usr/src/uts/common/io/comstar/port/iscsit/iscsit_login.c79
-rw-r--r--usr/src/uts/common/io/mac/mac_protect.c17
-rw-r--r--usr/src/uts/common/sys/Makefile4
-rw-r--r--usr/src/uts/common/sys/scsi/scsi_names.h50
-rw-r--r--usr/src/uts/i86pc/os/acpi_fw.h236
-rw-r--r--usr/src/uts/i86pc/os/biosdisk.c7
-rw-r--r--usr/src/uts/i86pc/os/fakebop.c354
-rw-r--r--usr/src/uts/i86pc/os/lgrpplat.c224
33 files changed, 623 insertions, 616 deletions
diff --git a/usr/src/cmd/stat/kstat/kstat.c b/usr/src/cmd/stat/kstat/kstat.c
index ee95db1c64..e072b5fe2a 100644
--- a/usr/src/cmd/stat/kstat/kstat.c
+++ b/usr/src/cmd/stat/kstat/kstat.c
@@ -23,7 +23,7 @@
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013 David Hoeppner. All rights reserved.
* Copyright 2013 Nexenta Systems, Inc. All rights reserved.
- * Copyright (c) 2013, Joyent, Inc. All rights reserved.
+ * Copyright 2016 Joyent, Inc.
*/
/*
@@ -658,7 +658,6 @@ ks_instances_read(kstat_ctl_t *kc)
offsetof(ks_nvpair_t, nv_next));
SAVE_HRTIME_X(ksi, "crtime", kp->ks_crtime);
- SAVE_HRTIME_X(ksi, "snaptime", kp->ks_snaptime);
if (g_pflg) {
SAVE_STRING_X(ksi, "class", kp->ks_class);
}
@@ -679,6 +678,8 @@ ks_instances_read(kstat_ctl_t *kc)
continue;
}
+ SAVE_HRTIME_X(ksi, "snaptime", kp->ks_snaptime);
+
switch (kp->ks_type) {
case KSTAT_TYPE_RAW:
save_raw(kp, ksi);
diff --git a/usr/src/lib/libbe/common/be_activate.c b/usr/src/lib/libbe/common/be_activate.c
index 416ceef7e2..4843be623b 100644
--- a/usr/src/lib/libbe/common/be_activate.c
+++ b/usr/src/lib/libbe/common/be_activate.c
@@ -900,7 +900,6 @@ be_do_installboot_helper(zpool_handle_t *zphp, nvlist_t *child, char *stage1,
be_print_err(gettext("be_do_installboot: "
"vdev %s is %s, can't install boot loader\n"),
path, zpool_state_to_name(vs->vs_state, vs->vs_aux));
- free(path);
return (BE_SUCCESS);
}
diff --git a/usr/src/man/man1m/mount_nfs.1m b/usr/src/man/man1m/mount_nfs.1m
index e1ed473b4a..63ce0d4805 100644
--- a/usr/src/man/man1m/mount_nfs.1m
+++ b/usr/src/man/man1m/mount_nfs.1m
@@ -5,7 +5,7 @@
.\" 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]
-.TH MOUNT_NFS 1M "Sep 8, 2015"
+.TH MOUNT_NFS 1M "Mar 13, 2016"
.SH NAME
mount_nfs \- mount remote NFS resources
.SH SYNOPSIS
@@ -585,7 +585,7 @@ The server can require authenticated \fBNFS\fR requests from the client.
.ad
.sp .6
.RS 4n
-If the \fBpublic\fR option is specified, or if the \fIresource\fR includes and
+If the \fBpublic\fR option is specified, or if the \fIresource\fR includes an
\fBNFS\fR \fBURL\fR, \fBmount\fR attempts to connect to the server using the
public file handle lookup protocol. See \fIWebNFS Client Specification\fR, RFC
2054. If the server supports the public file handle, the attempt is successful;
diff --git a/usr/src/man/man1m/zpool.1m b/usr/src/man/man1m/zpool.1m
index 9f2db8d946..937406b314 100644
--- a/usr/src/man/man1m/zpool.1m
+++ b/usr/src/man/man1m/zpool.1m
@@ -24,7 +24,7 @@
.\" Copyright (c) 2013 by Delphix. All rights reserved.
.\" Copyright 2016 Nexenta Systems, Inc.
.\"
-.Dd February 15, 2016
+.Dd March 25, 2016
.Dt ZPOOL 1M
.Os
.Sh NAME
@@ -236,8 +236,8 @@ see the
.Sx Intent Log
section.
.It Sy cache
-A device used to cache storage pool data. A cache device cannot be cannot be
-configured as a mirror or raidz group. For more information, see the
+A device used to cache storage pool data. A cache device cannot be configured
+as a mirror or raidz group. For more information, see the
.Sx Cache Devices
section.
.El
diff --git a/usr/src/man/man3c/Makefile b/usr/src/man/man3c/Makefile
index 517fd867d0..049e767a7a 100644
--- a/usr/src/man/man3c/Makefile
+++ b/usr/src/man/man3c/Makefile
@@ -1213,6 +1213,7 @@ MANLINKS= FD_CLR.3c \
thr_setconcurrency.3c \
thr_setprio.3c \
thr_setspecific.3c \
+ timegm.3c \
timer_getoverrun.3c \
timer_gettime.3c \
timerclear.3c \
@@ -2250,6 +2251,8 @@ thr_setspecific.3c := LINKSRC = thr_keycreate.3c
thr_continue.3c := LINKSRC = thr_suspend.3c
+timegm.3c := LINKSRC = mktime.3c
+
timer_getoverrun.3c := LINKSRC = timer_settime.3c
timer_gettime.3c := LINKSRC = timer_settime.3c
diff --git a/usr/src/man/man3c/atomic_bits.3c b/usr/src/man/man3c/atomic_bits.3c
index 41edc51bfe..34ac0a78fa 100644
--- a/usr/src/man/man3c/atomic_bits.3c
+++ b/usr/src/man/man3c/atomic_bits.3c
@@ -3,7 +3,7 @@
.\" 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]
-.TH ATOMIC_BITS 3C "May 13, 2005"
+.TH ATOMIC_BITS 3C "Mar 13, 2016"
.SH NAME
atomic_bits, atomic_set_long_excl, atomic_clear_long_excl \- atomic set and
clear bit operations
@@ -21,7 +21,6 @@ clear bit operations
.fi
.SH DESCRIPTION
-.sp
.LP
The \fBatomic_set_long_excl()\fR and \fBatomic_clear_long_excl()\fR functions
perform an exclusive atomic bit set or clear operation on \fItarget\fR. The
@@ -30,17 +29,14 @@ target. Bits are numbered from zero to one less than the maximum number of bits
in a \fBlong\fR. If the value of bit falls outside of this range, the result of
the operation is undefined.
.SH RETURN VALUES
-.sp
.LP
The \fBatomic_set_long_excl()\fR and \fBatomic_clear_long_excl()\fR functions
return 0 if \fIbit\fR was successfully set or cleared. They return -1 if
\fIbit\fR was already set or cleared.
.SH ERRORS
-.sp
.LP
No errors are defined.
.SH ATTRIBUTES
-.sp
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp
@@ -58,9 +54,8 @@ MT-Level MT-Safe
.TE
.SH SEE ALSO
-.sp
.LP
\fBatomic_add\fR(3C), \fBatomic_and\fR(3C), \fBatomic_cas\fR(3C),
-\fBatomic_dec\fR(3C), \fBatomic_inc\fR(3C), \fBatomic_or\fR(3C),
-\fBatomic_swap\fR(3C), \fBmembar_ops\fR(3C), \fBattributes\fR(5),
-\fBatomic_ops\fR(9F)
+\fBatomic_dec\fR(3C), \fBatomic_inc\fR(3C), \fBatomic_ops\fR(3C),
+\fBatomic_or\fR(3C), \fBatomic_swap\fR(3C), \fBmembar_ops\fR(3C),
+\fBattributes\fR(5)
diff --git a/usr/src/man/man3c/ctype.3c b/usr/src/man/man3c/ctype.3c
index 5d5435f221..f8a0cc044b 100644
--- a/usr/src/man/man3c/ctype.3c
+++ b/usr/src/man/man3c/ctype.3c
@@ -1,5 +1,6 @@
'\" te
.\" Copyright 2014 Garrett D'Amore <garrett@damore.org>
+.\" Copyright 2016 Joyent, Inc.
.\" Copyright 1989 AT&T. Copyright (c) 1992, X/Open Company Limited All Rights Reserved. Portions Copyright (c) 2005, Sun Microsystems, Inc. All Rights Reserved.
.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
.\" http://www.opengroup.org/bookstore/.
@@ -8,12 +9,12 @@
.\" 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]
-.TH CTYPE 3C "Jun 27, 2014"
+.TH CTYPE 3C "Mar 14, 2016"
.SH NAME
ctype, isalpha, isalnum, isascii, isblank, iscntrl, isdigit, islower,
isprint, isspace, isupper, ispunct, isgraph, isxdigit, isalpha_l,
isalnum_l, isblank_l, iscntrl_l, isdigit_l, islower_l, isprint_l,
-isspace_l, isupper_l, ispunct_l, isgraph_l \- character handling
+isspace_l, isupper_l, ispunct_l, isgraph_l isxdigit_l \- character handling
.SH SYNOPSIS
.LP
.nf
@@ -113,6 +114,10 @@ isspace_l, isupper_l, ispunct_l, isgraph_l \- character handling
.nf
\fBint\fR \fBisupper_l\fR(\fBint\fR \fIc\fR, \fBlocale_t\fR \fIloc\fR);
.fi
+.LP
+.nf
+\fBint\fR \fBisxdigit_l\fR(\fBint\fR \fIc\fR, \fBlocale_t\fR \fIloc\fR);
+.fi
.SH DESCRIPTION
.LP
These functions classify character-coded integer values. Each is a
@@ -126,12 +131,12 @@ characters are classified according to the rules of the \fBUS-ASCII\fR
7-bit coded character set.
.LP
The functions \fBisalnum_l()\fR, \fBisalpha_l()\fR, \fBisblank_l()\fR,
-\fBiscntrl_l\fR, \fBisdigit_l()\fR, \fBislower_l()\fR,
-\fBisprint_l()\fR, \fBispunct_l()\fR, \fBisspace_l()\fR,
-\fBisupper_l()\fR, all behave identically to their counterparts without
-the '\fB_l\fR' prefix, except that instead of acting on the current
-locale, that perform the test on the locale specified in the argument
-\fIloc\fR.
+\fBiscntrl_l\fR, \fBisdigit_l()\fR, \fBisgraph_l()\fr,
+\fBislower_l()\fR, \fBisprint_l()\fR, \fBispunct_l()\fR,
+\fBisspace_l()\fR, \fBisupper_l()\fR, and \fBisxdigit_l()\fR all behave
+identically to their counterparts without the '\fB_l\fR' prefix, except
+that instead of acting on the current locale, they perform the test on
+the locale specified in the argument \fIloc\fR.
.LP
The \fBisascii()\fR macro is defined on all integer values. The rest are
defined only where the argument is an \fBint\fR, the value of which is
@@ -294,7 +299,6 @@ the function, the result is undefined. Otherwise, the macro or function returns
non-zero if the classification is \fBTRUE\fR and \fB0\fR if the classification
is \fBFALSE\fR.
.SH ATTRIBUTES
-.sp
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.TS
diff --git a/usr/src/man/man3c/mktime.3c b/usr/src/man/man3c/mktime.3c
index 33ade2440d..e3caabf297 100644
--- a/usr/src/man/man3c/mktime.3c
+++ b/usr/src/man/man3c/mktime.3c
@@ -1,5 +1,6 @@
'\" te
.\" Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved.
+.\" Copyright 2016 Joyent, Inc.
.\" Copyright 1989 AT&T
.\" Portions Copyright (c) 2001, the Institute of Electrical and Electronics Engineers, Inc. and The Open Group. All Rights Reserved.
.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
@@ -9,9 +10,9 @@
.\" 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]
-.TH MKTIME 3C "Nov 1, 2003"
+.TH MKTIME 3C "Mar 14, 2016"
.SH NAME
-mktime \- converts a tm structure to a calendar time
+mktime, timegm \- convert a tm structure to a calendar time
.SH SYNOPSIS
.LP
.nf
@@ -19,9 +20,12 @@ mktime \- converts a tm structure to a calendar time
\fBtime_t\fR \fBmktime\fR(\fBstruct tm *\fR\fItimeptr\fR);
.fi
+.LP
+.nf
+\fBtime_t\fR \fBtimegm\fR(\fBstruct tm *\fR\fItimeptr\fR);
+.fi
.SH DESCRIPTION
-.sp
.LP
The \fBmktime()\fR function converts the time represented by the \fBtm\fR
structure pointed to by \fItimeptr\fR into a calendar time (the number of
@@ -81,17 +85,22 @@ specified time.
.LP
Local timezone information is used as if \fBmktime()\fR had called
\fBtzset()\fR. See \fBctime\fR(3C).
-.SH RETURN VALUES
.sp
.LP
-If the calendar time can be represented in an object of type \fBtime_t\fR,
-\fBmktime()\fR returns the specified calendar time without changing
-\fBerrno\fR. If the calendar time cannot be represented, the function returns
-the value (\fBtime_t\fR)\(mi1 and sets \fBerrno\fR to indicate the error.
+The \fBtimegm()\fR function is identical to the \fBmktime()\fR function,
+except that the \fBtimegm()\fR function ignores both the current time
+zone and the \fBtm_isdst\fR member and operates as though the time zone
+were set to UTC.
+.SH RETURN VALUES
+.LP
+If the calendar time can be represented in an object of type
+\fBtime_t\fR, the \fBmktime()\fR and \fBtimegm()\fR functions return the
+specified calendar time without changing \fBerrno\fR. If the calendar
+time cannot be represented, the function returns the value
+(\fBtime_t\fR)\(mi1 and sets \fBerrno\fR to indicate the error.
.SH ERRORS
-.sp
.LP
-The \fBmktime()\fR function will fail if:
+The \fBmktime()\fR and \fBtimegm()\fR functions will fail if:
.sp
.ne 2
.na
@@ -104,22 +113,23 @@ to the standards specify a different value.
.RE
.SH USAGE
-.sp
.LP
-The \fBmktime()\fR function is MT-Safe in multithreaded applications, as long
-as no user-defined function directly modifies one of the following variables:
-\fBtimezone\fR, \fBaltzone\fR, \fBdaylight\fR, and \fBtzname\fR. See
-\fBctime\fR(3C).
+The \fBmktime()\fR and \fBtimegm()\fR functions are MT-Safe in
+multithreaded applications, as long as no user-defined function directly
+modifies one of the following variables: \fBtimezone\fR, \fBaltzone\fR,
+\fBdaylight\fR, and \fBtzname\fR. See \fBctime\fR(3C).
.sp
.LP
-Note that \(mi1 can be a valid return value for the time that is one second
-before the Epoch. The user should clear \fBerrno\fR before calling
-\fBmktime()\fR. If \fBmktime()\fR then returns \(mi1, the user should check
-\fBerrno\fR to determine whether or not an error actually occurred.
+Note that \(mi1 can be a valid return value for the time that is one
+second before the Epoch. The user should clear \fBerrno\fR before
+calling \fBmktime()\fR and \fBtimegm()\fR. If \fBmktime()\fR or
+\fBtimegm()\fR then returns \(mi1, the user should check \fBerrno\fR to
+determine whether or not an error actually occurred.
.sp
.LP
-The \fBmktime()\fR function assumes Gregorian dates. Times before the adoption
-of the Gregorian calendar will not match historial records.
+The \fBmktime()\fR and \fBtimegm()\fR functions assume Gregorian dates.
+Times before the adoption of the Gregorian calendar will not match
+historial records.
.SH EXAMPLES
.LP
\fBExample 1 \fRSample code using \fBmktime()\fR.
@@ -152,15 +162,13 @@ printf("%s\en", wday[time_str.tm_wday]);
.in -2
.SH BUGS
-.sp
.LP
The \fBzoneinfo\fR timezone data files do not transition past Tue Jan 19
03:14:07 2038 UTC. Therefore for 64-bit applications using \fBzoneinfo\fR
timezones, calculations beyond this date may not use the correct offset from
standard time, and could return incorrect values. This affects the 64-bit
-version of \fBmktime()\fR.
+versions of \fBmktime()\fR and \fBtimegm()\fR.
.SH ATTRIBUTES
-.sp
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp
@@ -178,7 +186,6 @@ MT-Level MT-Safe with exceptions
.TE
.SH SEE ALSO
-.sp
.LP
\fBctime\fR(3C), \fBgetenv\fR(3C), \fBTIMEZONE\fR(4), \fBattributes\fR(5),
\fBstandards\fR(5)
diff --git a/usr/src/man/man3c/string.3c b/usr/src/man/man3c/string.3c
index 882705284d..25207eb151 100644
--- a/usr/src/man/man3c/string.3c
+++ b/usr/src/man/man3c/string.3c
@@ -13,7 +13,7 @@
.\" 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]
-.TH STRING 3C "Sep 14, 2015"
+.TH STRING 3C "Mar 23, 2016"
.SH NAME
string, strcasecmp, strcasecmp_l, strncasecmp, strncasecmp_l, strcat, strncat,
strlcat, strchr, strchrnul, strrchr, strcmp, strncmp, stpcpy, stpncpy, strcpy,
@@ -232,11 +232,12 @@ the current locale, they instead operate in the locale specified by \fIloc\fR.
.LP
The \fBstrcat()\fR function appends a copy of string \fIs2\fR, including the
terminating null character, to the end of string \fIs1\fR. The \fBstrncat()\fR
-function appends at most \fIn\fR characters. Each returns a pointer to the
-null-terminated result. The initial character of \fIs2\fR overrides the null
-character at the end of \fIs1\fR. If copying takes place between objects that
-overlap, the behavior of \fBstrcat()\fR, \fBstrncat()\fR, and \fBstrlcat()\fR
-is undefined.
+function appends at most \fIn\fR characters of \fIs2\fR to \fIs1\fR, not
+including any terminating null character, and then appends a null character.
+Each returns a pointer to the null-terminated result. The initial character of
+\fIs2\fR overrides the null character at the end of \fIs1\fR. If copying takes
+place between objects that overlap, the behavior of \fBstrcat()\fR,
+\fBstrncat()\fR, and \fBstrlcat()\fR is undefined.
.LP
The \fBstrlcat()\fR function appends at most
(\fIdstsize\fR-\fBstrlen\fR(\fIdst\fR)-1) characters of \fIsrc\fR to \fIdst\fR
diff --git a/usr/src/man/man3c/thr_sigsetmask.3c b/usr/src/man/man3c/thr_sigsetmask.3c
index 716bb424eb..9689a5dc0e 100644
--- a/usr/src/man/man3c/thr_sigsetmask.3c
+++ b/usr/src/man/man3c/thr_sigsetmask.3c
@@ -10,7 +10,7 @@
.\" 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]
-.TH THR_SIGSETMASK 3C "Mar 23, 2005"
+.TH THR_SIGSETMASK 3C "Mar 13, 2016"
.SH NAME
thr_sigsetmask \- change or examine calling thread's signal mask
.SH SYNOPSIS
@@ -24,7 +24,6 @@ cc -mt [ \fIflag\fR... ] \fIfile\fR... [ \fIlibrary\fR... ]
.fi
.SH DESCRIPTION
-.sp
.LP
The \fBthr_sigsetmask()\fR function changes or examines a calling thread's
signal mask. Each thread has its own signal mask. A new thread inherits the
@@ -32,7 +31,7 @@ calling thread's signal mask and priority; however, pending signals are not
inherited. Signals pending for a new thread will be empty.
.sp
.LP
-If the value of the argument \fIset\fR is not \fINULL,\fR \fBset\fR points to
+If the value of the argument \fIset\fR is not \fINULL,\fR \fIset\fR points to
a set of signals that can modify the currently blocked set. If the value of
\fIset\fR is \fINULL\fR, the value of \fIhow\fR is insignificant and the
thread's signal mask is unmodified; thus, \fBthr_sigsetmask()\fR can be used to
@@ -68,7 +67,7 @@ from the current signal mask.
.ad
.RS 15n
\fIset\fR corresponds to the new signal mask. The current signal mask is
-replaced by \fBset\fR.
+replaced by \fIset\fR.
.RE
.sp
@@ -76,12 +75,10 @@ replaced by \fBset\fR.
If the value of \fIoset\fR is not \fINULL\fR, it points to the location where
the previous signal mask is stored.
.SH RETURN VALUES
-.sp
.LP
Upon successful completion, the \fBthr_sigsetmask()\fR function returns
\fB0\fR. Otherwise, it returns a non-zero value.
.SH ERRORS
-.sp
.LP
The \fBthr_sigsetmask()\fR function will fail if:
.sp
@@ -290,7 +287,6 @@ thread can be used by passing the argument \fBTHR_DAEMON\fR to
\fBthr_create()\fR.
.SH ATTRIBUTES
-.sp
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp
@@ -306,7 +302,6 @@ MT-Level MT-Safe and Async-Signal-Safe
.TE
.SH SEE ALSO
-.sp
.LP
\fBsigaction\fR(2), \fBsigprocmask\fR(2), \fBsigwait\fR(2),
\fBcond_wait\fR(3C), \fBpthread_cancel\fR(3C), \fBpthread_create\fR(3C),
@@ -314,7 +309,6 @@ MT-Level MT-Safe and Async-Signal-Safe
\fBsigemptyset\fR(3C), \fBsigsetops\fR(3C), \fBsleep\fR(3C),
\fBattributes\fR(5), \fBcancellation\fR(5), \fBstandards\fR(5)
.SH NOTES
-.sp
.LP
It is not possible to block signals that cannot be caught or ignored (see
\fBsigaction\fR(2)). It is also not possible to block or unblock
@@ -334,7 +328,7 @@ blocks waiting for signals, the blocking thread cannot receive a synchronously
generated signal.
.sp
.LP
-Calling the\fBsigprocmask\fR(2) function will be the same as if
+Calling the \fBsigprocmask\fR(2) function will be the same as if
\fBthr_sigsetmask()\fR or \fBpthread_sigmask()\fR has been called. POSIX leaves
the semantics of the call to \fBsigprocmask\fR(2) unspecified in a
multi-threaded process, so programs that care about POSIX portability should
diff --git a/usr/src/man/man3lib/libnvpair.3lib b/usr/src/man/man3lib/libnvpair.3lib
index 947fbf6b48..0279ba94a2 100644
--- a/usr/src/man/man3lib/libnvpair.3lib
+++ b/usr/src/man/man3lib/libnvpair.3lib
@@ -3,7 +3,7 @@
.\" 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]
-.TH LIBNVPAIR 3LIB "Aug 1, 2008"
+.TH LIBNVPAIR 3LIB "Mar 13, 2016"
.SH NAME
libnvpair \- name-value pair library
.SH SYNOPSIS
@@ -14,7 +14,6 @@ cc [ \fIflag\fR... ] \fIfile\fR... \fB-lnvpair\fR [ \fIlibrary\fR... ]
.fi
.SH DESCRIPTION
-.sp
.LP
The \fBlibnvpair\fR library exports a set of functions for managing name-value
pairs.
@@ -97,7 +96,6 @@ Pack an \fBnvlist_t\fR into a contiguous buffer.
Expand a packed nvlist into a searchable \fBnvlist_t\fR.
.RE
.SH INTERFACES
-.sp
.LP
The shared object \fBlibnvpair.so.1\fR provides the public interfaces defined
below. See \fBIntro\fR(3) for additional information on shared object
@@ -122,7 +120,8 @@ l l .
\fBnvlist_add_uint16_array\fR \fBnvlist_add_uint32\fR
\fBnvlist_add_uint32_array\fR \fBnvlist_add_uint64\fR
\fBnvlist_add_uint64_array\fR \fBnvlist_alloc\fR
-\fBnvlist_dup\fR \fBnvlist_exists\fR
+\fBnvlist_dup\fR \fBnvpair_empty\fR
+\fBnvlist_exists\fR
\fBnvlist_free\fR \fBnvlist_lookup_boolean\fR
\fBnvlist_lookup_boolean_value\fR \fBnvlist_lookup_boolean_array\fR
\fBnvlist_lookup_byte\fR \fBnvlist_lookup_byte_array\fR
@@ -162,7 +161,6 @@ l l .
.TE
.SH FILES
-.sp
.ne 2
.na
\fB\fB/lib/libnvpair.so.1\fR\fR
@@ -181,7 +179,6 @@ shared object
.RE
.SH ATTRIBUTES
-.sp
.LP
See \fBattributes\fR(5) for description of the following attributes:
.sp
@@ -199,6 +196,5 @@ MT-Level MT-Safe
.TE
.SH SEE ALSO
-.sp
.LP
\fBIntro\fR(3), \fBattributes\fR(5)
diff --git a/usr/src/man/man3nvpair/Makefile b/usr/src/man/man3nvpair/Makefile
index 3cdd21e34d..9366fcc54b 100644
--- a/usr/src/man/man3nvpair/Makefile
+++ b/usr/src/man/man3nvpair/Makefile
@@ -56,6 +56,7 @@ MANLINKS= nv_alloc_fini.3nvpair \
nvlist_add_uint8.3nvpair \
nvlist_add_uint8_array.3nvpair \
nvlist_dup.3nvpair \
+ nvlist_empty.3nvpair \
nvlist_exists.3nvpair \
nvlist_free.3nvpair \
nvlist_lookup_boolean_array.3nvpair \
@@ -190,6 +191,7 @@ nvlist_lookup_uint64_array.3nvpair := LINKSRC = nvlist_lookup_boolean.3nvpair
nvlist_lookup_uint8.3nvpair := LINKSRC = nvlist_lookup_boolean.3nvpair
nvlist_lookup_uint8_array.3nvpair := LINKSRC = nvlist_lookup_boolean.3nvpair
+nvlist_empty.3nvpair := LINKSRC = nvlist_lookup_nvpair.3nvpair
nvlist_exists.3nvpair := LINKSRC = nvlist_lookup_nvpair.3nvpair
nvpair_name.3nvpair := LINKSRC = nvlist_next_nvpair.3nvpair
diff --git a/usr/src/man/man3nvpair/nvlist_lookup_nvpair.3nvpair b/usr/src/man/man3nvpair/nvlist_lookup_nvpair.3nvpair
index f83435a51c..05799bf2a2 100644
--- a/usr/src/man/man3nvpair/nvlist_lookup_nvpair.3nvpair
+++ b/usr/src/man/man3nvpair/nvlist_lookup_nvpair.3nvpair
@@ -1,11 +1,12 @@
'\" te
.\" Copyright (c) 2007, Sun Microsystems Inc. All Rights Reserved.
+.\" Copyright 2016 Joyent, Inc.
.\" 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]
-.TH NVLIST_LOOKUP_NVPAIR 3NVPAIR "Oct 24, 2007"
+.TH NVLIST_LOOKUP_NVPAIR 3NVPAIR "Mar 13, 2016"
.SH NAME
-nvlist_lookup_nvpair, nvlist_exists \- lookup named pairs
+nvlist_lookup_nvpair, nvlist_exists, nvlist_empty \- lookup named pairs
.SH SYNOPSIS
.LP
.nf
@@ -21,8 +22,12 @@ nvlist_lookup_nvpair, nvlist_exists \- lookup named pairs
\fBboolean_t\fR \fBnvlist_exists\fR(\fBnvlist_t *\fR\fInvl\fR, \fBconst char *\fR\fIname\fR);
.fi
+.LP
+.nf
+\fBboolean_t\fR \fBnvlist_empty\fR(\fBnvlist_t *\fR\fInvl\fR);
+.fi
+
.SH DESCRIPTION
-.sp
.LP
The \fBnvlist_lookup_nvpair()\fR function returns the nvpair with the matching
name, regardless of type. It is valid only for lists allocated with
@@ -31,18 +36,24 @@ name, regardless of type. It is valid only for lists allocated with
.LP
The \fBnvlist_exists()\fR function returns success if any nvpair exists with
the given name. It is valid for all types of lists.
-.SH RETURN VALUES
.sp
.LP
+The \fBnvlist_empty()\fR function returns success if the list \fInvl\fR
+contains no nvpairs. It is valid for all types of lists.
+.SH RETURN VALUES
+.LP
The \fBnvlist_lookup_nvpair()\fR function returns 0 on success and an error
value on failure.
.sp
.LP
The \fBnvlist_exists()\fR function returns \fBB_TRUE\fR if an nvpair with the
given name exists and \fBB_FALSE\fR otherwise.
-.SH ERRORS
.sp
.LP
+The \fBnvlist_empty()\fR function returns \fBB_TRUE\fR if the given
+list, \fInvl\fR, contains no nvpairs and \fBB_FALSE\fR otherwise.
+.SH ERRORS
+.LP
The \fBnvlist_lookup_nvpair()\fR function will fail if:
.sp
.ne 2
@@ -72,7 +83,6 @@ The list was not allocated with \fBNV_UNIQUE_NAME\fR.
.RE
.SH ATTRIBUTES
-.sp
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp
@@ -90,7 +100,6 @@ MT-Level MT-Safe
.TE
.SH SEE ALSO
-.sp
.LP
\fBlibnvpair\fR(3LIB), \fBnvlist_alloc\fR(3NVPAIR), \fBattributes\fR(5),
\fBnvlist_lookup_nvpair\fR(9F)
diff --git a/usr/src/man/man5/mdoc.5 b/usr/src/man/man5/mdoc.5
index a981edd5ff..5be6dfb4a8 100644
--- a/usr/src/man/man5/mdoc.5
+++ b/usr/src/man/man5/mdoc.5
@@ -19,7 +19,7 @@
.\" Copyright 2014 Garrett D'Amore <garrett@dmaore.org>
.\" Copyright 2015 Nexenta Systems, Inc. All rights reserved.
.\"
-.Dd Oct 18, 2015
+.Dd Mar 13, 2016
.Dt MDOC 5
.Os
.Sh NAME
@@ -487,11 +487,11 @@ Indicates that the library is safe for use within a signal handler. An
interface can be made
.Nm Async-Signal-Safe
by ensuring that it blocks signals when acquiring locks.
-.It Nm Safe with Exections
+.It Nm Safe with Exceptions
As for
.Nm Safe
but with specific exceptions noted.
-.It Nm MT-Safe with Exections
+.It Nm MT-Safe with Exceptions
As for
.Nm MT-Safe
but with specific exceptions noted.
diff --git a/usr/src/man/man9e/tran_setup_pkt.9e b/usr/src/man/man9e/tran_setup_pkt.9e
index c839c1624c..04628358e2 100644
--- a/usr/src/man/man9e/tran_setup_pkt.9e
+++ b/usr/src/man/man9e/tran_setup_pkt.9e
@@ -3,7 +3,7 @@
.\" 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]
-.TH TRAN_SETUP_PKT 9E "Jan 29, 2009"
+.TH TRAN_SETUP_PKT 9E "Mar 13, 2016"
.SH NAME
tran_setup_pkt, tran_teardown_pkt, tran_pkt_constructor, tran_pkt_destructor \-
SCSI HBA packet allocation and deallocation
@@ -12,7 +12,7 @@ SCSI HBA packet allocation and deallocation
.nf
#include <sys/scsi/scsi.h>
-\fBstruct scsi_pkt *\fR\fBprefix_tran_setup_pkt\fR(\fBstruct scsi_pkt *\fR\fIpkt\fR,
+\fBint \fR\fBprefix_tran_setup_pkt\fR(\fBstruct scsi_pkt *\fR\fIpkt\fR,
\fBint (*\fR\fIcallback\fR) (\fIcaddr_t\fR), \fBcaddr_t\fR \fIarg\fR);
.fi
@@ -34,11 +34,9 @@ SCSI HBA packet allocation and deallocation
.fi
.SH INTERFACE LEVEL
-.sp
.LP
Solaris architecture specific (Solaris DDI).
.SH PARAMETERS
-.sp
.ne 2
.na
\fB\fIpkt\fR\fR
@@ -84,7 +82,6 @@ Either \fBKM_SLEEP\fR or \fBKM_NOSLEEP\fR.
.RE
.SH DESCRIPTION
-.sp
.LP
The \fBtran_setup_pkt()\fR and \fBtran_destroy_pkt()\fR vectors in the
\fBscsi_hba_tran\fR(9S) structure are alternatives to the \fBtran_init_pkt()\fR
@@ -92,7 +89,6 @@ and \fBtran_destroy_pkt()\fR entry points. They are initialized during the
\fBHBA\fR driver's \fBattach\fR(9E) and they are used when a target driver
calls \fBscsi_init_pkt\fR(9F) and \fBscsi_destroy_pkt\fR(9F).
.SS "tran_setup_pkt(\|)"
-.sp
.LP
The \fBtran_setup_pkt()\fR vector is the entry point into the \fBHBA\fR which
is used to initialize \fBHBA\fR specific information in a \fBscsi_pkt\fR
@@ -119,8 +115,8 @@ pointed to by \fBpkt_private\fR, allocated on behalf of the SCSI target driver.
The \fBpkt_scblen\fR field contains the length of the SCSI status completion
block pointed to by \fBpkt_scbp\fR. If the status length is greater than or
equal to sizeof (\fBstruct\fR \fBscsi_arq_status\fR) and the
-\fBauto_rqsensecapability\fR has been set, automatic request sense (\fBARS\fR)
-is enabled for this packet. If the status \fBlengthislessthansizeof\fR
+\fBauto-rqsense\fR capability has been set, automatic request sense (\fBARS\fR)
+is enabled for this packet. If the status length is less than \fBsizeof\fR
(\fBstruct\fR \fBscsi_arq_status\fR), automatic request sense should be
disabled for this pkt if the \fBHBA\fR driver is capable of disabling \fBARQ\fR
on a per-packet basis.
@@ -138,7 +134,7 @@ when resources are not available:
\fB\fBNULL_FUNC\fR\fR
.ad
.RS 14n
-Do not wait for resources. Return a \fINULL\fR pointer.
+Do not wait for resources. Return \fB-1\fR when resources are not available.
.RE
.sp
@@ -151,13 +147,11 @@ Wait indefinitely for resources.
.RE
.SS "tran_teardown_pkt(\|)"
-.sp
.LP
The \fBtran_teardown_pkt()\fR is the entry point into the \fBHBA\fR that must
free all of the resources that were allocated to the \fBscsi_pkt\fR(9S)
structure during \fBtran_setup_pkt()\fR.
.SS "tran_pkt_constructor(\|) tran_pkt_destructor(\|)"
-.sp
.LP
When using \fBtran_pkt_setup()\fR and \fBtran_pkt_teardown()\fR,
\fBtran_pkt_constructor()\fR and \fBtran_pkt_destructor()\fR are additional
@@ -225,11 +219,9 @@ HBA drivers that implement \fBtran_setup_pkt()\fR must signal
use of the \fBscsi_pkt\fR \fIpkt_comp\fR field is not permitted and results in
undefined behavior.
.SH RETURN VALUES
-.sp
.LP
\fBtran_setup_pkt()\fR must return zero on success, and \fB-1\fR on failure.
.SH SEE ALSO
-.sp
.LP
\fBattach\fR(9E), \fBtran_sync_pkt\fR(9E), \fBbioerror\fR(9F),
\fBddi_dma_buf_bind_handle\fR(9F), \fBkmem_cache_create\fR(9F),
diff --git a/usr/src/man/man9e/tran_tgt_init.9e b/usr/src/man/man9e/tran_tgt_init.9e
index 0100cd0f3e..12c358785c 100644
--- a/usr/src/man/man9e/tran_tgt_init.9e
+++ b/usr/src/man/man9e/tran_tgt_init.9e
@@ -3,7 +3,7 @@
.\" 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]
-.TH TRAN_TGT_INIT 9E "Nov 1, 1993"
+.TH TRAN_TGT_INIT 9E "Mar 13, 2016"
.SH NAME
tran_tgt_init \- request to initialize HBA resources on behalf of a particular
target
@@ -14,16 +14,14 @@ target
-\fBvoid prefix\fR\fBtran_tgt_init\fR(\fBdev_info_t *\fR\fIhba_dip\fR, \fBdev_info_t *\fR\fItgt_dip\fR,
+\fBint prefix\fR\fBtran_tgt_init\fR(\fBdev_info_t *\fR\fIhba_dip\fR, \fBdev_info_t *\fR\fItgt_dip\fR,
\fBscsi_hba_tran_t *\fR\fIhba_tran\fR, \fBstruct scsi_device *\fR\fIsd\fR);
.fi
.SH INTERFACE LEVEL
-.sp
.LP
Solaris architecture specific (Solaris DDI).
.SH PARAMETERS
-.sp
.ne 2
.na
\fB\fIhba_dip\fR \fR
@@ -63,7 +61,6 @@ Pointer to a \fBscsi_device\fR(9S) structure, describing the target.
.RE
.SH DESCRIPTION
-.sp
.LP
The \fBtran_tgt_init()\fR vector in the \fBscsi_hba_tran\fR(9S) structure may
be initialized during the \fBHBA\fR driver's \fBattach\fR(9E) to point to an
@@ -84,7 +81,6 @@ initialize the \fItran_tgt_private\fR field in the structure pointed to by
\fIhba_tran\fR, to point to the data specific to the particular target device
instance.
.SH RETURN VALUES
-.sp
.LP
\fBtran_tgt_init()\fR must return:
.sp
@@ -110,7 +106,6 @@ instance of the target device will not be continued, the target driver's
.RE
.SH SEE ALSO
-.sp
.LP
\fBattach\fR(9E), \fBprobe\fR(9E), \fBtran_tgt_free\fR(9E),
\fBtran_tgt_probe\fR(9E), \fBscsi_hba_attach_setup\fR(9F),
diff --git a/usr/src/man/man9f/Makefile b/usr/src/man/man9f/Makefile
index 9c45ac55f6..066f5373f6 100644
--- a/usr/src/man/man9f/Makefile
+++ b/usr/src/man/man9f/Makefile
@@ -13,7 +13,7 @@
# Copyright 2011, Richard Lowe
# Copyright 2013 Nexenta Systems, Inc. All rights reserved.
# Copyright 2014 Garrett D'Amore <garrett@damore>
-# Copyright (c) 2015 Joyent, Inc. All rights reserved.
+# Copyright 2016 Joyent, Inc.
#
include $(SRC)/Makefile.master
@@ -643,6 +643,7 @@ MANLINKS= SIZEOF_PTR.9f \
avl_last.9f \
avl_nearest.9f \
avl_numnodes.9f \
+ avl_remove.9f \
avl_swap.9f \
AVL_NEXT.9f \
AVL_PREV.9f \
@@ -1132,6 +1133,7 @@ MANLINKS= SIZEOF_PTR.9f \
sema_tryp.9f \
sema_v.9f \
strcasecmp.9f \
+ strcat.9f \
strchr.9f \
strcmp.9f \
strcpy.9f \
@@ -1333,6 +1335,7 @@ avl_is_empty.9f := LINKSRC = avl.9f
avl_last.9f := LINKSRC = avl.9f
avl_nearest.9f := LINKSRC = avl.9f
avl_numnodes.9f := LINKSRC = avl.9f
+avl_remove.9f := LINKSRC = avl.9f
avl_swap.9f := LINKSRC = avl.9f
AVL_NEXT.9f := LINKSRC = avl.9f
AVL_PREV.9f := LINKSRC = avl.9f
@@ -1951,6 +1954,7 @@ numtos.9f := LINKSRC = stoi.9f
ddi_strdup.9f := LINKSRC = string.9f
strcasecmp.9f := LINKSRC = string.9f
+strcat.9f := LINKSRC = string.9f
strchr.9f := LINKSRC = string.9f
strcmp.9f := LINKSRC = string.9f
strcpy.9f := LINKSRC = string.9f
diff --git a/usr/src/man/man9f/avl.9f b/usr/src/man/man9f/avl.9f
index f1166ccdf4..4e7f594730 100644
--- a/usr/src/man/man9f/avl.9f
+++ b/usr/src/man/man9f/avl.9f
@@ -9,9 +9,9 @@
.\" http://www.illumos.org/license/CDDL.
.\"
.\"
-.\" Copyright 2015 Joyent, Inc.
+.\" Copyright 2016 Joyent, Inc.
.\"
-.Dd May 08, 2015
+.Dd Mar 13, 2016
.Dt AVL 9F
.Os
.Sh NAME
@@ -28,6 +28,7 @@
.Nm avl_last ,
.Nm avl_nearest ,
.Nm avl_numnodes ,
+.Nm avl_remove ,
.Nm avl_swap ,
.Nm AVL_NEXT ,
.Nm AVL_PREV ,
@@ -81,6 +82,7 @@ for more information on synchronization primitives.
.Xr AVL_NEXT 3AVL ,
.Xr avl_numnodes 3AVL ,
.Xr AVL_PREV 3AVL ,
+.Xr avl_remove 3AVL ,
.Xr avl_swap 3AVL ,
.Xr libavl 3LIB
.Rs
diff --git a/usr/src/man/man9f/ddi_fm_service_impact.9f b/usr/src/man/man9f/ddi_fm_service_impact.9f
index 0a985b2992..f7ac58fb2d 100644
--- a/usr/src/man/man9f/ddi_fm_service_impact.9f
+++ b/usr/src/man/man9f/ddi_fm_service_impact.9f
@@ -3,7 +3,7 @@
.\" 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]
-.TH DDI_FM_SERVICE_IMPACT 9F "May 14, 2007"
+.TH DDI_FM_SERVICE_IMPACT 9F "Mar 13, 2016"
.SH NAME
ddi_fm_service_impact \- report the impact of an error
.SH SYNOPSIS
@@ -11,15 +11,13 @@ ddi_fm_service_impact \- report the impact of an error
.nf
#include <sys/ddifm.h>
-\fBvoid\fR \fBddi_fm_service_impact\fR(\fBdev_info_t\fR *\fIdip\fR, \fBint\fR *\fIimpact\fR);
+\fBvoid\fR \fBddi_fm_service_impact\fR(\fBdev_info_t\fR *\fIdip\fR, \fBint\fR \fIimpact\fR);
.fi
.SH INTERFACE LEVEL
-.sp
.LP
Solaris DDI specific (Solaris DDI)
.SH PARAMETERS
-.sp
.ne 2
.na
\fB\fIdip\fR\fR
@@ -38,7 +36,6 @@ Impact of error
.RE
.SH DESCRIPTION
-.sp
.LP
The following service impact values are accepted by
\fBddi_fm_service_impact()\fR:
@@ -88,12 +85,10 @@ The service provided by the device was unaffected by the error.
.RE
.SH CONTEXT
-.sp
.LP
The \fBddi_fm_service_impact()\fR function can be called from user, kernel, or
high-level interrupt context.
.SH ATTRIBUTES
-.sp
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp
@@ -109,7 +104,6 @@ Interface Stability Committed
.TE
.SH SEE ALSO
-.sp
.LP
\fBfmd\fR(1M), \fBattributes\fR(5), \fBddi_fm_ereport_post\fR(9F),
\fBpci_ereport_post\fR(9F)
diff --git a/usr/src/man/man9f/string.9f b/usr/src/man/man9f/string.9f
index fccd40887b..49d6e957c7 100644
--- a/usr/src/man/man9f/string.9f
+++ b/usr/src/man/man9f/string.9f
@@ -3,11 +3,11 @@
.\" 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]
-.TH STRING 9F "Sep 14, 2015"
+.TH STRING 9F "Mar 14, 2016"
.SH NAME
-string, strcasecmp, strncasecmp, strncat, strlcat, strchr, strrchr, strcmp,
-strncmp, strcpy, strncpy, strlcpy, strfree, strspn, strdup, ddi_strdup, strlen,
-strnlen \- string operations
+string, strcasecmp, strncasecmp, strcat, strncat, strlcat, strchr,
+strrchr, strcmp, strncmp, strcpy, strncpy, strlcpy, strfree, strspn,
+strdup, ddi_strdup, strlen, strnlen \- string operations
.SH SYNOPSIS
.LP
.nf
@@ -24,6 +24,11 @@ strnlen \- string operations
.LP
.nf
+\fBchar *\fR\fBstrcat\fR(\fBchar *\fR \fIs1\fR, \fBconst char *\fR \fIs2\fR);
+.fi
+
+.LP
+.nf
\fBchar *\fR\fBstrncat\fR(\fBchar *\fR \fIs1\fR, \fBconst char *\fR \fIs2\fR, \fBsize_t\fR \fIn\fR);
.fi
@@ -114,14 +119,16 @@ The \fBstrcasecmp()\fR and \fBstrncasecmp()\fR functions are case-insensitive
versions of \fBstrcmp()\fR and \fBstrncmp()\fR respectively, described below.
They assume the \fBASCII\fR character set and ignore differences in case when
comparing lower and upper case characters.
-.SS "\fBstrncat()\fR, \fBstrlcat()\fR"
-.LP
-The \fBstrncat()\fR function appends at most \fIn\fR characters of string
-\fIs2\fR, including the terminating null character, to the end of string
-\fIs1\fR. It returns a pointer to the null-terminated result. The initial
-character of \fIs2\fR overrides the null character at the end of \fIs1\fR. If
-copying takes place between objects that overlap, the behavior of
-\fBstrncat()\fRand \fBstrlcat()\fR is undefined.
+.SS "\fBstrcat()\fR, \fBstrncat()\fR, and \fBstrlcat()\fR"
+.LP
+The \fBstrcat()\fR function appends a copy of string \fIs2\fR, including the
+terminating null character, to the end of string \fIs1\fR. The \fBstrncat()\fR
+function appends at most \fIn\fR characters of \fIs2\fR to \fIs1\fR, not
+including any terminating null character, and then appends a null character.
+Each returns a pointer to the null-terminated result. The initial character of
+\fIs2\fR overrides the null character at the end of \fIs1\fR. If copying takes
+place between objects that overlap, the behavior of \fBstrcat()\fR,
+\fBstrncat()\fR, and \fBstrlcat()\fR is undefined.
.sp
.LP
The \fBstrlcat()\fR function appends at most
diff --git a/usr/src/pkg/manifests/driver-network-iprb.mf b/usr/src/pkg/manifests/driver-network-iprb.mf
index 1ce7060c5c..45af97bc50 100644
--- a/usr/src/pkg/manifests/driver-network-iprb.mf
+++ b/usr/src/pkg/manifests/driver-network-iprb.mf
@@ -53,6 +53,7 @@ driver name=iprb clone_perms="iprb 0666 root sys" perms="* 0666 root sys" \
alias=pci8086,103d \
alias=pci8086,1050 \
alias=pci8086,1059 \
+ alias=pci8086,1064 \
alias=pci8086,1068 \
alias=pci8086,1069 \
alias=pci8086,1092 \
diff --git a/usr/src/pkg/manifests/system-header.mf b/usr/src/pkg/manifests/system-header.mf
index 72efa63d8e..9cdcf6db6e 100644
--- a/usr/src/pkg/manifests/system-header.mf
+++ b/usr/src/pkg/manifests/system-header.mf
@@ -24,7 +24,7 @@
# Copyright (c) 2012 by Delphix. All rights reserved.
# Copyright 2013 Saso Kiselkov. All rights reserved.
# Copyright 2014 Garrett D'Amore <garrett@damore.org>
-# Copyright 2015 Nexenta Systems, Inc. All rights reserved.
+# Copyright 2016 Nexenta Systems, Inc.
#
set name=pkg.fmri value=pkg:/system/header@$(PKGVERS)
@@ -1397,6 +1397,7 @@ file path=usr/include/sys/scsi/scsi.h
file path=usr/include/sys/scsi/scsi_address.h
file path=usr/include/sys/scsi/scsi_ctl.h
file path=usr/include/sys/scsi/scsi_fm.h
+file path=usr/include/sys/scsi/scsi_names.h
file path=usr/include/sys/scsi/scsi_params.h
file path=usr/include/sys/scsi/scsi_pkt.h
file path=usr/include/sys/scsi/scsi_resource.h
diff --git a/usr/src/pkg/manifests/system-kernel.man9f.inc b/usr/src/pkg/manifests/system-kernel.man9f.inc
index d2c87c23be..94e46f191c 100644
--- a/usr/src/pkg/manifests/system-kernel.man9f.inc
+++ b/usr/src/pkg/manifests/system-kernel.man9f.inc
@@ -610,6 +610,7 @@ link path=usr/share/man/man9f/avl_is_empty.9f target=avl.9f
link path=usr/share/man/man9f/avl_last.9f target=avl.9f
link path=usr/share/man/man9f/avl_nearest.9f target=avl.9f
link path=usr/share/man/man9f/avl_numnodes.9f target=avl.9f
+link path=usr/share/man/man9f/avl_remove.9f target=avl.9f
link path=usr/share/man/man9f/avl_swap.9f target=avl.9f
link path=usr/share/man/man9f/bcanputnext.9f target=canputnext.9f
link path=usr/share/man/man9f/crgetgid.9f target=ddi_cred.9f
@@ -1226,6 +1227,7 @@ link path=usr/share/man/man9f/sema_p_sig.9f target=semaphore.9f
link path=usr/share/man/man9f/sema_tryp.9f target=semaphore.9f
link path=usr/share/man/man9f/sema_v.9f target=semaphore.9f
link path=usr/share/man/man9f/strcasecmp.9f target=string.9f
+link path=usr/share/man/man9f/strcat.9f target=string.9f
link path=usr/share/man/man9f/strchr.9f target=string.9f
link path=usr/share/man/man9f/strcmp.9f target=string.9f
link path=usr/share/man/man9f/strcpy.9f target=string.9f
diff --git a/usr/src/pkg/manifests/system-library.man3c.inc b/usr/src/pkg/manifests/system-library.man3c.inc
index cfe418f7cf..0142010ccb 100644
--- a/usr/src/pkg/manifests/system-library.man3c.inc
+++ b/usr/src/pkg/manifests/system-library.man3c.inc
@@ -1280,6 +1280,7 @@ link path=usr/share/man/man3c/thr_setconcurrency.3c \
target=thr_getconcurrency.3c
link path=usr/share/man/man3c/thr_setprio.3c target=thr_getprio.3c
link path=usr/share/man/man3c/thr_setspecific.3c target=thr_keycreate.3c
+link path=usr/share/man/man3c/timegm.3c target=mktime.3c
link path=usr/share/man/man3c/timer_getoverrun.3c target=timer_settime.3c
link path=usr/share/man/man3c/timer_gettime.3c target=timer_settime.3c
link path=usr/share/man/man3c/timerclear.3c target=timeradd.3c
diff --git a/usr/src/pkg/manifests/system-library.man3nvpair.inc b/usr/src/pkg/manifests/system-library.man3nvpair.inc
index 1227925932..397b1bd38e 100644
--- a/usr/src/pkg/manifests/system-library.man3nvpair.inc
+++ b/usr/src/pkg/manifests/system-library.man3nvpair.inc
@@ -81,6 +81,8 @@ link path=usr/share/man/man3nvpair/nvlist_add_uint8_array.3nvpair \
target=nvlist_add_boolean.3nvpair
link path=usr/share/man/man3nvpair/nvlist_dup.3nvpair \
target=nvlist_alloc.3nvpair
+link path=usr/share/man/man3nvpair/nvlist_empty.3nvpair \
+ target=nvlist_lookup_nvpair.3nvpair
link path=usr/share/man/man3nvpair/nvlist_exists.3nvpair \
target=nvlist_lookup_nvpair.3nvpair
link path=usr/share/man/man3nvpair/nvlist_free.3nvpair \
diff --git a/usr/src/uts/common/io/comstar/port/iscsit/iscsit_login.c b/usr/src/uts/common/io/comstar/port/iscsit/iscsit_login.c
index f1306c438c..dc7549c9b3 100644
--- a/usr/src/uts/common/io/comstar/port/iscsit/iscsit_login.c
+++ b/usr/src/uts/common/io/comstar/port/iscsit/iscsit_login.c
@@ -21,7 +21,7 @@
/*
* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2014 Nexenta Systems, Inc. All rights reserved.
+ * Copyright 2016 Nexenta Systems, Inc.
*/
#include <sys/cpuvar.h>
@@ -32,12 +32,14 @@
#include <sys/sunddi.h>
#include <sys/modctl.h>
#include <sys/scsi/generic/persist.h>
+#include <sys/scsi/scsi_names.h>
#include <sys/socket.h>
#include <sys/strsubr.h>
#include <sys/sysmacros.h>
#include <sys/note.h>
#include <sys/sdt.h>
+#include <sys/errno.h>
#include <sys/stmf.h>
#include <sys/stmf_ioctl.h>
@@ -194,6 +196,9 @@ login_resp_complete_cb(idm_pdu_t *pdu, idm_status_t status);
static idm_status_t
iscsit_add_declarative_keys(iscsit_conn_t *ict);
+static char *
+iscsit_fold_name(char *name, size_t *buflen);
+
uint64_t max_dataseglen_target = ISCSIT_MAX_RECV_DATA_SEGMENT_LENGTH;
/*
@@ -1086,6 +1091,8 @@ login_sm_validate_initial_parameters(iscsit_conn_t *ict)
{
int nvrc;
char *string_val;
+ char *u8_iscsi_name;
+ size_t u8_iscsi_name_len;
uint8_t error_class = ISCSI_STATUS_CLASS_INITIATOR_ERR;
uint8_t error_detail = ISCSI_LOGIN_STATUS_MISSING_FIELDS;
idm_status_t status = IDM_STATUS_FAIL;
@@ -1105,10 +1112,16 @@ login_sm_validate_initial_parameters(iscsit_conn_t *ict)
"InitiatorName", &string_val)) != 0) {
goto initial_params_done;
}
- if ((nvrc = nvlist_add_string(lsm->icl_negotiated_values,
- "InitiatorName", string_val)) != 0) {
+
+ u8_iscsi_name = iscsit_fold_name(string_val, &u8_iscsi_name_len);
+ if (u8_iscsi_name == NULL)
goto initial_params_done;
- }
+ nvrc = nvlist_add_string(lsm->icl_negotiated_values, "InitiatorName",
+ u8_iscsi_name);
+ kmem_free(u8_iscsi_name, u8_iscsi_name_len);
+ if (nvrc != 0)
+ goto initial_params_done;
+
if ((nvrc = nvlist_lookup_string(lsm->icl_negotiated_values,
"InitiatorName", &string_val)) != 0) {
goto initial_params_done;
@@ -1155,10 +1168,15 @@ login_sm_validate_initial_parameters(iscsit_conn_t *ict)
goto initial_params_done;
}
if (nvrc == 0) {
- if ((nvrc = nvlist_add_string(lsm->icl_negotiated_values,
- "TargetName", string_val)) != 0) {
+ u8_iscsi_name = iscsit_fold_name(string_val,
+ &u8_iscsi_name_len);
+ if (u8_iscsi_name == NULL)
+ goto initial_params_done;
+ nvrc = nvlist_add_string(lsm->icl_negotiated_values,
+ "TargetName", u8_iscsi_name);
+ kmem_free(u8_iscsi_name, u8_iscsi_name_len);
+ if (nvrc != 0)
goto initial_params_done;
- }
if ((nvrc = nvlist_lookup_string(lsm->icl_negotiated_values,
"TargetName", &string_val)) != 0) {
goto initial_params_done;
@@ -2692,3 +2710,50 @@ alloc_fail:
}
return (idm_status);
}
+
+static char *
+iscsit_fold_name(char *name, size_t *buflen)
+{
+ char *ret;
+ const char *sns;
+ int errnum;
+ int flag = U8_TEXTPREP_NFKC;
+ size_t inlen, outlen, coff;
+
+ if (name == NULL)
+ return (NULL);
+
+ /* Check for one of the supported name types */
+ if (strncasecmp(name, SNS_EUI ".", strlen(SNS_EUI) + 1) == 0) {
+ sns = SNS_EUI;
+ *buflen = SNS_EUI_U8_LEN_MAX + 1;
+ flag |= U8_TEXTPREP_TOUPPER;
+ } else if (strncasecmp(name, SNS_IQN ".", strlen(SNS_IQN) + 1) == 0) {
+ sns = SNS_IQN;
+ *buflen = SNS_IQN_U8_LEN_MAX + 1;
+ flag |= U8_TEXTPREP_TOLOWER;
+ } else if (strncasecmp(name, SNS_NAA ".", strlen(SNS_NAA) + 1) == 0) {
+ sns = SNS_NAA;
+ *buflen = SNS_NAA_U8_LEN_MAX + 1;
+ flag |= U8_TEXTPREP_TOUPPER;
+ } else {
+ return (NULL);
+ }
+
+ ret = kmem_zalloc(*buflen, KM_SLEEP);
+ coff = strlen(sns);
+ inlen = strlen(name) - coff;
+ outlen = *buflen - coff;
+
+ /* Fold the case and normalize string */
+ if (u8_textprep_str(name + coff, &inlen, ret + coff, &outlen, flag,
+ U8_UNICODE_320, &errnum) == (size_t)-1) {
+ kmem_free(ret, *buflen);
+ return (NULL);
+ }
+
+ /* Copy the name type prefix */
+ bcopy(sns, ret, coff);
+
+ return (ret);
+}
diff --git a/usr/src/uts/common/io/mac/mac_protect.c b/usr/src/uts/common/io/mac/mac_protect.c
index a912ecc1f1..805b5d36f9 100644
--- a/usr/src/uts/common/io/mac/mac_protect.c
+++ b/usr/src/uts/common/io/mac/mac_protect.c
@@ -199,7 +199,8 @@ typedef struct dhcpv6_txn {
} dhcpv6_txn_t;
/*
- * SLAAC address. May be added to mci_v6_slaac_ip.
+ * Stateless address autoconfiguration (SLAAC) address. May be added to
+ * mci_v6_slaac_ip.
*/
typedef struct slaac_addr {
in6_addr_t sla_prefix;
@@ -665,7 +666,7 @@ done:
* Core logic for intercepting inbound DHCPv4 packets.
*/
static void
-intercept_dhcpv4_inbound(mac_client_impl_t *mcip, ipha_t *ipha, uchar_t *end,
+intercept_dhcpv4_inbound(mac_client_impl_t *mcip, uchar_t *end,
struct dhcp *dh4)
{
uchar_t *opt;
@@ -855,8 +856,7 @@ get_dhcpv6_info(ip6_t *ip6h, uchar_t *end, dhcpv6_message_t **dh6)
static int
get_ra_info(ip6_t *ip6h, uchar_t *end, nd_router_advert_t **ra)
{
- uint16_t hdrlen, client, server;
- boolean_t first_frag = B_FALSE;
+ uint16_t hdrlen;
ip6_frag_t *frag = NULL;
uint8_t proto;
uchar_t *hdrp;
@@ -1368,7 +1368,7 @@ done:
* Core logic for intercepting inbound DHCPv6 packets.
*/
static void
-intercept_dhcpv6_inbound(mac_client_impl_t *mcip, ip6_t *ip6h, uchar_t *end,
+intercept_dhcpv6_inbound(mac_client_impl_t *mcip, uchar_t *end,
dhcpv6_message_t *dh6)
{
dhcpv6_txn_t *txn;
@@ -1683,7 +1683,7 @@ mac_protect_intercept_dynamic_one(mac_client_impl_t *mcip, mblk_t *mp)
return;
if (get_dhcpv4_info(ipha, end, &dh4) == 0) {
- intercept_dhcpv4_inbound(mcip, ipha, end, dh4);
+ intercept_dhcpv4_inbound(mcip, end, dh4);
}
break;
}
@@ -1696,7 +1696,7 @@ mac_protect_intercept_dynamic_one(mac_client_impl_t *mcip, mblk_t *mp)
return;
if (get_dhcpv6_info(ip6h, end, &dh6) == 0) {
- intercept_dhcpv6_inbound(mcip, ip6h, end, dh6);
+ intercept_dhcpv6_inbound(mcip, end, dh6);
} else if (get_ra_info(ip6h, end, &ra) == 0) {
intercept_ra_inbound(mcip, ip6h, end, ra);
}
@@ -2576,9 +2576,6 @@ mac_protect_init(mac_client_impl_t *mcip)
sizeof (dhcpv6_addr_t), offsetof(dhcpv6_addr_t, da_node));
avl_create(&mcip->mci_v6_slaac_ip, compare_slaac_ip,
sizeof (slaac_addr_t), offsetof(slaac_addr_t, sla_node));
-
- if (mcip->mci_state_flags & MCIS_IS_VNIC)
- mcip->mci_protect_flags |= MPT_FLAG_PROMISC_FILTERED;
}
void
diff --git a/usr/src/uts/common/sys/Makefile b/usr/src/uts/common/sys/Makefile
index abc0c72941..052a28a5e2 100644
--- a/usr/src/uts/common/sys/Makefile
+++ b/usr/src/uts/common/sys/Makefile
@@ -18,14 +18,15 @@
#
# CDDL HEADER END
#
+
#
# Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
# Copyright 2014, Joyent, Inc. All rights reserved.
# Copyright 2013 Garrett D'Amore <garrett@damore.org>
# Copyright 2015, Joyent, Inc. All rights reserved.
# Copyright 2013 Saso Kiselkov. All rights reserved.
-# Copyright 2015 Nexenta Systems, Inc. All rights reserved.
# Copyright 2015 Igor Kozhukhov <ikozhukhov@gmail.com>
+# Copyright 2016 Nexenta Systems, Inc.
#
include $(SRC)/uts/Makefile.uts
@@ -913,6 +914,7 @@ SCSIHDRS= \
scsi_address.h \
scsi_ctl.h \
scsi_fm.h \
+ scsi_names.h \
scsi_params.h \
scsi_pkt.h \
scsi_resource.h \
diff --git a/usr/src/uts/common/sys/scsi/scsi_names.h b/usr/src/uts/common/sys/scsi/scsi_names.h
new file mode 100644
index 0000000000..349020d58a
--- /dev/null
+++ b/usr/src/uts/common/sys/scsi/scsi_names.h
@@ -0,0 +1,50 @@
+/*
+ * 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 Nexenta Systems, Inc.
+ */
+
+#ifndef _SYS_SCSI_SCSI_NAMES_H_
+#define _SYS_SCSI_SCSI_NAMES_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* SCSI Name Strings */
+#define SNS_EUI "eui"
+#define SNS_IQN "iqn"
+#define SNS_MAC "mac"
+#define SNS_NAA "naa"
+#define SNS_WWN "wwn"
+
+/* SCSI Name String maximum length definitions */
+#define SNS_EUI_16 16
+#define SNS_IQN_223 223
+#define SNS_MAC_12 12
+#define SNS_NAA_16 16
+#define SNS_NAA_32 32
+#define SNS_WWN_16 16
+
+/*
+ * Maximum number of bytes needed to store SCSI Name Strings in UTF-8 format,
+ * assuming that (per RFC3629) one UTF-8 character can take up to 4 bytes.
+ */
+#define SNS_EUI_U8_LEN_MAX (SNS_EUI_16 * 4)
+#define SNS_IQN_U8_LEN_MAX (SNS_IQN_223 * 4)
+#define SNS_NAA_U8_LEN_MAX (SNS_NAA_32 * 4)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _SYS_SCSI_SCSI_NAMES_H_ */
diff --git a/usr/src/uts/i86pc/os/acpi_fw.h b/usr/src/uts/i86pc/os/acpi_fw.h
deleted file mode 100644
index 54a34ef591..0000000000
--- a/usr/src/uts/i86pc/os/acpi_fw.h
+++ /dev/null
@@ -1,236 +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 2009 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-/*
- * Copyright (c) 2010, Intel Corporation.
- * All rights reserved.
- */
-
-#ifndef _ACPI_FW_H
-#define _ACPI_FW_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern void process_acpi_properties();
-
-#define ACPI_RSDP_SIG "RSD PTR "
-#define ACPI_RSDP_SIG_LEN (8)
-#define ACPI_TABLE_SIG_LEN (4)
-#define ACPI_EBDA_SEG_ADDR (0x40e)
-#define ACPI_EBDA_LEN (1024)
-
-#pragma pack(1)
-
-struct rsdp_v1 {
- char sig[8];
- uint8_t checksum;
- char oem_id[6];
- char revision;
- uint32_t rsdt;
-};
-
-struct rsdp {
- struct rsdp_v1 v1;
- uint32_t len;
- uint64_t xsdt;
- uint8_t ext_checksum;
- char reserved[3];
-};
-
-struct table_header {
- char sig[4];
- uint32_t len;
- uint8_t revision;
- uint8_t checksum;
- char oem_id[6];
- char oem_table_id[8];
- uint32_t oem_revision;
- uint32_t creator_id;
- uint32_t creator_revision;
-};
-
-struct xsdt {
- struct table_header hdr;
- union {
- uint32_t r[1];
- uint64_t x[1];
- } p;
-};
-
-
-#define MADT_PROCESSOR 0
-
-struct madt_processor {
- uint8_t type;
- uint8_t len;
- uint8_t acpi_processor_id;
- uint8_t apic_id;
- uint32_t flags;
-};
-
-struct madt {
- struct table_header hdr;
- uint32_t lapic_addr;
- uint32_t flags;
- struct madt_processor list[1];
-};
-
-struct srat_processor {
- uint8_t domain1;
- uint8_t apic_id;
- uint32_t flags;
- uint8_t local_sapic_eid;
- uint8_t domain2[3];
- uint8_t reserved[4];
-};
-
-struct srat_x2apic {
- uint8_t reserved[2];
- uint32_t domain;
- uint32_t x2apic_id;
- uint32_t flags;
-};
-
-struct srat_memory {
- uint32_t domain;
- uint8_t reserved1[2];
- uint64_t base_addr;
- uint64_t len;
- uint8_t reserved2[4];
- uint32_t flags;
- uint8_t reserved3[8];
-};
-
-struct srat_item {
- uint8_t type;
- uint8_t len;
- union {
- struct srat_processor p;
- struct srat_memory m;
- struct srat_x2apic xp;
- } i;
-};
-
-struct srat {
- struct table_header hdr;
- uint32_t reserved1;
- uint8_t reserved2[8];
- struct srat_item list[1];
-};
-
-#define SRAT_PROCESSOR (0)
-#define SRAT_MEMORY (1)
-#define SRAT_X2APIC (2)
-
-#define SRAT_ENABLED (1)
-#define SRAT_HOT_PLUG (2)
-#define SRAT_NON_VOLATILE (4)
-
-/*
- * Pointer to System Resource Affinity Table (SRAT)
- */
-extern struct srat *srat_ptr;
-
-struct slit {
- struct table_header hdr;
- uint64_t number;
- uint8_t entry[1];
-};
-
-/*
- * Pointer to System Locality Information Table (SLIT)
- */
-extern struct slit *slit_ptr;
-
-struct msct_proximity_domain {
- uint8_t revision;
- uint8_t length;
- uint32_t domain_min;
- uint32_t domain_max;
- uint32_t processor_max;
- uint64_t memory_max;
-};
-
-struct msct {
- struct table_header hdr;
- uint32_t proximity_domain_offset;
- uint32_t maximum_proximity_domains;
- uint32_t maximum_power_domains;
- uint64_t maximum_physical_address;
-};
-
-/*
- * Pointer to Maximum System Capability Table (MSCT)
- */
-extern struct msct *msct_ptr;
-
-struct cfg_base_addr_alloc {
- uint64_t base_addr;
- uint16_t segment;
- uint8_t start_bno;
- uint8_t end_bno;
- uint32_t reserved;
-};
-
-struct mcfg {
- char Signature[4];
- uint32_t Length;
- uint8_t Revision;
- uint8_t Checksum;
- char OemId[6];
- char OemTableId[8];
- uint32_t OemRevision;
- char CreatorId[4];
- uint32_t CreatorRevision;
- uint8_t Reserved[8];
- struct cfg_base_addr_alloc CfgBaseAddrAllocList[1];
-};
-
-struct dmar {
- struct table_header hdr;
- uint8_t width;
- uint8_t flags;
- uint8_t rsvd[10];
-};
-
-
-/*
- * Arbitrary limit on number of localities we handle; if
- * this limit is raised to more than UINT16_MAX, make sure
- * process_slit() knows how to handle it.
- */
-#define SLIT_LOCALITIES_MAX (4096)
-
-#define SLIT_NUM_PROPNAME "acpi-slit-localities"
-#define SLIT_PROPNAME "acpi-slit"
-
-#pragma pack()
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _ACPI_FW_H */
diff --git a/usr/src/uts/i86pc/os/biosdisk.c b/usr/src/uts/i86pc/os/biosdisk.c
index f0a7310436..297fbcdfbc 100644
--- a/usr/src/uts/i86pc/os/biosdisk.c
+++ b/usr/src/uts/i86pc/os/biosdisk.c
@@ -71,6 +71,7 @@ static int drive_present(uchar_t drivenum);
static void reset_disk(uchar_t drivenum);
static int is_eltorito(uchar_t drivenum);
+#if !defined(__xpv)
void
startup_bios_disk()
{
@@ -81,11 +82,6 @@ startup_bios_disk()
dev_info_t *devi;
int extensions;
-#if defined(__xpv)
- if (!DOMAIN_IS_INITDOMAIN(xen_info))
- return;
-#endif
-
if (dobiosdev == 0)
return;
@@ -124,6 +120,7 @@ startup_bios_disk()
}
}
}
+#endif
static int
bios_check_extension_present(uchar_t drivenum)
diff --git a/usr/src/uts/i86pc/os/fakebop.c b/usr/src/uts/i86pc/os/fakebop.c
index 060b89ee3c..3eeda4c10f 100644
--- a/usr/src/uts/i86pc/os/fakebop.c
+++ b/usr/src/uts/i86pc/os/fakebop.c
@@ -68,7 +68,8 @@
#include <sys/kobj_lex.h>
#include <sys/pci_cfgspace_impl.h>
#include <sys/fastboot_impl.h>
-#include "acpi_fw.h"
+#include <sys/acpi/acconfig.h>
+#include <sys/acpi/acpi.h>
static int have_console = 0; /* set once primitive console is initialized */
static char *boot_args = "";
@@ -162,9 +163,19 @@ static const char fastreboot_onpanic_args[] = " -B fastreboot_onpanic=0";
* Information Table (SLIT) and Maximum System Capability Table (MSCT)
* are mapped into virtual memory
*/
-struct srat *srat_ptr = NULL;
-struct slit *slit_ptr = NULL;
-struct msct *msct_ptr = NULL;
+ACPI_TABLE_SRAT *srat_ptr = NULL;
+ACPI_TABLE_SLIT *slit_ptr = NULL;
+ACPI_TABLE_MSCT *msct_ptr = NULL;
+
+/*
+ * Arbitrary limit on number of localities we handle; if
+ * this limit is raised to more than UINT16_MAX, make sure
+ * process_slit() knows how to handle it.
+ */
+#define SLIT_LOCALITIES_MAX (4096)
+
+#define SLIT_NUM_PROPNAME "acpi-slit-localities"
+#define SLIT_PROPNAME "acpi-slit"
/*
* Allocate aligned physical memory at boot time. This allocator allocates
@@ -1937,19 +1948,19 @@ checksum_table(uint8_t *tp, size_t len)
}
static int
-valid_rsdp(struct rsdp *rp)
+valid_rsdp(ACPI_TABLE_RSDP *rp)
{
/* validate the V1.x checksum */
- if (checksum_table((uint8_t *)&rp->v1, sizeof (struct rsdp_v1)) != 0)
+ if (checksum_table((uint8_t *)rp, ACPI_RSDP_CHECKSUM_LENGTH) != 0)
return (0);
/* If pre-ACPI 2.0, this is a valid RSDP */
- if (rp->v1.revision < 2)
+ if (rp->Revision < 2)
return (1);
/* validate the V2.x checksum */
- if (checksum_table((uint8_t *)rp, sizeof (struct rsdp)) != 0)
+ if (checksum_table((uint8_t *)rp, ACPI_RSDP_XCHECKSUM_LENGTH) != 0)
return (0);
return (1);
@@ -1959,19 +1970,20 @@ valid_rsdp(struct rsdp *rp)
* Scan memory range for an RSDP;
* see ACPI 3.0 Spec, 5.2.5.1
*/
-static struct rsdp *
+static ACPI_TABLE_RSDP *
scan_rsdp(paddr_t start, paddr_t end)
{
- size_t len = end - start + 1;
+ size_t len = end - start;
caddr_t ptr;
ptr = vmap_phys(len, start);
while (len > 0) {
- if (strncmp(ptr, ACPI_RSDP_SIG, ACPI_RSDP_SIG_LEN) == 0)
- if (valid_rsdp((struct rsdp *)ptr))
- return ((struct rsdp *)ptr);
- ptr += 16;
- len -= 16;
+ if (strncmp(ptr, ACPI_SIG_RSDP, strlen(ACPI_SIG_RSDP)) == 0 &&
+ valid_rsdp((ACPI_TABLE_RSDP *)ptr))
+ return ((ACPI_TABLE_RSDP *)ptr);
+
+ ptr += ACPI_RSDP_SCAN_STEP;
+ len -= ACPI_RSDP_SCAN_STEP;
}
return (NULL);
@@ -1980,53 +1992,55 @@ scan_rsdp(paddr_t start, paddr_t end)
/*
* Refer to ACPI 3.0 Spec, section 5.2.5.1 to understand this function
*/
-static struct rsdp *
+static ACPI_TABLE_RSDP *
find_rsdp()
{
- struct rsdp *rsdp;
+ ACPI_TABLE_RSDP *rsdp;
uint16_t *ebda_seg;
paddr_t ebda_addr;
/*
* Get the EBDA segment and scan the first 1K
*/
- ebda_seg = (uint16_t *)vmap_phys(sizeof (uint16_t), ACPI_EBDA_SEG_ADDR);
+ ebda_seg = (uint16_t *)vmap_phys(sizeof (uint16_t),
+ ACPI_EBDA_PTR_LOCATION);
ebda_addr = *ebda_seg << 4;
- rsdp = scan_rsdp(ebda_addr, ebda_addr + ACPI_EBDA_LEN - 1);
+ rsdp = scan_rsdp(ebda_addr, ebda_addr + ACPI_EBDA_WINDOW_SIZE);
if (rsdp == NULL)
/* if EBDA doesn't contain RSDP, look in BIOS memory */
- rsdp = scan_rsdp(0xe0000, 0xfffff);
+ rsdp = scan_rsdp(ACPI_HI_RSDP_WINDOW_BASE,
+ ACPI_HI_RSDP_WINDOW_BASE + ACPI_HI_RSDP_WINDOW_SIZE);
return (rsdp);
}
-static struct table_header *
+static ACPI_TABLE_HEADER *
map_fw_table(paddr_t table_addr)
{
- struct table_header *tp;
- size_t len = MAX(sizeof (struct table_header), MMU_PAGESIZE);
+ ACPI_TABLE_HEADER *tp;
+ size_t len = MAX(sizeof (*tp), MMU_PAGESIZE);
/*
* Map at least a page; if the table is larger than this, remap it
*/
- tp = (struct table_header *)vmap_phys(len, table_addr);
- if (tp->len > len)
- tp = (struct table_header *)vmap_phys(tp->len, table_addr);
+ tp = (ACPI_TABLE_HEADER *)vmap_phys(len, table_addr);
+ if (tp->Length > len)
+ tp = (ACPI_TABLE_HEADER *)vmap_phys(tp->Length, table_addr);
return (tp);
}
-static struct table_header *
+static ACPI_TABLE_HEADER *
find_fw_table(char *signature)
{
static int revision = 0;
- static struct xsdt *xsdt;
+ static ACPI_TABLE_XSDT *xsdt;
static int len;
paddr_t xsdt_addr;
- struct rsdp *rsdp;
- struct table_header *tp;
+ ACPI_TABLE_RSDP *rsdp;
+ ACPI_TABLE_HEADER *tp;
paddr_t table_addr;
int n;
- if (strlen(signature) != ACPI_TABLE_SIG_LEN)
+ if (strlen(signature) != ACPI_NAME_SIZE)
return (NULL);
/*
@@ -2039,8 +2053,15 @@ find_fw_table(char *signature)
* revision 1 and use the RSDT.
*/
if (revision == 0) {
- if ((rsdp = (struct rsdp *)find_rsdp()) != NULL) {
- revision = rsdp->v1.revision;
+ if ((rsdp = find_rsdp()) != NULL) {
+ revision = rsdp->Revision;
+ /*
+ * ACPI 6.0 states that current revision is 2
+ * from acpi_table_rsdp definition:
+ * Must be (0) for ACPI 1.0 or (2) for ACPI 2.0+
+ */
+ if (revision > 2)
+ revision = 2;
switch (revision) {
case 2:
/*
@@ -2048,7 +2069,7 @@ find_fw_table(char *signature)
* claims to be rev 2 but has a null XSDT
* address
*/
- xsdt_addr = rsdp->xsdt;
+ xsdt_addr = rsdp->XsdtPhysicalAddress;
if (xsdt_addr != 0)
break;
/* FALLTHROUGH */
@@ -2058,7 +2079,7 @@ find_fw_table(char *signature)
/* FALLTHROUGH */
case 1:
/* use the RSDT for rev 0/1 */
- xsdt_addr = rsdp->v1.rsdt;
+ xsdt_addr = rsdp->RsdtPhysicalAddress;
break;
default:
/* unknown revision */
@@ -2070,8 +2091,8 @@ find_fw_table(char *signature)
return (NULL);
/* cache the XSDT info */
- xsdt = (struct xsdt *)map_fw_table(xsdt_addr);
- len = (xsdt->hdr.len - sizeof (xsdt->hdr)) /
+ xsdt = (ACPI_TABLE_XSDT *)map_fw_table(xsdt_addr);
+ len = (xsdt->Header.Length - sizeof (xsdt->Header)) /
((revision == 1) ? sizeof (uint32_t) : sizeof (uint64_t));
}
@@ -2079,11 +2100,14 @@ find_fw_table(char *signature)
* Scan the table headers looking for a signature match
*/
for (n = 0; n < len; n++) {
- table_addr = (revision == 1) ? xsdt->p.r[n] : xsdt->p.x[n];
+ ACPI_TABLE_RSDT *rsdt = (ACPI_TABLE_RSDT *)xsdt;
+ table_addr = (revision == 1) ? rsdt->TableOffsetEntry[n] :
+ xsdt->TableOffsetEntry[n];
+
if (table_addr == 0)
continue;
tp = map_fw_table(table_addr);
- if (strncmp(tp->sig, signature, ACPI_TABLE_SIG_LEN) == 0) {
+ if (strncmp(tp->Signature, signature, ACPI_NAME_SIZE) == 0) {
return (tp);
}
}
@@ -2091,20 +2115,20 @@ find_fw_table(char *signature)
}
static void
-process_mcfg(struct mcfg *tp)
+process_mcfg(ACPI_TABLE_MCFG *tp)
{
- struct cfg_base_addr_alloc *cfg_baap;
+ ACPI_MCFG_ALLOCATION *cfg_baap;
char *cfg_baa_endp;
int64_t ecfginfo[4];
- cfg_baap = tp->CfgBaseAddrAllocList;
- cfg_baa_endp = ((char *)tp) + tp->Length;
+ cfg_baap = (ACPI_MCFG_ALLOCATION *)((uintptr_t)tp + sizeof (*tp));
+ cfg_baa_endp = ((char *)tp) + tp->Header.Length;
while ((char *)cfg_baap < cfg_baa_endp) {
- if (cfg_baap->base_addr != 0 && cfg_baap->segment == 0) {
- ecfginfo[0] = cfg_baap->base_addr;
- ecfginfo[1] = cfg_baap->segment;
- ecfginfo[2] = cfg_baap->start_bno;
- ecfginfo[3] = cfg_baap->end_bno;
+ if (cfg_baap->Address != 0 && cfg_baap->PciSegment == 0) {
+ ecfginfo[0] = cfg_baap->Address;
+ ecfginfo[1] = cfg_baap->PciSegment;
+ ecfginfo[2] = cfg_baap->StartBusNumber;
+ ecfginfo[3] = cfg_baap->EndBusNumber;
bsetprop(MCFG_PROPNAME, strlen(MCFG_PROPNAME),
ecfginfo, sizeof (ecfginfo));
break;
@@ -2115,45 +2139,90 @@ process_mcfg(struct mcfg *tp)
#ifndef __xpv
static void
-process_madt(struct madt *tp)
+process_madt_entries(ACPI_TABLE_MADT *tp, uint32_t *cpu_countp,
+ uint32_t *cpu_possible_countp, uint32_t *cpu_apicid_array)
{
- struct madt_processor *cpu, *end;
+ ACPI_SUBTABLE_HEADER *item, *end;
uint32_t cpu_count = 0;
uint32_t cpu_possible_count = 0;
- uint8_t cpu_apicid_array[UINT8_MAX + 1];
- if (tp != NULL) {
- /*
- * Determine number of CPUs and keep track of "final" APIC ID
- * for each CPU by walking through ACPI MADT processor list
- */
- end = (struct madt_processor *)(tp->hdr.len + (uintptr_t)tp);
- cpu = tp->list;
- while (cpu < end) {
- if (cpu->type == MADT_PROCESSOR) {
- if (cpu->flags & 1) {
- if (cpu_count < UINT8_MAX)
- cpu_apicid_array[cpu_count] =
- cpu->apic_id;
- cpu_count++;
- }
- cpu_possible_count++;
- }
+ /*
+ * Determine number of CPUs and keep track of "final" APIC ID
+ * for each CPU by walking through ACPI MADT processor list
+ */
+ end = (ACPI_SUBTABLE_HEADER *)(tp->Header.Length + (uintptr_t)tp);
+ item = (ACPI_SUBTABLE_HEADER *)((uintptr_t)tp + sizeof (*tp));
- cpu = (struct madt_processor *)
- (cpu->len + (uintptr_t)cpu);
+ while (item < end) {
+ switch (item->Type) {
+ case ACPI_MADT_TYPE_LOCAL_APIC: {
+ ACPI_MADT_LOCAL_APIC *cpu =
+ (ACPI_MADT_LOCAL_APIC *) item;
+
+ if (cpu->LapicFlags & ACPI_MADT_ENABLED) {
+ if (cpu_apicid_array != NULL)
+ cpu_apicid_array[cpu_count] = cpu->Id;
+ cpu_count++;
+ }
+ cpu_possible_count++;
+ break;
}
+ case ACPI_MADT_TYPE_LOCAL_X2APIC: {
+ ACPI_MADT_LOCAL_X2APIC *cpu =
+ (ACPI_MADT_LOCAL_X2APIC *) item;
+
+ if (cpu->LapicFlags & ACPI_MADT_ENABLED) {
+ if (cpu_apicid_array != NULL)
+ cpu_apicid_array[cpu_count] =
+ cpu->LocalApicId;
+ cpu_count++;
+ }
+ cpu_possible_count++;
+ break;
+ }
+ default:
+ if (kbm_debug)
+ bop_printf(NULL, "MADT type %d\n", item->Type);
+ break;
+ }
+
+ item = (ACPI_SUBTABLE_HEADER *)((uintptr_t)item + item->Length);
+ }
+ if (cpu_countp)
+ *cpu_countp = cpu_count;
+ if (cpu_possible_countp)
+ *cpu_possible_countp = cpu_possible_count;
+}
+
+static void
+process_madt(ACPI_TABLE_MADT *tp)
+{
+ uint32_t cpu_count = 0;
+ uint32_t cpu_possible_count = 0;
+ uint32_t *cpu_apicid_array; /* x2APIC ID is 32bit! */
+
+ if (tp != NULL) {
+ /* count cpu's */
+ process_madt_entries(tp, &cpu_count, &cpu_possible_count, NULL);
+
+ cpu_apicid_array = (uint32_t *)do_bsys_alloc(NULL, NULL,
+ cpu_count * sizeof (*cpu_apicid_array), MMU_PAGESIZE);
+ if (cpu_apicid_array == NULL)
+ bop_panic("Not enough memory for APIC ID array");
+
+ /* copy IDs */
+ process_madt_entries(tp, NULL, NULL, cpu_apicid_array);
/*
* Make boot property for array of "final" APIC IDs for each
* CPU
*/
bsetprop(BP_CPU_APICID_ARRAY, strlen(BP_CPU_APICID_ARRAY),
- cpu_apicid_array, cpu_count * sizeof (uint8_t));
+ cpu_apicid_array, cpu_count * sizeof (*cpu_apicid_array));
}
/*
- * Check whehter property plat-max-ncpus is already set.
+ * Check whether property plat-max-ncpus is already set.
*/
if (do_bsys_getproplen(NULL, PLAT_MAX_NCPUS_NAME) < 0) {
/*
@@ -2194,9 +2263,9 @@ process_madt(struct madt *tp)
}
static void
-process_srat(struct srat *tp)
+process_srat(ACPI_TABLE_SRAT *tp)
{
- struct srat_item *item, *end;
+ ACPI_SUBTABLE_HEADER *item, *end;
int i;
int proc_num, mem_num;
#pragma pack(1)
@@ -2223,47 +2292,58 @@ process_srat(struct srat *tp)
return;
proc_num = mem_num = 0;
- end = (struct srat_item *)(tp->hdr.len + (uintptr_t)tp);
- item = tp->list;
+ end = (ACPI_SUBTABLE_HEADER *)(tp->Header.Length + (uintptr_t)tp);
+ item = (ACPI_SUBTABLE_HEADER *)((uintptr_t)tp + sizeof (*tp));
while (item < end) {
- switch (item->type) {
- case SRAT_PROCESSOR:
- if (!(item->i.p.flags & SRAT_ENABLED))
+ switch (item->Type) {
+ case ACPI_SRAT_TYPE_CPU_AFFINITY: {
+ ACPI_SRAT_CPU_AFFINITY *cpu =
+ (ACPI_SRAT_CPU_AFFINITY *) item;
+
+ if (!(cpu->Flags & ACPI_SRAT_CPU_ENABLED))
break;
- processor.domain = item->i.p.domain1;
+ processor.domain = cpu->ProximityDomainLo;
for (i = 0; i < 3; i++)
processor.domain +=
- item->i.p.domain2[i] << ((i + 1) * 8);
- processor.apic_id = item->i.p.apic_id;
- processor.sapic_id = item->i.p.local_sapic_eid;
+ cpu->ProximityDomainHi[i] << ((i + 1) * 8);
+ processor.apic_id = cpu->ApicId;
+ processor.sapic_id = cpu->LocalSapicEid;
(void) snprintf(prop_name, 30, "acpi-srat-processor-%d",
proc_num);
bsetprop(prop_name, strlen(prop_name), &processor,
sizeof (processor));
proc_num++;
break;
- case SRAT_MEMORY:
- if (!(item->i.m.flags & SRAT_ENABLED))
+ }
+ case ACPI_SRAT_TYPE_MEMORY_AFFINITY: {
+ ACPI_SRAT_MEM_AFFINITY *mem =
+ (ACPI_SRAT_MEM_AFFINITY *)item;
+
+ if (!(mem->Flags & ACPI_SRAT_MEM_ENABLED))
break;
- memory.domain = item->i.m.domain;
- memory.addr = item->i.m.base_addr;
- memory.length = item->i.m.len;
- memory.flags = item->i.m.flags;
+ memory.domain = mem->ProximityDomain;
+ memory.addr = mem->BaseAddress;
+ memory.length = mem->Length;
+ memory.flags = mem->Flags;
(void) snprintf(prop_name, 30, "acpi-srat-memory-%d",
mem_num);
bsetprop(prop_name, strlen(prop_name), &memory,
sizeof (memory));
- if ((item->i.m.flags & SRAT_HOT_PLUG) &&
+ if ((mem->Flags & ACPI_SRAT_MEM_HOT_PLUGGABLE) &&
(memory.addr + memory.length > maxmem)) {
maxmem = memory.addr + memory.length;
}
mem_num++;
break;
- case SRAT_X2APIC:
- if (!(item->i.xp.flags & SRAT_ENABLED))
+ }
+ case ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY: {
+ ACPI_SRAT_X2APIC_CPU_AFFINITY *x2cpu =
+ (ACPI_SRAT_X2APIC_CPU_AFFINITY *) item;
+
+ if (!(x2cpu->Flags & ACPI_SRAT_CPU_ENABLED))
break;
- x2apic.domain = item->i.xp.domain;
- x2apic.x2apic_id = item->i.xp.x2apic_id;
+ x2apic.domain = x2cpu->ProximityDomain;
+ x2apic.x2apic_id = x2cpu->ApicId;
(void) snprintf(prop_name, 30, "acpi-srat-processor-%d",
proc_num);
bsetprop(prop_name, strlen(prop_name), &x2apic,
@@ -2271,9 +2351,14 @@ process_srat(struct srat *tp)
proc_num++;
break;
}
+ default:
+ if (kbm_debug)
+ bop_printf(NULL, "SRAT type %d\n", item->Type);
+ break;
+ }
- item = (struct srat_item *)
- (item->len + (caddr_t)item);
+ item = (ACPI_SUBTABLE_HEADER *)
+ (item->Length + (uintptr_t)item);
}
/*
@@ -2286,7 +2371,7 @@ process_srat(struct srat *tp)
}
static void
-process_slit(struct slit *tp)
+process_slit(ACPI_TABLE_SLIT *tp)
{
/*
@@ -2299,47 +2384,47 @@ process_slit(struct slit *tp)
* UINT16_MAX, the table size may overflow an int when being
* passed to bsetprop() below.
*/
- if (tp->number >= SLIT_LOCALITIES_MAX)
+ if (tp->LocalityCount >= SLIT_LOCALITIES_MAX)
return;
- bsetprop(SLIT_NUM_PROPNAME, strlen(SLIT_NUM_PROPNAME), &tp->number,
- sizeof (tp->number));
- bsetprop(SLIT_PROPNAME, strlen(SLIT_PROPNAME), &tp->entry,
- tp->number * tp->number);
+ bsetprop(SLIT_NUM_PROPNAME, strlen(SLIT_NUM_PROPNAME),
+ &tp->LocalityCount, sizeof (tp->LocalityCount));
+ bsetprop(SLIT_PROPNAME, strlen(SLIT_PROPNAME), &tp->Entry,
+ tp->LocalityCount * tp->LocalityCount);
}
-static struct msct *
-process_msct(struct msct *tp)
+static ACPI_TABLE_MSCT *
+process_msct(ACPI_TABLE_MSCT *tp)
{
int last_seen = 0;
int proc_num = 0;
- struct msct_proximity_domain *item, *end;
+ ACPI_MSCT_PROXIMITY *item, *end;
extern uint64_t plat_dr_options;
ASSERT(tp != NULL);
- end = (void *)(tp->hdr.len + (uintptr_t)tp);
- for (item = (void *)((uintptr_t)tp + tp->proximity_domain_offset);
+ end = (ACPI_MSCT_PROXIMITY *)(tp->Header.Length + (uintptr_t)tp);
+ for (item = (void *)((uintptr_t)tp + tp->ProximityOffset);
item < end;
- item = (void *)(item->length + (uintptr_t)item)) {
+ item = (void *)(item->Length + (uintptr_t)item)) {
/*
* Sanity check according to section 5.2.19.1 of ACPI 4.0.
* Revision 1
* Length 22
*/
- if (item->revision != 1 || item->length != 22) {
+ if (item->Revision != 1 || item->Length != 22) {
cmn_err(CE_CONT,
"?boot: unknown proximity domain structure in MSCT "
- "with rev(%d), len(%d).\n",
- (int)item->revision, (int)item->length);
+ "with Revision(%d), Length(%d).\n",
+ (int)item->Revision, (int)item->Length);
return (NULL);
- } else if (item->domain_min > item->domain_max) {
+ } else if (item->RangeStart > item->RangeEnd) {
cmn_err(CE_CONT,
"?boot: invalid proximity domain structure in MSCT "
- "with domain_min(%u), domain_max(%u).\n",
- item->domain_min, item->domain_max);
+ "with RangeStart(%u), RangeEnd(%u).\n",
+ item->RangeStart, item->RangeEnd);
return (NULL);
- } else if (item->domain_min != last_seen) {
+ } else if (item->RangeStart != last_seen) {
/*
* Items must be organized in ascending order of the
* proximity domain enumerations.
@@ -2351,24 +2436,24 @@ process_msct(struct msct *tp)
}
/*
- * If processor_max is 0 then there would be no CPUs in this
+ * If ProcessorCapacity is 0 then there would be no CPUs in this
* domain.
*/
- if (item->processor_max != 0) {
- proc_num += (item->domain_max - item->domain_min + 1) *
- item->processor_max;
+ if (item->ProcessorCapacity != 0) {
+ proc_num += (item->RangeEnd - item->RangeStart + 1) *
+ item->ProcessorCapacity;
}
- last_seen = item->domain_max - item->domain_min + 1;
+ last_seen = item->RangeEnd - item->RangeStart + 1;
/*
* Break out if all proximity domains have been processed.
* Some BIOSes may have unused items at the end of MSCT table.
*/
- if (last_seen > tp->maximum_proximity_domains) {
+ if (last_seen > tp->MaxProximityDomains) {
break;
}
}
- if (last_seen != tp->maximum_proximity_domains + 1) {
+ if (last_seen != tp->MaxProximityDomains + 1) {
cmn_err(CE_CONT,
"?boot: invalid proximity domain structure in MSCT, "
"proximity domain count doesn't match.\n");
@@ -2389,7 +2474,7 @@ process_msct(struct msct *tp)
* memory hot-adding by default. It may be overridden by value from
* the SRAT table or the "plat-dr-physmax" boot option.
*/
- plat_dr_physmax = btop(tp->maximum_physical_address + 1);
+ plat_dr_physmax = btop(tp->MaxAddress + 1);
/*
* Existence of MSCT implies CPU/memory hotplug-capability for the
@@ -2431,29 +2516,32 @@ enumerate_xen_cpus()
static void
build_firmware_properties(void)
{
- struct table_header *tp = NULL;
+ ACPI_TABLE_HEADER *tp = NULL;
#ifndef __xpv
- if ((msct_ptr = (struct msct *)find_fw_table("MSCT")) != NULL)
- msct_ptr = process_msct(msct_ptr);
+ if ((tp = find_fw_table(ACPI_SIG_MSCT)) != NULL)
+ msct_ptr = process_msct((ACPI_TABLE_MSCT *)tp);
+ else
+ msct_ptr = NULL;
- if ((tp = find_fw_table("APIC")) != NULL)
- process_madt((struct madt *)tp);
+ if ((tp = find_fw_table(ACPI_SIG_MADT)) != NULL)
+ process_madt((ACPI_TABLE_MADT *)tp);
- if ((srat_ptr = (struct srat *)find_fw_table("SRAT")) != NULL)
+ if ((srat_ptr = (ACPI_TABLE_SRAT *)
+ find_fw_table(ACPI_SIG_SRAT)) != NULL)
process_srat(srat_ptr);
- if (slit_ptr = (struct slit *)find_fw_table("SLIT"))
+ if (slit_ptr = (ACPI_TABLE_SLIT *)find_fw_table(ACPI_SIG_SLIT))
process_slit(slit_ptr);
- tp = find_fw_table("MCFG");
+ tp = find_fw_table(ACPI_SIG_MCFG);
#else /* __xpv */
enumerate_xen_cpus();
if (DOMAIN_IS_INITDOMAIN(xen_info))
- tp = find_fw_table("MCFG");
+ tp = find_fw_table(ACPI_SIG_MCFG);
#endif /* __xpv */
if (tp != NULL)
- process_mcfg((struct mcfg *)tp);
+ process_mcfg((ACPI_TABLE_MCFG *)tp);
}
/*
diff --git a/usr/src/uts/i86pc/os/lgrpplat.c b/usr/src/uts/i86pc/os/lgrpplat.c
index 2d7c253204..981398970e 100644
--- a/usr/src/uts/i86pc/os/lgrpplat.c
+++ b/usr/src/uts/i86pc/os/lgrpplat.c
@@ -182,8 +182,12 @@
#include <vm/vm_dep.h>
#include <sys/acpidev.h>
-#include "acpi_fw.h" /* for SRAT, SLIT and MSCT */
+#include <sys/acpi/acpi.h> /* for SRAT, SLIT and MSCT */
+/* from fakebop.c */
+extern ACPI_TABLE_SRAT *srat_ptr;
+extern ACPI_TABLE_SLIT *slit_ptr;
+extern ACPI_TABLE_MSCT *msct_ptr;
#define MAX_NODES 8
#define NLGRP (MAX_NODES * (MAX_NODES - 1) + 1)
@@ -483,7 +487,7 @@ static hrtime_t lgrp_plat_probe_time(int to, cpu_node_map_t *cpu_node,
static int lgrp_plat_process_cpu_apicids(cpu_node_map_t *cpu_node);
-static int lgrp_plat_process_slit(struct slit *tp,
+static int lgrp_plat_process_slit(ACPI_TABLE_SLIT *tp,
node_domain_map_t *node_domain, uint_t node_cnt,
memnode_phys_addr_map_t *memnode_info,
lgrp_plat_latency_stats_t *lat_stats);
@@ -492,17 +496,17 @@ static int lgrp_plat_process_sli(uint32_t domain, uchar_t *sli_info,
uint32_t sli_cnt, node_domain_map_t *node_domain, uint_t node_cnt,
lgrp_plat_latency_stats_t *lat_stats);
-static int lgrp_plat_process_srat(struct srat *tp, struct msct *mp,
+static int lgrp_plat_process_srat(ACPI_TABLE_SRAT *tp, ACPI_TABLE_MSCT *mp,
uint32_t *prox_domain_min, node_domain_map_t *node_domain,
cpu_node_map_t *cpu_node, int cpu_count,
memnode_phys_addr_map_t *memnode_info);
static void lgrp_plat_release_bootstrap(void);
-static int lgrp_plat_srat_domains(struct srat *tp,
+static int lgrp_plat_srat_domains(ACPI_TABLE_SRAT *tp,
uint32_t *prox_domain_min);
-static int lgrp_plat_msct_domains(struct msct *tp,
+static int lgrp_plat_msct_domains(ACPI_TABLE_MSCT *tp,
uint32_t *prox_domain_min);
static void lgrp_plat_2level_setup(lgrp_plat_latency_stats_t *lat_stats);
@@ -2560,7 +2564,7 @@ lgrp_plat_process_cpu_apicids(cpu_node_map_t *cpu_node)
{
int boot_prop_len;
char *boot_prop_name = BP_CPU_APICID_ARRAY;
- uint8_t cpu_apicid_array[UINT8_MAX + 1];
+ uint32_t *cpu_apicid_array;
int i;
int n;
@@ -2568,7 +2572,7 @@ lgrp_plat_process_cpu_apicids(cpu_node_map_t *cpu_node)
* Check length of property value
*/
boot_prop_len = BOP_GETPROPLEN(bootops, boot_prop_name);
- if (boot_prop_len <= 0 || boot_prop_len > sizeof (cpu_apicid_array))
+ if (boot_prop_len <= 0)
return (-1);
/*
@@ -2576,14 +2580,17 @@ lgrp_plat_process_cpu_apicids(cpu_node_map_t *cpu_node)
* not very interesting for NUMA. It's not interesting for NUMA if
* system has only one CPU and doesn't support CPU hotplug.
*/
- n = boot_prop_len / sizeof (uint8_t);
+ n = boot_prop_len / sizeof (*cpu_apicid_array);
if (n == 1 && !plat_dr_support_cpu())
return (-2);
+ cpu_apicid_array = (uint32_t *)BOP_ALLOC(bootops, NULL, boot_prop_len,
+ sizeof (*cpu_apicid_array));
/*
* Get CPU to APIC ID property value
*/
- if (BOP_GETPROP(bootops, boot_prop_name, cpu_apicid_array) < 0)
+ if (cpu_apicid_array == NULL ||
+ BOP_GETPROP(bootops, boot_prop_name, cpu_apicid_array) < 0)
return (-3);
/*
@@ -2623,7 +2630,7 @@ lgrp_plat_process_cpu_apicids(cpu_node_map_t *cpu_node)
* NUMA node is from each other
*/
static int
-lgrp_plat_process_slit(struct slit *tp,
+lgrp_plat_process_slit(ACPI_TABLE_SLIT *tp,
node_domain_map_t *node_domain, uint_t node_cnt,
memnode_phys_addr_map_t *memnode_info, lgrp_plat_latency_stats_t *lat_stats)
{
@@ -2643,7 +2650,7 @@ lgrp_plat_process_slit(struct slit *tp,
if (lat_stats == NULL)
return (2);
- localities = tp->number;
+ localities = tp->LocalityCount;
min = lat_stats->latency_min;
max = lat_stats->latency_max;
@@ -2651,7 +2658,7 @@ lgrp_plat_process_slit(struct slit *tp,
/*
* Fill in latency matrix based on SLIT entries
*/
- slit_entries = tp->entry;
+ slit_entries = tp->Entry;
for (i = 0; i < localities; i++) {
src = lgrp_plat_domain_to_node(node_domain,
node_cnt, i);
@@ -2799,14 +2806,13 @@ lgrp_plat_process_sli(uint32_t domain_id, uchar_t *sli_info,
* manufacturers are guilty of not having a SRAT table.
*/
static int
-lgrp_plat_process_srat(struct srat *tp, struct msct *mp,
+lgrp_plat_process_srat(ACPI_TABLE_SRAT *tp, ACPI_TABLE_MSCT *mp,
uint32_t *prox_domain_min, node_domain_map_t *node_domain,
cpu_node_map_t *cpu_node, int cpu_count,
memnode_phys_addr_map_t *memnode_info)
{
- struct srat_item *srat_end;
+ ACPI_SUBTABLE_HEADER *item, *srat_end;
int i;
- struct srat_item *item;
int node_cnt;
int proc_entry_count;
int rc;
@@ -2848,8 +2854,8 @@ lgrp_plat_process_srat(struct srat *tp, struct msct *mp,
* Walk through SRAT, examining each CPU and memory entry to determine
* which CPUs and memory belong to which node.
*/
- item = tp->list;
- srat_end = (struct srat_item *)(tp->hdr.len + (uintptr_t)tp);
+ item = (ACPI_SUBTABLE_HEADER *)((uintptr_t)tp + sizeof (*tp));
+ srat_end = (ACPI_SUBTABLE_HEADER *)(tp->Header.Length + (uintptr_t)tp);
proc_entry_count = 0;
while (item < srat_end) {
uint32_t apic_id;
@@ -2858,9 +2864,12 @@ lgrp_plat_process_srat(struct srat *tp, struct msct *mp,
uint64_t length;
uint64_t start;
- switch (item->type) {
- case SRAT_PROCESSOR: /* CPU entry */
- if (!(item->i.p.flags & SRAT_ENABLED) ||
+ switch (item->Type) {
+ case ACPI_SRAT_TYPE_CPU_AFFINITY: { /* CPU entry */
+ ACPI_SRAT_CPU_AFFINITY *cpu =
+ (ACPI_SRAT_CPU_AFFINITY *) item;
+
+ if (!(cpu->Flags & ACPI_SRAT_CPU_ENABLED) ||
cpu_node == NULL)
break;
@@ -2868,12 +2877,12 @@ lgrp_plat_process_srat(struct srat *tp, struct msct *mp,
* Calculate domain (node) ID and fill in APIC ID to
* domain/node mapping table
*/
- domain = item->i.p.domain1;
+ domain = cpu->ProximityDomainLo;
for (i = 0; i < 3; i++) {
- domain += item->i.p.domain2[i] <<
+ domain += cpu->ProximityDomainHi[i] <<
((i + 1) * 8);
}
- apic_id = item->i.p.apic_id;
+ apic_id = cpu->ApicId;
rc = lgrp_plat_cpu_node_update(node_domain, node_cnt,
cpu_node, cpu_count, apic_id, domain);
@@ -2882,9 +2891,12 @@ lgrp_plat_process_srat(struct srat *tp, struct msct *mp,
else if (rc == 0)
proc_entry_count++;
break;
+ }
+ case ACPI_SRAT_TYPE_MEMORY_AFFINITY: { /* memory entry */
+ ACPI_SRAT_MEM_AFFINITY *mem =
+ (ACPI_SRAT_MEM_AFFINITY *)item;
- case SRAT_MEMORY: /* memory entry */
- if (!(item->i.m.flags & SRAT_ENABLED) ||
+ if (!(mem->Flags & ACPI_SRAT_MEM_ENABLED) ||
memnode_info == NULL)
break;
@@ -2892,9 +2904,9 @@ lgrp_plat_process_srat(struct srat *tp, struct msct *mp,
* Get domain (node) ID and fill in domain/node
* to memory mapping table
*/
- domain = item->i.m.domain;
- start = item->i.m.base_addr;
- length = item->i.m.len;
+ domain = mem->ProximityDomain;
+ start = mem->BaseAddress;
+ length = mem->Length;
end = start + length - 1;
/*
@@ -2905,7 +2917,7 @@ lgrp_plat_process_srat(struct srat *tp, struct msct *mp,
* with memory ranges in physinstalled to filter out
* memory address ranges reserved for hot plug.
*/
- if (item->i.m.flags & SRAT_HOT_PLUG) {
+ if (mem->Flags & ACPI_SRAT_MEM_HOT_PLUGGABLE) {
uint64_t rstart = UINT64_MAX;
uint64_t rend = 0;
struct memlist *ml;
@@ -2942,9 +2954,12 @@ lgrp_plat_process_srat(struct srat *tp, struct msct *mp,
start, end, domain, ACPI_MEMNODE_DEVID_BOOT) < 0)
return (-4);
break;
+ }
+ case ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY: { /* x2apic CPU */
+ ACPI_SRAT_X2APIC_CPU_AFFINITY *x2cpu =
+ (ACPI_SRAT_X2APIC_CPU_AFFINITY *) item;
- case SRAT_X2APIC: /* x2apic CPU entry */
- if (!(item->i.xp.flags & SRAT_ENABLED) ||
+ if (!(x2cpu->Flags & ACPI_SRAT_CPU_ENABLED) ||
cpu_node == NULL)
break;
@@ -2952,8 +2967,8 @@ lgrp_plat_process_srat(struct srat *tp, struct msct *mp,
* Calculate domain (node) ID and fill in APIC ID to
* domain/node mapping table
*/
- domain = item->i.xp.domain;
- apic_id = item->i.xp.x2apic_id;
+ domain = x2cpu->ProximityDomain;
+ apic_id = x2cpu->ApicId;
rc = lgrp_plat_cpu_node_update(node_domain, node_cnt,
cpu_node, cpu_count, apic_id, domain);
@@ -2962,12 +2977,12 @@ lgrp_plat_process_srat(struct srat *tp, struct msct *mp,
else if (rc == 0)
proc_entry_count++;
break;
-
+ }
default:
break;
}
- item = (struct srat_item *)((uintptr_t)item + item->len);
+ item = (ACPI_SUBTABLE_HEADER *)((uintptr_t)item + item->Length);
}
/*
@@ -3013,13 +3028,12 @@ lgrp_plat_release_bootstrap(void)
* Return number of proximity domains given in ACPI SRAT
*/
static int
-lgrp_plat_srat_domains(struct srat *tp, uint32_t *prox_domain_min)
+lgrp_plat_srat_domains(ACPI_TABLE_SRAT *tp, uint32_t *prox_domain_min)
{
int domain_cnt;
uint32_t domain_min;
- struct srat_item *end;
+ ACPI_SUBTABLE_HEADER *item, *end;
int i;
- struct srat_item *item;
node_domain_map_t node_domain[MAX_NODES];
@@ -3030,46 +3044,55 @@ lgrp_plat_srat_domains(struct srat *tp, uint32_t *prox_domain_min)
* Walk through SRAT to find minimum proximity domain ID
*/
domain_min = UINT32_MAX;
- item = tp->list;
- end = (struct srat_item *)(tp->hdr.len + (uintptr_t)tp);
+ item = (ACPI_SUBTABLE_HEADER *)((uintptr_t)tp + sizeof (*tp));
+ end = (ACPI_SUBTABLE_HEADER *)(tp->Header.Length + (uintptr_t)tp);
while (item < end) {
uint32_t domain;
- switch (item->type) {
- case SRAT_PROCESSOR: /* CPU entry */
- if (!(item->i.p.flags & SRAT_ENABLED)) {
- item = (struct srat_item *)((uintptr_t)item +
- item->len);
+ switch (item->Type) {
+ case ACPI_SRAT_TYPE_CPU_AFFINITY: { /* CPU entry */
+ ACPI_SRAT_CPU_AFFINITY *cpu =
+ (ACPI_SRAT_CPU_AFFINITY *) item;
+
+ if (!(cpu->Flags & ACPI_SRAT_CPU_ENABLED)) {
+ item = (ACPI_SUBTABLE_HEADER *)
+ ((uintptr_t)item + item->Length);
continue;
}
- domain = item->i.p.domain1;
+ domain = cpu->ProximityDomainLo;
for (i = 0; i < 3; i++) {
- domain += item->i.p.domain2[i] <<
+ domain += cpu->ProximityDomainHi[i] <<
((i + 1) * 8);
}
break;
+ }
+ case ACPI_SRAT_TYPE_MEMORY_AFFINITY: { /* memory entry */
+ ACPI_SRAT_MEM_AFFINITY *mem =
+ (ACPI_SRAT_MEM_AFFINITY *)item;
- case SRAT_MEMORY: /* memory entry */
- if (!(item->i.m.flags & SRAT_ENABLED)) {
- item = (struct srat_item *)((uintptr_t)item +
- item->len);
+ if (!(mem->Flags & ACPI_SRAT_MEM_ENABLED)) {
+ item = (ACPI_SUBTABLE_HEADER *)
+ ((uintptr_t)item + item->Length);
continue;
}
- domain = item->i.m.domain;
+ domain = mem->ProximityDomain;
break;
+ }
+ case ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY: { /* x2apic CPU */
+ ACPI_SRAT_X2APIC_CPU_AFFINITY *x2cpu =
+ (ACPI_SRAT_X2APIC_CPU_AFFINITY *) item;
- case SRAT_X2APIC: /* x2apic CPU entry */
- if (!(item->i.xp.flags & SRAT_ENABLED)) {
- item = (struct srat_item *)((uintptr_t)item +
- item->len);
+ if (!(x2cpu->Flags & ACPI_SRAT_CPU_ENABLED)) {
+ item = (ACPI_SUBTABLE_HEADER *)
+ ((uintptr_t)item + item->Length);
continue;
}
- domain = item->i.xp.domain;
+ domain = x2cpu->ProximityDomain;
break;
-
+ }
default:
- item = (struct srat_item *)((uintptr_t)item +
- item->len);
+ item = (ACPI_SUBTABLE_HEADER *)((uintptr_t)item +
+ item->Length);
continue;
}
@@ -3079,7 +3102,7 @@ lgrp_plat_srat_domains(struct srat *tp, uint32_t *prox_domain_min)
if (domain < domain_min)
domain_min = domain;
- item = (struct srat_item *)((uintptr_t)item + item->len);
+ item = (ACPI_SUBTABLE_HEADER *)((uintptr_t)item + item->Length);
}
if (lgrp_plat_domain_min_enable && prox_domain_min != NULL)
*prox_domain_min = domain_min;
@@ -3089,49 +3112,58 @@ lgrp_plat_srat_domains(struct srat *tp, uint32_t *prox_domain_min)
* proximity domain ID for each.
*/
domain_cnt = 0;
- item = tp->list;
- end = (struct srat_item *)(tp->hdr.len + (uintptr_t)tp);
+ item = (ACPI_SUBTABLE_HEADER *)((uintptr_t)tp + sizeof (*tp));
+ end = (ACPI_SUBTABLE_HEADER *)(tp->Header.Length + (uintptr_t)tp);
bzero(node_domain, MAX_NODES * sizeof (node_domain_map_t));
while (item < end) {
uint32_t domain;
boolean_t overflow;
uint_t start;
- switch (item->type) {
- case SRAT_PROCESSOR: /* CPU entry */
- if (!(item->i.p.flags & SRAT_ENABLED)) {
- item = (struct srat_item *)((uintptr_t)item +
- item->len);
+ switch (item->Type) {
+ case ACPI_SRAT_TYPE_CPU_AFFINITY: { /* CPU entry */
+ ACPI_SRAT_CPU_AFFINITY *cpu =
+ (ACPI_SRAT_CPU_AFFINITY *) item;
+
+ if (!(cpu->Flags & ACPI_SRAT_CPU_ENABLED)) {
+ item = (ACPI_SUBTABLE_HEADER *)
+ ((uintptr_t)item + item->Length);
continue;
}
- domain = item->i.p.domain1;
+ domain = cpu->ProximityDomainLo;
for (i = 0; i < 3; i++) {
- domain += item->i.p.domain2[i] <<
+ domain += cpu->ProximityDomainHi[i] <<
((i + 1) * 8);
}
break;
+ }
+ case ACPI_SRAT_TYPE_MEMORY_AFFINITY: { /* memory entry */
+ ACPI_SRAT_MEM_AFFINITY *mem =
+ (ACPI_SRAT_MEM_AFFINITY *)item;
- case SRAT_MEMORY: /* memory entry */
- if (!(item->i.m.flags & SRAT_ENABLED)) {
- item = (struct srat_item *)((uintptr_t)item +
- item->len);
+ if (!(mem->Flags & ACPI_SRAT_MEM_ENABLED)) {
+ item = (ACPI_SUBTABLE_HEADER *)
+ ((uintptr_t)item + item->Length);
continue;
}
- domain = item->i.m.domain;
+ domain = mem->ProximityDomain;
break;
+ }
+ case ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY: { /* x2apic CPU */
+ ACPI_SRAT_X2APIC_CPU_AFFINITY *x2cpu =
+ (ACPI_SRAT_X2APIC_CPU_AFFINITY *) item;
- case SRAT_X2APIC: /* x2apic CPU entry */
- if (!(item->i.xp.flags & SRAT_ENABLED)) {
- item = (struct srat_item *)((uintptr_t)item +
- item->len);
+ if (!(x2cpu->Flags & ACPI_SRAT_CPU_ENABLED)) {
+ item = (ACPI_SUBTABLE_HEADER *)
+ ((uintptr_t)item + item->Length);
continue;
}
- domain = item->i.xp.domain;
+ domain = x2cpu->ProximityDomain;
break;
-
+ }
default:
- item = (struct srat_item *)((uintptr_t)item +
- item->len);
+ item = (ACPI_SUBTABLE_HEADER *)((uintptr_t)item +
+ item->Length);
continue;
}
@@ -3180,7 +3212,7 @@ lgrp_plat_srat_domains(struct srat *tp, uint32_t *prox_domain_min)
if (overflow == B_TRUE)
return (-1);
- item = (struct srat_item *)((uintptr_t)item + item->len);
+ item = (ACPI_SUBTABLE_HEADER *)((uintptr_t)item + item->Length);
}
return (domain_cnt);
}
@@ -3191,48 +3223,48 @@ lgrp_plat_srat_domains(struct srat *tp, uint32_t *prox_domain_min)
* MSCT table has been verified in function process_msct() in fakebop.c.
*/
static int
-lgrp_plat_msct_domains(struct msct *tp, uint32_t *prox_domain_min)
+lgrp_plat_msct_domains(ACPI_TABLE_MSCT *tp, uint32_t *prox_domain_min)
{
int last_seen = 0;
uint32_t proxmin = UINT32_MAX;
- struct msct_proximity_domain *item, *end;
+ ACPI_MSCT_PROXIMITY *item, *end;
if (tp == NULL || lgrp_plat_msct_enable == 0)
return (-1);
- if (tp->maximum_proximity_domains >= MAX_NODES) {
+ if (tp->MaxProximityDomains >= MAX_NODES) {
cmn_err(CE_CONT,
"?lgrp: too many proximity domains (%d), max %d supported, "
"disable support of CPU/memory DR operations.",
- tp->maximum_proximity_domains + 1, MAX_NODES);
+ tp->MaxProximityDomains + 1, MAX_NODES);
plat_dr_disable_cpu();
plat_dr_disable_memory();
return (-1);
}
if (prox_domain_min != NULL) {
- end = (void *)(tp->hdr.len + (uintptr_t)tp);
+ end = (void *)(tp->Header.Length + (uintptr_t)tp);
for (item = (void *)((uintptr_t)tp +
- tp->proximity_domain_offset); item < end;
- item = (void *)(item->length + (uintptr_t)item)) {
- if (item->domain_min < proxmin) {
- proxmin = item->domain_min;
+ tp->ProximityOffset); item < end;
+ item = (void *)(item->Length + (uintptr_t)item)) {
+ if (item->RangeStart < proxmin) {
+ proxmin = item->RangeStart;
}
- last_seen = item->domain_max - item->domain_min + 1;
+ last_seen = item->RangeEnd - item->RangeStart + 1;
/*
* Break out if all proximity domains have been
* processed. Some BIOSes may have unused items
* at the end of MSCT table.
*/
- if (last_seen > tp->maximum_proximity_domains) {
+ if (last_seen > tp->MaxProximityDomains) {
break;
}
}
*prox_domain_min = proxmin;
}
- return (tp->maximum_proximity_domains + 1);
+ return (tp->MaxProximityDomains + 1);
}