summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormyers <none@none>2005-11-17 08:46:01 -0800
committermyers <none@none>2005-11-17 08:46:01 -0800
commit186507a7cf6e4b4155e9ef89631777a96633ac0e (patch)
treede8a9df2499f491b06828c59df3dd7ae6b177e48
parent3dda9c1f98047ea58eaaa9a0fc08c3a0aabbc0c0 (diff)
downloadillumos-joyent-186507a7cf6e4b4155e9ef89631777a96633ac0e.tar.gz
6328449 acpica: create_d2a_subtree makes nodes for ACPI non-devices
6332549 acpica: update to Intel ACPI CA 20050930 source drop 6333936 vsnprintf: vsnprintf doesn't support 'h' or string-precision modifiers 6335392 psm: psm_common.c incorrectly uses ACPI resource end tags
-rw-r--r--usr/src/common/util/string.c157
-rw-r--r--usr/src/uts/i86pc/Makefile.files2
-rw-r--r--usr/src/uts/i86pc/acpica/Makefile2
-rw-r--r--usr/src/uts/i86pc/io/acpica/acpi_enum.c143
-rw-r--r--usr/src/uts/i86pc/io/acpica/acpica.c22
-rw-r--r--usr/src/uts/i86pc/io/acpica/changes.txt283
-rw-r--r--usr/src/uts/i86pc/io/acpica/debugger/dbcmds.c82
-rw-r--r--usr/src/uts/i86pc/io/acpica/debugger/dbdisply.c4
-rw-r--r--usr/src/uts/i86pc/io/acpica/debugger/dbexec.c4
-rw-r--r--usr/src/uts/i86pc/io/acpica/debugger/dbfileio.c11
-rw-r--r--usr/src/uts/i86pc/io/acpica/debugger/dbhistry.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/debugger/dbinput.c11
-rw-r--r--usr/src/uts/i86pc/io/acpica/debugger/dbstats.c10
-rw-r--r--usr/src/uts/i86pc/io/acpica/debugger/dbutils.c11
-rw-r--r--usr/src/uts/i86pc/io/acpica/debugger/dbxface.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/events/evevent.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/events/evgpe.c12
-rw-r--r--usr/src/uts/i86pc/io/acpica/events/evgpeblk.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/events/evmisc.c5
-rw-r--r--usr/src/uts/i86pc/io/acpica/events/evregion.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/events/evrgnini.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/events/evsci.c6
-rw-r--r--usr/src/uts/i86pc/io/acpica/events/evxface.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/events/evxfevnt.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/events/evxfregn.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/hardware/hwacpi.c10
-rw-r--r--usr/src/uts/i86pc/io/acpica/hardware/hwgpe.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/hardware/hwregs.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/hardware/hwsleep.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/hardware/hwtimer.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/interpreter/dispatcher/dsfield.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/interpreter/dispatcher/dsinit.c26
-rw-r--r--usr/src/uts/i86pc/io/acpica/interpreter/dispatcher/dsmethod.c111
-rw-r--r--usr/src/uts/i86pc/io/acpica/interpreter/dispatcher/dsmthdat.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/interpreter/dispatcher/dsobject.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/interpreter/dispatcher/dsopcode.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/interpreter/dispatcher/dsutils.c14
-rw-r--r--usr/src/uts/i86pc/io/acpica/interpreter/dispatcher/dswexec.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/interpreter/dispatcher/dswload.c7
-rw-r--r--usr/src/uts/i86pc/io/acpica/interpreter/dispatcher/dswscope.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/interpreter/dispatcher/dswstate.c6
-rw-r--r--usr/src/uts/i86pc/io/acpica/interpreter/executer/exconfig.c22
-rw-r--r--usr/src/uts/i86pc/io/acpica/interpreter/executer/exconvrt.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/interpreter/executer/excreate.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/interpreter/executer/exdump.c14
-rw-r--r--usr/src/uts/i86pc/io/acpica/interpreter/executer/exfield.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/interpreter/executer/exfldio.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/interpreter/executer/exmisc.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/interpreter/executer/exmutex.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/interpreter/executer/exnames.c6
-rw-r--r--usr/src/uts/i86pc/io/acpica/interpreter/executer/exoparg1.c4
-rw-r--r--usr/src/uts/i86pc/io/acpica/interpreter/executer/exoparg2.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/interpreter/executer/exoparg3.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/interpreter/executer/exoparg6.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/interpreter/executer/exprep.c6
-rw-r--r--usr/src/uts/i86pc/io/acpica/interpreter/executer/exregion.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/interpreter/executer/exresnte.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/interpreter/executer/exresolv.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/interpreter/executer/exresop.c4
-rw-r--r--usr/src/uts/i86pc/io/acpica/interpreter/executer/exstore.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/interpreter/executer/exstoren.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/interpreter/executer/exstorob.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/interpreter/executer/exsystem.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/interpreter/executer/exutils.c8
-rw-r--r--usr/src/uts/i86pc/io/acpica/interpreter/parser/psargs.c4
-rw-r--r--usr/src/uts/i86pc/io/acpica/interpreter/parser/psloop.c9
-rw-r--r--usr/src/uts/i86pc/io/acpica/interpreter/parser/psopcode.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/interpreter/parser/psparse.c27
-rw-r--r--usr/src/uts/i86pc/io/acpica/interpreter/parser/psscope.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/interpreter/parser/pstree.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/interpreter/parser/psutils.c6
-rw-r--r--usr/src/uts/i86pc/io/acpica/interpreter/parser/pswalk.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/interpreter/parser/psxface.c418
-rw-r--r--usr/src/uts/i86pc/io/acpica/namespace/nsaccess.c17
-rw-r--r--usr/src/uts/i86pc/io/acpica/namespace/nsalloc.c132
-rw-r--r--usr/src/uts/i86pc/io/acpica/namespace/nsdump.c14
-rw-r--r--usr/src/uts/i86pc/io/acpica/namespace/nsdumpdv.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/namespace/nseval.c12
-rw-r--r--usr/src/uts/i86pc/io/acpica/namespace/nsinit.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/namespace/nsload.c47
-rw-r--r--usr/src/uts/i86pc/io/acpica/namespace/nsnames.c4
-rw-r--r--usr/src/uts/i86pc/io/acpica/namespace/nsobject.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/namespace/nsparse.c4
-rw-r--r--usr/src/uts/i86pc/io/acpica/namespace/nssearch.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/namespace/nsutils.c14
-rw-r--r--usr/src/uts/i86pc/io/acpica/namespace/nswalk.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/namespace/nsxfeval.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/namespace/nsxfname.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/namespace/nsxfobj.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/osl.c94
-rw-r--r--usr/src/uts/i86pc/io/acpica/resources/rsaddr.c1380
-rw-r--r--usr/src/uts/i86pc/io/acpica/resources/rscalc.c859
-rw-r--r--usr/src/uts/i86pc/io/acpica/resources/rscreate.c48
-rw-r--r--usr/src/uts/i86pc/io/acpica/resources/rsdump.c1355
-rw-r--r--usr/src/uts/i86pc/io/acpica/resources/rsinfo.c299
-rw-r--r--usr/src/uts/i86pc/io/acpica/resources/rsio.c478
-rw-r--r--usr/src/uts/i86pc/io/acpica/resources/rsirq.c504
-rw-r--r--usr/src/uts/i86pc/io/acpica/resources/rslist.c571
-rw-r--r--usr/src/uts/i86pc/io/acpica/resources/rsmemory.c497
-rw-r--r--usr/src/uts/i86pc/io/acpica/resources/rsmisc.c569
-rw-r--r--usr/src/uts/i86pc/io/acpica/resources/rsutils.c492
-rw-r--r--usr/src/uts/i86pc/io/acpica/resources/rsxface.c34
-rw-r--r--usr/src/uts/i86pc/io/acpica/tables/tbconvrt.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/tables/tbget.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/tables/tbgetall.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/tables/tbinstal.c25
-rw-r--r--usr/src/uts/i86pc/io/acpica/tables/tbrsdt.c4
-rw-r--r--usr/src/uts/i86pc/io/acpica/tables/tbutils.c79
-rw-r--r--usr/src/uts/i86pc/io/acpica/tables/tbxface.c18
-rw-r--r--usr/src/uts/i86pc/io/acpica/tables/tbxfroot.c8
-rw-r--r--usr/src/uts/i86pc/io/acpica/utilities/utalloc.c12
-rw-r--r--usr/src/uts/i86pc/io/acpica/utilities/utcache.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/utilities/utclib.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/utilities/utcopy.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/utilities/utdebug.c83
-rw-r--r--usr/src/uts/i86pc/io/acpica/utilities/utdelete.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/utilities/uteval.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/utilities/utglobal.c5
-rw-r--r--usr/src/uts/i86pc/io/acpica/utilities/utinit.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/utilities/utmath.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/utilities/utmisc.c98
-rw-r--r--usr/src/uts/i86pc/io/acpica/utilities/utmutex.c6
-rw-r--r--usr/src/uts/i86pc/io/acpica/utilities/utobject.c2
-rw-r--r--usr/src/uts/i86pc/io/acpica/utilities/utstate.c4
-rw-r--r--usr/src/uts/i86pc/io/acpica/utilities/utxface.c2
-rw-r--r--usr/src/uts/i86pc/io/psm/psm_common.c83
-rw-r--r--usr/src/uts/intel/sys/acpi/acconfig.h6
-rw-r--r--usr/src/uts/intel/sys/acpi/acdebug.h2
-rw-r--r--usr/src/uts/intel/sys/acpi/acdisasm.h38
-rw-r--r--usr/src/uts/intel/sys/acpi/acdispat.h8
-rw-r--r--usr/src/uts/intel/sys/acpi/acevents.h2
-rw-r--r--usr/src/uts/intel/sys/acpi/acexcep.h2
-rw-r--r--usr/src/uts/intel/sys/acpi/acglobal.h10
-rw-r--r--usr/src/uts/intel/sys/acpi/achware.h2
-rw-r--r--usr/src/uts/intel/sys/acpi/acinterp.h2
-rw-r--r--usr/src/uts/intel/sys/acpi/aclocal.h68
-rw-r--r--usr/src/uts/intel/sys/acpi/acmacros.h67
-rw-r--r--usr/src/uts/intel/sys/acpi/acnames.h11
-rw-r--r--usr/src/uts/intel/sys/acpi/acnamesp.h4
-rw-r--r--usr/src/uts/intel/sys/acpi/acobject.h2
-rw-r--r--usr/src/uts/intel/sys/acpi/acopcode.h2
-rw-r--r--usr/src/uts/intel/sys/acpi/acoutput.h2
-rw-r--r--usr/src/uts/intel/sys/acpi/acparser.h9
-rw-r--r--usr/src/uts/intel/sys/acpi/acpi.h2
-rw-r--r--usr/src/uts/intel/sys/acpi/acpixf.h7
-rw-r--r--usr/src/uts/intel/sys/acpi/acresrc.h487
-rw-r--r--usr/src/uts/intel/sys/acpi/acstruct.h5
-rw-r--r--usr/src/uts/intel/sys/acpi/actables.h8
-rw-r--r--usr/src/uts/intel/sys/acpi/actbl.h2
-rw-r--r--usr/src/uts/intel/sys/acpi/actbl1.h2
-rw-r--r--usr/src/uts/intel/sys/acpi/actbl2.h4
-rw-r--r--usr/src/uts/intel/sys/acpi/actypes.h229
-rw-r--r--usr/src/uts/intel/sys/acpi/acutils.h29
-rw-r--r--usr/src/uts/intel/sys/acpi/amlcode.h2
-rw-r--r--usr/src/uts/intel/sys/acpi/amlresrc.h306
-rw-r--r--usr/src/uts/intel/sys/acpi/platform/acdos16.h2
-rw-r--r--usr/src/uts/intel/sys/acpi/platform/acefi.h2
-rw-r--r--usr/src/uts/intel/sys/acpi/platform/acenv.h21
-rw-r--r--usr/src/uts/intel/sys/acpi/platform/acfreebsd.h2
-rw-r--r--usr/src/uts/intel/sys/acpi/platform/acgcc.h2
-rw-r--r--usr/src/uts/intel/sys/acpi/platform/acintel.h5
-rw-r--r--usr/src/uts/intel/sys/acpi/platform/aclinux.h2
-rw-r--r--usr/src/uts/intel/sys/acpi/platform/acmsvc.h2
-rw-r--r--usr/src/uts/intel/sys/acpi/platform/acnetbsd.h2
-rw-r--r--usr/src/uts/intel/sys/acpi/platform/acwin.h5
-rw-r--r--usr/src/uts/intel/sys/acpi/platform/acwin64.h2
166 files changed, 5588 insertions, 5213 deletions
diff --git a/usr/src/common/util/string.c b/usr/src/common/util/string.c
index e7ce13f19f..fe2388925d 100644
--- a/usr/src/common/util/string.c
+++ b/usr/src/common/util/string.c
@@ -20,7 +20,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -65,7 +65,9 @@ vsnprintf(char *buf, size_t buflen, const char *fmt, va_list aargs)
{
uint64_t ul, tmp;
char *bufp = buf; /* current buffer pointer */
- int pad, width, ells, base, sign, c;
+ int pad, width, base, sign, c, num;
+ int prec, h_count, l_count, dot_count;
+ int pad_count, transfer_count, left_align;
char *digits, *sp, *bs;
char numbuf[65]; /* sufficient for a 64-bit binary value */
va_list args;
@@ -84,28 +86,64 @@ vsnprintf(char *buf, size_t buflen, const char *fmt, va_list aargs)
continue;
}
+ width = prec = 0;
+ left_align = base = sign = 0;
+ h_count = l_count = dot_count = 0;
+ pad = ' ';
+ digits = "0123456789abcdef";
+next_fmt:
if ((c = *fmt++) == '\0')
break;
- for (pad = ' '; c == '0'; c = *fmt++)
- pad = '0';
-
- for (width = 0; c >= '0' && c <= '9'; c = *fmt++)
- width = width * 10 + c - '0';
-
- for (ells = 0; c == 'l'; c = *fmt++)
- ells++;
-
- digits = "0123456789abcdef";
-
if (c >= 'A' && c <= 'Z') {
c += 'a' - 'A';
digits = "0123456789ABCDEF";
}
- base = sign = 0;
-
switch (c) {
+ case '-':
+ left_align++;
+ goto next_fmt;
+ case '0':
+ if (dot_count == 0)
+ pad = '0';
+ /*FALLTHROUGH*/
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ num = 0;
+ for (;;) {
+ num = 10 * num + c - '0';
+ c = *fmt;
+ if (c < '0' || c > '9')
+ break;
+ else
+ fmt++;
+ }
+ if (dot_count > 0)
+ prec = num;
+ else
+ width = num;
+
+ goto next_fmt;
+ case '.':
+ dot_count++;
+ goto next_fmt;
+ case '*':
+ width = (int)va_arg(args, int);
+ goto next_fmt;
+ case 'l':
+ l_count++;
+ goto next_fmt;
+ case 'h':
+ h_count++;
+ goto next_fmt;
case 'd':
sign = 1;
/*FALLTHROUGH*/
@@ -113,7 +151,7 @@ vsnprintf(char *buf, size_t buflen, const char *fmt, va_list aargs)
base = 10;
break;
case 'p':
- ells = 1;
+ l_count = 1;
/*FALLTHROUGH*/
case 'x':
base = 16;
@@ -122,19 +160,49 @@ vsnprintf(char *buf, size_t buflen, const char *fmt, va_list aargs)
base = 8;
break;
case 'b':
- ells = 0;
+ l_count = 0;
base = 1;
break;
case 'c':
- ul = (int64_t)va_arg(args, int);
- ADDCHAR((int)ul & 0xff);
+ c = (char)va_arg(args, char);
+ ADDCHAR(c);
break;
case 's':
sp = va_arg(args, char *);
- if (sp == NULL)
+ if (sp == NULL) {
sp = "<null string>";
- while ((c = *sp++) != 0)
- ADDCHAR(c);
+ /* avoid truncation */
+ prec = strlen(sp);
+ }
+ /*
+ * Handle simple case specially to avoid
+ * performance hit of strlen()
+ */
+ if (prec == 0 && width == 0) {
+ while ((c = *sp++) != 0)
+ ADDCHAR(c);
+ break;
+ }
+ transfer_count = strlen(sp);
+ if (prec > 0) {
+ /* trim string if too long */
+ if (transfer_count > prec)
+ transfer_count = prec;
+ /* widen field if too narrow */
+ if (prec > width)
+ width = prec;
+ }
+ if (width > transfer_count)
+ pad_count = width - transfer_count;
+ else
+ pad_count = 0;
+ while ((!left_align) && (pad_count-- > 0))
+ ADDCHAR(' ');
+ /* ADDCHAR() evaluates arg at most once */
+ while (transfer_count-- > 0)
+ ADDCHAR(*sp++);
+ while ((left_align) && (pad_count-- > 0))
+ ADDCHAR(' ');
break;
case '%':
ADDCHAR('%');
@@ -144,30 +212,49 @@ vsnprintf(char *buf, size_t buflen, const char *fmt, va_list aargs)
if (base == 0)
continue;
- if (ells == 0)
- ul = (int64_t)va_arg(args, int);
- else if (ells == 1)
- ul = (int64_t)va_arg(args, long);
- else
- ul = (int64_t)va_arg(args, int64_t);
+ if (h_count == 0 && l_count == 0)
+ if (sign)
+ ul = (int64_t)va_arg(args, int);
+ else
+ ul = (int64_t)va_arg(args, unsigned int);
+ else if (l_count > 1)
+ if (sign)
+ ul = (int64_t)va_arg(args, int64_t);
+ else
+ ul = (int64_t)va_arg(args, uint64_t);
+ else if (l_count > 0)
+ if (sign)
+ ul = (int64_t)va_arg(args, long);
+ else
+ ul = (int64_t)va_arg(args, unsigned long);
+ else if (h_count > 1)
+ if (sign)
+ ul = (int64_t)va_arg(args, char);
+ else
+ ul = (int64_t)va_arg(args, unsigned char);
+ else if (h_count > 0)
+ if (sign)
+ ul = (int64_t)va_arg(args, short);
+ else
+ ul = (int64_t)va_arg(args, unsigned short);
if (sign && (int64_t)ul < 0)
ul = -ul;
else
sign = 0;
- if (ells < 8 / sizeof (long))
- ul &= 0xffffffffU;
-
if (c == 'b') {
bs = va_arg(args, char *);
base = *bs++;
}
- tmp = ul;
- do {
- width--;
- } while ((tmp /= base) != 0);
+ /* avoid repeated division if width is 0 */
+ if (width > 0) {
+ tmp = ul;
+ do {
+ width--;
+ } while ((tmp /= base) != 0);
+ }
if (sign && pad == '0')
ADDCHAR('-');
diff --git a/usr/src/uts/i86pc/Makefile.files b/usr/src/uts/i86pc/Makefile.files
index decb338f52..6bd4c546bb 100644
--- a/usr/src/uts/i86pc/Makefile.files
+++ b/usr/src/uts/i86pc/Makefile.files
@@ -182,7 +182,7 @@ ACPICA_OBJS += dbcmds.o dbdisply.o \
nsload.o nsnames.o nsobject.o nsparse.o nssearch.o \
nsutils.o nswalk.o nsxfeval.o nsxfname.o nsxfobj.o \
rsaddr.o rscalc.o rscreate.o rsdump.o \
- rsio.o rsirq.o rslist.o rsmemory.o rsmisc.o \
+ rsinfo.o rsio.o rsirq.o rslist.o rsmemory.o rsmisc.o \
rsutils.o rsxface.o tbconvrt.o tbget.o tbgetall.o \
tbinstal.o tbrsdt.o tbutils.o tbxface.o tbxfroot.o \
utalloc.o utclib.o utcopy.o utdebug.o utdelete.o \
diff --git a/usr/src/uts/i86pc/acpica/Makefile b/usr/src/uts/i86pc/acpica/Makefile
index da07e83fe4..0b63fc0ad9 100644
--- a/usr/src/uts/i86pc/acpica/Makefile
+++ b/usr/src/uts/i86pc/acpica/Makefile
@@ -39,7 +39,7 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_ITUFILE)
#
# Overrides.
#
-DEBUG_FLGS =
+$(NOT_RELEASE_BUILD)DEBUG_FLGS = -DACPI_DEBUG_OUTPUT
DEBUG_DEFS += $(DEBUG_FLGS)
#
diff --git a/usr/src/uts/i86pc/io/acpica/acpi_enum.c b/usr/src/uts/i86pc/io/acpica/acpi_enum.c
index 0d18c988bf..0addd2aed6 100644
--- a/usr/src/uts/i86pc/io/acpica/acpi_enum.c
+++ b/usr/src/uts/i86pc/io/acpica/acpi_enum.c
@@ -135,7 +135,7 @@ parse_resources_irq(ACPI_RESOURCE *resource_ptr, int *interrupt_count)
int i;
ACPI_RESOURCE_IRQ irq = resource_ptr->Data.Irq;
- for (i = 0; i < irq.NumberOfInterrupts; i++) {
+ for (i = 0; i < irq.InterruptCount; i++) {
interrupt[(*interrupt_count)++] =
irq.Interrupts[i];
used_interrupts |= 1 << irq.Interrupts[i];
@@ -153,7 +153,7 @@ parse_resources_dma(ACPI_RESOURCE *resource_ptr, int *dma_count)
int i;
ACPI_RESOURCE_DMA acpi_dma = resource_ptr->Data.Dma;
- for (i = 0; i < acpi_dma.NumberOfChannels; i++) {
+ for (i = 0; i < acpi_dma.ChannelCount; i++) {
dma[(*dma_count)++] = acpi_dma.Channels[i];
used_dmas |= 1 << acpi_dma.Channels[i];
if (acpi_enum_debug & PARSE_RES_DMA) {
@@ -171,25 +171,25 @@ parse_resources_io(ACPI_RESOURCE *resource_ptr, struct regspec *io,
ACPI_RESOURCE_IO acpi_io = resource_ptr->Data.Io;
io[*io_count].regspec_bustype = 1; /* io */
- io[*io_count].regspec_size = acpi_io.RangeLength;
+ io[*io_count].regspec_size = acpi_io.AddressLength;
/* When Min equals Max, IO is 32-bit */
- if (acpi_io.MinBaseAddress == acpi_io.MaxBaseAddress) {
+ if (acpi_io.Minimum == acpi_io.Maximum) {
io[*io_count].regspec_addr =
- acpi_io.MinBaseAddress;
+ acpi_io.Minimum;
} else {
/* else IO is 10-bit ISA */
io[*io_count].regspec_addr =
- acpi_io.MinBaseAddress & 0x3FF;
+ acpi_io.Minimum & 0x3FF;
cmn_err(CE_NOTE,
- "!ACPI source type ACPI_RSTYPE_IO"\
+ "!ACPI source type ACPI_RESOURCE_TYPE_IO"\
"10-bit ISA range not supported");
}
if (acpi_enum_debug & PARSE_RES_IO) {
cmn_err(CE_NOTE, "parse_resources() "\
"IO min 0x%X, max 0x%X, length: 0x%X",
- acpi_io.MinBaseAddress,
- acpi_io.MaxBaseAddress,
- acpi_io.RangeLength);
+ acpi_io.Minimum,
+ acpi_io.Maximum,
+ acpi_io.AddressLength);
}
(*io_count)++;
}
@@ -201,12 +201,12 @@ parse_resources_fixed_io(ACPI_RESOURCE *resource_ptr, struct regspec *io,
ACPI_RESOURCE_FIXED_IO fixed_io = resource_ptr->Data.FixedIo;
io[*io_count].regspec_bustype = 1; /* io */
- io[*io_count].regspec_addr = fixed_io.BaseAddress;
- io[*io_count].regspec_size = fixed_io.RangeLength;
+ io[*io_count].regspec_addr = fixed_io.Address;
+ io[*io_count].regspec_size = fixed_io.AddressLength;
if (acpi_enum_debug & PARSE_RES_IO) {
cmn_err(CE_NOTE, "parse_resources() "\
"Fixed IO 0x%X, length: 0x%X",
- fixed_io.BaseAddress, fixed_io.RangeLength);
+ fixed_io.Address, fixed_io.AddressLength);
}
(*io_count)++;
}
@@ -215,16 +215,16 @@ static void
parse_resources_fixed_mem32(ACPI_RESOURCE *resource_ptr, struct regspec *io,
int *io_count)
{
- ACPI_RESOURCE_FIXED_MEM32 fixed_mem32 =
+ ACPI_RESOURCE_FIXED_MEMORY32 fixed_mem32 =
resource_ptr->Data.FixedMemory32;
io[*io_count].regspec_bustype = 0; /* memory */
- io[*io_count].regspec_addr = fixed_mem32.RangeBaseAddress;
- io[*io_count].regspec_size = fixed_mem32.RangeLength;
+ io[*io_count].regspec_addr = fixed_mem32.Address;
+ io[*io_count].regspec_size = fixed_mem32.AddressLength;
if (acpi_enum_debug & PARSE_RES_MEMORY) {
cmn_err(CE_NOTE, "parse_resources() "\
"Fixed Mem 32 %ul, length: %ul",
- fixed_mem32.RangeBaseAddress, fixed_mem32.RangeLength);
+ fixed_mem32.Address, fixed_mem32.AddressLength);
}
(*io_count)++;
}
@@ -233,18 +233,18 @@ static void
parse_resources_mem32(ACPI_RESOURCE *resource_ptr, struct regspec *io,
int *io_count)
{
- ACPI_RESOURCE_MEM32 mem32 = resource_ptr->Data.Memory32;
+ ACPI_RESOURCE_MEMORY32 mem32 = resource_ptr->Data.Memory32;
- if (resource_ptr->Data.Memory32.MinBaseAddress ==
- resource_ptr->Data.Memory32.MaxBaseAddress) {
+ if (resource_ptr->Data.Memory32.Minimum ==
+ resource_ptr->Data.Memory32.Maximum) {
io[*io_count].regspec_bustype = 0; /* memory */
- io[*io_count].regspec_addr = mem32.MinBaseAddress;
- io[*io_count].regspec_size = mem32.RangeLength;
+ io[*io_count].regspec_addr = mem32.Minimum;
+ io[*io_count].regspec_size = mem32.AddressLength;
(*io_count)++;
if (acpi_enum_debug & PARSE_RES_MEMORY) {
cmn_err(CE_NOTE, "parse_resources() "\
"Mem 32 0x%X, length: 0x%X",
- mem32.MinBaseAddress, mem32.RangeLength);
+ mem32.Minimum, mem32.AddressLength);
}
return;
}
@@ -252,8 +252,8 @@ parse_resources_mem32(ACPI_RESOURCE *resource_ptr, struct regspec *io,
cmn_err(CE_NOTE, "parse_resources() "\
"MEM32 Min Max not equal!");
cmn_err(CE_NOTE, "parse_resources() "\
- "Mem 32 MinBaseAddress 0x%X, MaxBaseAddress: 0x%X",
- mem32.MinBaseAddress, mem32.MaxBaseAddress);
+ "Mem 32 Minimum 0x%X, Maximum: 0x%X",
+ mem32.Minimum, mem32.Maximum);
}
}
@@ -279,15 +279,15 @@ parse_resources_addr16(ACPI_RESOURCE *resource_ptr, struct regspec *io,
"%s "\
"MinAddressFixed 0x%X, "\
"MaxAddressFixed 0x%X, "\
- "MinAddressRange 0x%X, "\
- "MaxAddressRange 0x%X, "\
+ "Minimum 0x%X, "\
+ "Maximum 0x%X, "\
"length: 0x%X\n",
addr16.ProducerConsumer == ACPI_CONSUMER ?
"CONSUMER" : "PRODUCER",
addr16.MinAddressFixed,
addr16.MaxAddressFixed,
- addr16.MinAddressRange,
- addr16.MaxAddressRange,
+ addr16.Minimum,
+ addr16.Maximum,
addr16.AddressLength);
}
if (addr16.ResourceType != ACPI_MEMORY_RANGE &&
@@ -302,7 +302,7 @@ parse_resources_addr16(ACPI_RESOURCE *resource_ptr, struct regspec *io,
/* io */
io[*io_count].regspec_bustype = 1;
}
- io[*io_count].regspec_addr = addr16.MinAddressRange;
+ io[*io_count].regspec_addr = addr16.Minimum;
io[*io_count].regspec_size = addr16.AddressLength;
(*io_count)++;
}
@@ -330,15 +330,15 @@ parse_resources_addr32(ACPI_RESOURCE *resource_ptr, struct regspec *io,
"%s "\
"MinAddressFixed 0x%X, "\
"MaxAddressFixed 0x%X, "\
- "MinAddressRange 0x%X, "\
- "MaxAddressRange 0x%X, "\
+ "Minimum 0x%X, "\
+ "Maximum 0x%X, "\
"length: 0x%X\n",
addr32.ProducerConsumer == ACPI_CONSUMER ?
"CONSUMER" : "PRODUCER",
addr32.MinAddressFixed,
addr32.MaxAddressFixed,
- addr32.MinAddressRange,
- addr32.MaxAddressRange,
+ addr32.Minimum,
+ addr32.Maximum,
addr32.AddressLength);
}
if (addr32.ResourceType != ACPI_MEMORY_RANGE &&
@@ -353,7 +353,7 @@ parse_resources_addr32(ACPI_RESOURCE *resource_ptr, struct regspec *io,
/* io */
io[*io_count].regspec_bustype = 1;
}
- io[*io_count].regspec_addr = addr32.MinAddressRange;
+ io[*io_count].regspec_addr = addr32.Minimum;
io[*io_count].regspec_size = addr32.AddressLength;
(*io_count)++;
}
@@ -382,24 +382,24 @@ parse_resources_addr64(ACPI_RESOURCE *resource_ptr, struct regspec *io,
"%s "\
"MinAddressFixed 0x%X, "\
"MaxAddressFixed 0x%X, "\
- "MinAddressRange 0x%lX, "\
- "MaxAddressRange 0x%lX, "\
+ "Minimum 0x%lX, "\
+ "Maximum 0x%lX, "\
"length: 0x%lX\n",
#else
cmn_err(CE_NOTE, "parse_resources() "\
"%s "\
"MinAddressFixed 0x%X, "\
"MaxAddressFixed 0x%X, "\
- "MinAddressRange 0x%llX, "\
- "MaxAddressRange 0x%llX, "\
+ "Minimum 0x%llX, "\
+ "Maximum 0x%llX, "\
"length: 0x%llX\n",
#endif
addr64.ProducerConsumer == ACPI_CONSUMER ?
"CONSUMER" : "PRODUCER",
addr64.MinAddressFixed,
addr64.MaxAddressFixed,
- addr64.MinAddressRange,
- addr64.MaxAddressRange,
+ addr64.Minimum,
+ addr64.Maximum,
addr64.AddressLength);
}
if (addr64.ResourceType != ACPI_MEMORY_RANGE &&
@@ -414,7 +414,7 @@ parse_resources_addr64(ACPI_RESOURCE *resource_ptr, struct regspec *io,
/* io */
io[*io_count].regspec_bustype = 1;
}
- io[*io_count].regspec_addr = addr64.MinAddressRange;
+ io[*io_count].regspec_addr = addr64.Minimum;
io[*io_count].regspec_size = addr64.AddressLength;
(*io_count)++;
}
@@ -446,68 +446,73 @@ parse_resources(ACPI_HANDLE handle, dev_info_t *xdip)
}
resource_ptr = (ACPI_RESOURCE *)current_ptr;
current_ptr += resource_ptr->Length;
- switch (resource_ptr->Id) {
- case ACPI_RSTYPE_END_TAG:
+ switch (resource_ptr->Type) {
+ case ACPI_RESOURCE_TYPE_END_TAG:
current_ptr = last_ptr;
break;
- case ACPI_RSTYPE_IO:
+ case ACPI_RESOURCE_TYPE_IO:
parse_resources_io(resource_ptr, io, &io_count);
break;
- case ACPI_RSTYPE_FIXED_IO:
+ case ACPI_RESOURCE_TYPE_FIXED_IO:
parse_resources_fixed_io(resource_ptr, io, &io_count);
break;
- case ACPI_RSTYPE_FIXED_MEM32:
+ case ACPI_RESOURCE_TYPE_FIXED_MEMORY32:
parse_resources_fixed_mem32(resource_ptr, io,
&io_count);
break;
- case ACPI_RSTYPE_MEM32:
+ case ACPI_RESOURCE_TYPE_MEMORY32:
parse_resources_mem32(resource_ptr, io, &io_count);
break;
- case ACPI_RSTYPE_ADDRESS16:
+ case ACPI_RESOURCE_TYPE_ADDRESS16:
parse_resources_addr16(resource_ptr, io, &io_count);
break;
- case ACPI_RSTYPE_ADDRESS32:
+ case ACPI_RESOURCE_TYPE_ADDRESS32:
parse_resources_addr32(resource_ptr, io, &io_count);
break;
- case ACPI_RSTYPE_ADDRESS64:
+ case ACPI_RESOURCE_TYPE_ADDRESS64:
parse_resources_addr64(resource_ptr, io, &io_count);
break;
- case ACPI_RSTYPE_IRQ:
+ case ACPI_RESOURCE_TYPE_IRQ:
parse_resources_irq(resource_ptr, &interrupt_count);
break;
- case ACPI_RSTYPE_DMA:
+ case ACPI_RESOURCE_TYPE_DMA:
parse_resources_dma(resource_ptr, &dma_count);
break;
- case ACPI_RSTYPE_START_DPF:
+ case ACPI_RESOURCE_TYPE_START_DEPENDENT:
cmn_err(CE_NOTE,
- "!ACPI source type ACPI_RSTYPE_START_DPF not "\
- "supported");
+ "!ACPI source type"
+ " ACPI_RESOURCE_TYPE_START_DEPENDENT"
+ " not supported");
break;
- case ACPI_RSTYPE_END_DPF:
+ case ACPI_RESOURCE_TYPE_END_DEPENDENT:
cmn_err(CE_NOTE,
- "!ACPI source type ACPI_RSTYPE_END_DPF not "\
- "supported");
+ "!ACPI source type"
+ " ACPI_RESOURCE_TYPE_END_DEPENDENT"
+ " not supported");
break;
- case ACPI_RSTYPE_VENDOR:
+ case ACPI_RESOURCE_TYPE_VENDOR:
cmn_err(CE_NOTE,
- "!ACPI source type ACPI_RSTYPE_VENDOR not "\
- "supported");
+ "!ACPI source type"
+ " ACPI_RESOURCE_TYPE_VENDOR"
+ " not supported");
break;
- case ACPI_RSTYPE_MEM24:
+ case ACPI_RESOURCE_TYPE_MEMORY24:
cmn_err(CE_NOTE,
- "!ACPI source type ACPI_RSTYPE_MEM24 not "\
- "supported");
+ "!ACPI source type"
+ " ACPI_RESOURCE_TYPE_MEMORY24"
+ " not supported");
break;
- case ACPI_RSTYPE_EXT_IRQ:
+ case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
cmn_err(CE_NOTE,
- "!ACPI source type ACPI_RSTYPE_EXT_IRQ not "\
- "supported");
+ "!ACPI source type"
+ " ACPI_RESOURCE_TYPE_EXT_IRQ"
+ " not supported");
break;
default:
/* Some types are not yet implemented (See CA 6.4) */
cmn_err(CE_NOTE,
"!ACPI resource type (0X%X) not yet supported",
- resource_ptr->Id);
+ resource_ptr->Type);
break;
}
}
diff --git a/usr/src/uts/i86pc/io/acpica/acpica.c b/usr/src/uts/i86pc/io/acpica/acpica.c
index d2e478522e..0540400a3f 100644
--- a/usr/src/uts/i86pc/io/acpica/acpica.c
+++ b/usr/src/uts/i86pc/io/acpica/acpica.c
@@ -120,23 +120,11 @@ _info(struct modinfo *modinfop)
int
_fini(void)
{
- int status;
- extern int intr_hooked;
-
- status = AcpiTerminate();
- if (status != AE_OK) {
- cmn_err(CE_WARN, "!acpica: error terminating: %d", status);
- return (EBUSY);
- }
-
- if (intr_hooked) {
- /* also note this error; terminate should have detached intr */
- cmn_err(CE_WARN, "!acpica: error terminating: SCI attached");
- return (EBUSY);
- }
-
- mutex_destroy(&acpica_module_lock);
- return (mod_remove(&modlinkage));
+ /*
+ * acpica module is never unloaded at run-time; there's always
+ * a PSM depending on it, at the very least
+ */
+ return (EBUSY);
}
/*
diff --git a/usr/src/uts/i86pc/io/acpica/changes.txt b/usr/src/uts/i86pc/io/acpica/changes.txt
index 9b14b07b5c..ff34cb7ee0 100644
--- a/usr/src/uts/i86pc/io/acpica/changes.txt
+++ b/usr/src/uts/i86pc/io/acpica/changes.txt
@@ -1,4 +1,287 @@
----------------------------------------
+30 September 2005. Summary of changes for version 20050930:
+
+1) ACPI CA Core Subsystem:
+
+Completed a major overhaul of the Resource Manager code -
+specifically, optimizations in the area of the AML/internal
+resource conversion code. The code has been optimized to simplify
+and eliminate duplicated code, CPU stack use has been decreased
+by optimizing function parameters and local variables, and naming
+conventions across the manager have been standardized for clarity
+and ease of maintenance (this includes function, parameter,
+variable, and struct/typedef names.) The update may force changes
+in some driver code, depending on how resources are handled by
+the host OS.
+
+All Resource Manager dispatch and information tables have been
+moved to a single location for clarity and ease of maintenance.
+One new file was created, named "rsinfo.c".
+
+The ACPI return macros (return_ACPI_STATUS, etc.) have been
+modified to guarantee that the argument is not evaluated twice,
+making them less prone to macro side-effects. However, since
+there exists the possibility of additional stack use if a
+particular compiler cannot optimize them (such as in the debug
+generation case), the original macros are optionally available.
+Note that some invocations of the return_VALUE macro may now
+cause size mismatch warnings; the return_UINT8 and return_UINT32
+macros are provided to eliminate these. (From Randy Dunlap)
+
+Implemented a new mechanism to enable debug tracing for
+individual control methods. A new external interface,
+AcpiDebugTrace, is provided to enable this mechanism. The intent
+is to allow the host OS to easily enable and disable tracing for
+problematic control methods. This interface can be easily exposed
+to a user or debugger interface if desired. See the file
+psxface.c for details.
+
+AcpiUtCallocate will now return a valid pointer if a length of
+zero is specified - a length of one is used and a warning is
+issued. This matches the behavior of AcpiUtAllocate.
+
+Code and Data Size: The current and previous library sizes for
+the core subsystem are shown below. These are the code and data
+sizes for the acpica.lib produced by the Microsoft Visual C++ 6.0
+32-bit compiler. These values do not include any ACPI driver or
+OSPM code. The debug version of the code includes the debug
+output trace mechanism and has a much larger code and data size.
+Note that these values will vary depending on the efficiency of
+the compiler and the compiler options used during generation.
+
+ Previous Release:
+ Non-Debug Version: 77.5K Code, 12.0K Data, 89.5K Total
+ Debug Version: 168.1K Code, 68.4K Data, 236.5K Total
+ Current Release:
+ Non-Debug Version: 77.1K Code, 12.1K Data, 89.2K Total
+ Debug Version: 168.0K Code, 68.3K Data, 236.3K Total
+
+
+2) iASL Compiler/Disassembler:
+
+A remark is issued if the effective compile-time length of a
+package or buffer is zero. Previously, this was a warning.
+
+----------------------------------------
+16 September 2005. Summary of changes for version 20050916:
+
+1) ACPI CA Core Subsystem:
+
+Fixed a problem within the Resource Manager where support for the
+Generic Register descriptor was not fully implemented. This
+descriptor is now fully recognized, parsed, disassembled, and
+displayed.
+
+Completely restructured the Resource Manager code to utilize
+table-driven dispatch and lookup, eliminating many of the large
+switch() statements. This reduces overall subsystem code size and
+code complexity. Affects the resource parsing and construction,
+disassembly, and debug dump output.
+
+Cleaned up and restructured the debug dump output for all
+resource descriptors. Improved readability of the output and
+reduced code size.
+
+Fixed a problem where changes to internal data structures caused
+the optional ACPI_MUTEX_DEBUG code to fail compilation if
+specified.
+
+Code and Data Size: The current and previous library sizes for
+the core subsystem are shown below. These are the code and data
+sizes for the acpica.lib produced by the Microsoft Visual C++ 6.0
+32-bit compiler. These values do not include any ACPI driver or
+OSPM code. The debug version of the code includes the debug
+output trace mechanism and has a much larger code and data size.
+Note that these values will vary depending on the efficiency of
+the compiler and the compiler options used during generation.
+
+ Previous Release:
+ Non-Debug Version: 78.4K Code, 11.8K Data, 90.2K Total
+ Debug Version: 169.6K Code, 69.9K Data, 239.5K Total
+ Current Release:
+ Non-Debug Version: 77.5K Code, 12.0K Data, 89.5K Total
+ Debug Version: 168.1K Code, 68.4K Data, 236.5K Total
+
+
+2) iASL Compiler/Disassembler:
+
+Updated the disassembler to automatically insert an
+EndDependentFn() macro into the ASL stream if this macro is
+missing in the original AML code, simplifying compilation of the
+resulting ASL module.
+
+Fixed a problem in the disassembler where a disassembled
+ResourceSource string (within a large resource descriptor) was
+not surrounded by quotes and not followed by a comma, causing
+errors when the resulting ASL module was compiled. Also, escape
+sequences within a ResourceSource string are now handled
+correctly (especially "\\")
+
+----------------------------------------
+02 September 2005. Summary of changes for version 20050902:
+
+1) ACPI CA Core Subsystem:
+
+Fixed a problem with the internal Owner ID allocation and
+deallocation mechanisms for control method execution and
+recursive method invocation. This should eliminate the
+OWNER_ID_LIMIT exceptions and "Invalid OwnerId" messages seen on
+some systems. Recursive method invocation depth is currently
+limited to 255. (Alexey Starikovskiy)
+
+Completely eliminated all vestiges of support for the "module-
+level executable code" until this support is fully implemented
+and debugged. This should eliminate the NO_RETURN_VALUE
+exceptions seen during table load on some systems that invoke
+this support.
+
+Fixed a problem within the resource manager code where the
+transaction flags for a 64-bit address descriptor were handled
+incorrectly in the type-specific flag byte.
+
+Consolidated duplicate code within the address descriptor
+resource manager code, reducing overall subsystem code size.
+
+Fixed a fault when using the AML debugger "disassemble" command
+to disassemble individual control methods.
+
+Removed references to the "release_current" directory within the
+Unix release package.
+
+Code and Data Size: The current and previous core subsystem
+library sizes are shown below. These are the code and data sizes
+for the acpica.lib produced by the Microsoft Visual C++ 6.0
+compiler. These values do not include any ACPI driver or OSPM
+code. The debug version of the code includes the debug output
+trace mechanism and has a much larger code and data size. Note
+that these values will vary depending on the efficiency of the
+compiler and the compiler options used during generation.
+
+ Previous Release:
+ Non-Debug Version: 78.6K Code, 11.7K Data, 90.3K Total
+ Debug Version: 170.0K Code, 69.9K Data, 239.9K Total
+ Current Release:
+ Non-Debug Version: 78.4K Code, 11.8K Data, 90.2K Total
+ Debug Version: 169.6K Code, 69.9K Data, 239.5K Total
+
+
+2) iASL Compiler/Disassembler:
+
+Implemented an error check for illegal duplicate values in the
+interrupt and dma lists for the following ASL macros: Dma(),
+Irq(), IrqNoFlags(), and Interrupt().
+
+Implemented error checking for the Irq() and IrqNoFlags() macros
+to detect too many values in the interrupt list (16 max) and
+invalid values in the list (range 0 - 15)
+
+The maximum length string literal within an ASL file is now
+restricted to 200 characters as per the ACPI specification.
+
+Fixed a fault when using the -ln option (generate namespace
+listing).
+
+Implemented an error check to determine if a DescriptorName
+within a resource descriptor has already been used within the
+current scope.
+
+----------------------------------------
+15 August 2005. Summary of changes for version 20050815:
+
+1) ACPI CA Core Subsystem:
+
+Implemented a full bytewise compare to determine if a table load
+request is attempting to load a duplicate table. The compare is
+performed if the table signatures and table lengths match. This
+will allow different tables with the same OEM Table ID and
+revision to be loaded - probably against the ACPI specification,
+but discovered in the field nonetheless.
+
+Added the changes.txt logfile to each of the zipped release
+packages.
+
+Code and Data Size: Current and previous core subsystem library
+sizes are shown below. These are the code and data sizes for the
+acpica.lib produced by the Microsoft Visual C++ 6.0 compiler, and
+these values do not include any ACPI driver or OSPM code. The
+debug version of the code includes the debug output trace
+mechanism and has a much larger code and data size. Note that
+these values will vary depending on the efficiency of the
+compiler and the compiler options used during generation.
+
+ Previous Release:
+ Non-Debug Version: 78.6K Code, 11.7K Data, 90.3K Total
+ Debug Version: 167.0K Code, 69.9K Data, 236.9K Total
+ Current Release:
+ Non-Debug Version: 78.6K Code, 11.7K Data, 90.3K Total
+ Debug Version: 170.0K Code, 69.9K Data, 239.9K Total
+
+
+2) iASL Compiler/Disassembler:
+
+Fixed a problem where incorrect AML code could be generated for
+Package objects if optimization is disabled (via the -oa switch).
+
+Fixed a problem with where incorrect AML code is generated for
+variable-length packages when the package length is not specified
+and the number of initializer values is greater than 255.
+
+----------------------------------------
+29 July 2005. Summary of changes for version 20050729:
+
+1) ACPI CA Core Subsystem:
+
+Implemented support to ignore an attempt to install/load a
+particular ACPI table more than once. Apparently there exists
+BIOS code that repeatedly attempts to load the same SSDT upon
+certain events. With assistance from Venkatesh Pallipadi.
+
+Restructured the main interface to the AML parser in order to
+correctly handle all exceptional conditions. This will prevent
+leakage of the OwnerId resource and should eliminate the
+AE_OWNER_ID_LIMIT exceptions seen on some machines. With
+assistance from Alexey Starikovskiy.
+
+Support for "module level code" has been disabled in this version
+due to a number of issues that have appeared on various machines.
+The support can be enabled by defining
+ACPI_ENABLE_MODULE_LEVEL_CODE during subsystem compilation. When
+the issues are fully resolved, the code will be enabled by
+default again.
+
+Modified the internal functions for debug print support to define
+the FunctionName parameter as a (const char *) for compatibility
+with compiler built-in macros such as __FUNCTION__, etc.
+
+Linted the entire ACPICA source tree for both 32-bit and 64-bit.
+
+Implemented support to display an object count summary for the
+AML Debugger commands Object and Methods.
+
+Code and Data Size: Current and previous core subsystem library
+sizes are shown below. These are the code and data sizes for the
+acpica.lib produced by the Microsoft Visual C++ 6.0 compiler, and
+these values do not include any ACPI driver or OSPM code. The
+debug version of the code includes the debug output trace
+mechanism and has a much larger code and data size. Note that
+these values will vary depending on the efficiency of the
+compiler and the compiler options used during generation.
+
+ Previous Release:
+ Non-Debug Version: 78.6K Code, 11.6K Data, 90.2K Total
+ Debug Version: 170.0K Code, 69.7K Data, 239.7K Total
+ Current Release:
+ Non-Debug Version: 78.6K Code, 11.7K Data, 90.3K Total
+ Debug Version: 167.0K Code, 69.9K Data, 236.9K Total
+
+
+2) iASL Compiler/Disassembler:
+
+Fixed a regression that appeared in the 20050708 version of the
+compiler where an error message was inadvertently emitted for
+invocations of the _OSI reserved control method.
+
+----------------------------------------
08 July 2005. Summary of changes for version 20050708:
1) ACPI CA Core Subsystem:
diff --git a/usr/src/uts/i86pc/io/acpica/debugger/dbcmds.c b/usr/src/uts/i86pc/io/acpica/debugger/dbcmds.c
index 4ba5758a42..c3748af3c9 100644
--- a/usr/src/uts/i86pc/io/acpica/debugger/dbcmds.c
+++ b/usr/src/uts/i86pc/io/acpica/debugger/dbcmds.c
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: dbcmds - debug commands and output routines
- * $Revision: 127 $
+ * $Revision: 1.131 $
*
******************************************************************************/
@@ -720,7 +720,7 @@ AcpiDbDumpNamespace (
AcpiDbSetOutputDestination (ACPI_DB_DUPLICATE_OUTPUT);
AcpiOsPrintf ("ACPI Namespace (from %4.4s (%p) subtree):\n",
- &((ACPI_NAMESPACE_NODE *) SubtreeEntry)->Name, SubtreeEntry);
+ ((ACPI_NAMESPACE_NODE *) SubtreeEntry)->Name.Ascii, SubtreeEntry);
/* Display the subtree */
@@ -983,13 +983,12 @@ AcpiDbWalkForSpecificObjects (
void *Context,
void **ReturnValue)
{
- ACPI_OPERAND_OBJECT *ObjDesc;
- ACPI_STATUS Status;
+ ACPI_WALK_INFO *Info = (ACPI_WALK_INFO *) Context;
ACPI_BUFFER Buffer;
- ACPI_WALK_INFO Info;
+ ACPI_STATUS Status;
- ObjDesc = AcpiNsGetAttachedObject ((ACPI_NAMESPACE_NODE *) ObjHandle);
+ Info->Count++;
/* Get and display the full pathname to this object */
@@ -1001,62 +1000,13 @@ AcpiDbWalkForSpecificObjects (
return (AE_OK);
}
- Info.OwnerId = ACPI_OWNER_ID_MAX;
- Info.DebugLevel = ACPI_UINT32_MAX;
- Info.DisplayType = ACPI_DISPLAY_SUMMARY | ACPI_DISPLAY_SHORT;
-
AcpiOsPrintf ("%32s", (char *) Buffer.Pointer);
- AcpiNsDumpOneObject (ObjHandle, NestingLevel, &Info, NULL);
ACPI_MEM_FREE (Buffer.Pointer);
- return (AE_OK);
-
-#ifdef ACPI_OBSOLETE_CODE
- /* Display short information about the object */
-
- if (ObjDesc)
- {
- AcpiOsPrintf (" %p/%p", ObjHandle, ObjDesc);
- switch (ACPI_GET_OBJECT_TYPE (ObjDesc))
- {
- case ACPI_TYPE_METHOD:
- AcpiOsPrintf (" #Args %d Concurrency %X",
- ObjDesc->Method.ParamCount, ObjDesc->Method.Concurrency);
- break;
-
- case ACPI_TYPE_INTEGER:
- AcpiOsPrintf (" Value %8.8X%8.8X",
- ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value));
- break;
-
- case ACPI_TYPE_STRING:
- AcpiOsPrintf (" \"%s\"", ObjDesc->String.Pointer);
- break;
-
- case ACPI_TYPE_REGION:
- AcpiOsPrintf (" SpaceId %X Length %X Address %8.8X%8.8X",
- ObjDesc->Region.SpaceId,
- ObjDesc->Region.Length,
- ACPI_FORMAT_UINT64 (ObjDesc->Region.Address));
- break;
-
- case ACPI_TYPE_PACKAGE:
- AcpiOsPrintf (" #Elements %X", ObjDesc->Package.Count);
- break;
-
- case ACPI_TYPE_BUFFER:
- AcpiOsPrintf (" Length %X", ObjDesc->Buffer.Length);
- break;
-
- default:
- /* Ignore other object types */
- break;
- }
- }
+ /* Dump short info about the object */
- AcpiOsPrintf ("\n");
+ (void) AcpiNsDumpOneObject (ObjHandle, NestingLevel, Info, NULL);
return (AE_OK);
-#endif
}
@@ -1078,6 +1028,7 @@ AcpiDbDisplayObjects (
char *ObjTypeArg,
char *DisplayCountArg)
{
+ ACPI_WALK_INFO Info;
ACPI_OBJECT_TYPE Type;
@@ -1092,15 +1043,24 @@ AcpiDbDisplayObjects (
AcpiDbSetOutputDestination (ACPI_DB_DUPLICATE_OUTPUT);
AcpiOsPrintf (
- "Objects of type [%s] defined in the current ACPI Namespace: \n",
+ "Objects of type [%s] defined in the current ACPI Namespace:\n",
AcpiUtGetTypeName (Type));
AcpiDbSetOutputDestination (ACPI_DB_REDIRECTABLE_OUTPUT);
+ Info.Count = 0;
+ Info.OwnerId = ACPI_OWNER_ID_MAX;
+ Info.DebugLevel = ACPI_UINT32_MAX;
+ Info.DisplayType = ACPI_DISPLAY_SUMMARY | ACPI_DISPLAY_SHORT;
+
/* Walk the namespace from the root */
(void) AcpiWalkNamespace (Type, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
- AcpiDbWalkForSpecificObjects, (void *) &Type, NULL);
+ AcpiDbWalkForSpecificObjects, (void *) &Info, NULL);
+
+ AcpiOsPrintf (
+ "\nFound %u objects of type [%s] in the current ACPI Namespace\n",
+ Info.Count, AcpiUtGetTypeName (Type));
AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT);
return (AE_OK);
@@ -1164,7 +1124,7 @@ AcpiDbWalkAndMatchName (
Info.DisplayType = ACPI_DISPLAY_SUMMARY | ACPI_DISPLAY_SHORT;
AcpiOsPrintf ("%32s", (char *) Buffer.Pointer);
- AcpiNsDumpOneObject (ObjHandle, NestingLevel, &Info, NULL);
+ (void) AcpiNsDumpOneObject (ObjHandle, NestingLevel, &Info, NULL);
ACPI_MEM_FREE (Buffer.Pointer);
}
@@ -1640,7 +1600,7 @@ AcpiDbBusWalk (
if (ACPI_SUCCESS (Status))
{
AcpiOsPrintf (" _CID=%s", Cid->Id[0].Value);
- ACPI_MEM_FREE (Cid);
+ ACPI_MEM_FREE (Cid);
}
AcpiOsPrintf ("\n");
diff --git a/usr/src/uts/i86pc/io/acpica/debugger/dbdisply.c b/usr/src/uts/i86pc/io/acpica/debugger/dbdisply.c
index 19febcd35f..9275bea55c 100644
--- a/usr/src/uts/i86pc/io/acpica/debugger/dbdisply.c
+++ b/usr/src/uts/i86pc/io/acpica/debugger/dbdisply.c
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: dbdisply - debug display commands
- * $Revision: 111 $
+ * $Revision: 1.112 $
*
******************************************************************************/
@@ -845,7 +845,7 @@ AcpiDbDisplayGpes (
AcpiOsPrintf ("\nBlock %d - Info %p DeviceNode %p [%s]\n",
Block, GpeBlock, GpeBlock->Node, Buffer);
- AcpiOsPrintf (" Registers: %u (%u GPEs) \n",
+ AcpiOsPrintf (" Registers: %u (%u GPEs)\n",
GpeBlock->RegisterCount,
ACPI_MUL_8 (GpeBlock->RegisterCount));
diff --git a/usr/src/uts/i86pc/io/acpica/debugger/dbexec.c b/usr/src/uts/i86pc/io/acpica/debugger/dbexec.c
index c2ae03b9f3..1831cba601 100644
--- a/usr/src/uts/i86pc/io/acpica/debugger/dbexec.c
+++ b/usr/src/uts/i86pc/io/acpica/debugger/dbexec.c
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: dbexec - debugger control method execution
- * $Revision: 69 $
+ * $Revision: 1.70 $
*
******************************************************************************/
@@ -435,7 +435,7 @@ AcpiDbExecute (
* Allow any handlers in separate threads to complete.
* (Such as Notify handlers invoked from AML executed above).
*/
- AcpiOsSleep (10);
+ AcpiOsSleep ((ACPI_INTEGER) 10);
#ifdef ACPI_DEBUG_OUTPUT
diff --git a/usr/src/uts/i86pc/io/acpica/debugger/dbfileio.c b/usr/src/uts/i86pc/io/acpica/debugger/dbfileio.c
index 03b348ba18..95534a6d3e 100644
--- a/usr/src/uts/i86pc/io/acpica/debugger/dbfileio.c
+++ b/usr/src/uts/i86pc/io/acpica/debugger/dbfileio.c
@@ -2,7 +2,7 @@
*
* Module Name: dbfileio - Debugger file I/O commands. These can't usually
* be used when running the debugger in Ring 0 (Kernel mode)
- * $Revision: 82 $
+ * $Revision: 1.84 $
*
******************************************************************************/
@@ -316,7 +316,7 @@ AcpiDbReadTable (
fseek (fp, 0, SEEK_END);
- FileSize = ftell (fp);
+ FileSize = (UINT32) ftell (fp);
fseek (fp, 0, SEEK_SET);
/* Read the table header */
@@ -450,6 +450,13 @@ AeLocalLoadTable (
Status = AcpiTbInstallTable (&TableInfo);
if (ACPI_FAILURE (Status))
{
+ if (Status == AE_ALREADY_EXISTS)
+ {
+ /* Table already exists, no error */
+
+ Status = AE_OK;
+ }
+
/* Free table allocated by AcpiTbGetTable */
AcpiTbDeleteSingleTable (&TableInfo);
diff --git a/usr/src/uts/i86pc/io/acpica/debugger/dbhistry.c b/usr/src/uts/i86pc/io/acpica/debugger/dbhistry.c
index 009b9c0019..08806ecb20 100644
--- a/usr/src/uts/i86pc/io/acpica/debugger/dbhistry.c
+++ b/usr/src/uts/i86pc/io/acpica/debugger/dbhistry.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: dbhistry - debugger HISTORY command
- * $Revision: 32 $
+ * $Revision: 1.32 $
*
*****************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/debugger/dbinput.c b/usr/src/uts/i86pc/io/acpica/debugger/dbinput.c
index 9d638261a3..9768d5f9ff 100644
--- a/usr/src/uts/i86pc/io/acpica/debugger/dbinput.c
+++ b/usr/src/uts/i86pc/io/acpica/debugger/dbinput.c
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: dbinput - user front-end to the AML debugger
- * $Revision: 109 $
+ * $Revision: 1.111 $
*
******************************************************************************/
@@ -206,6 +206,7 @@ enum AcpiExDebuggerCommands
CMD_TABLES,
CMD_TERMINATE,
CMD_THREADS,
+ CMD_TRACE,
CMD_TREE,
CMD_TYPE,
CMD_UNLOAD
@@ -266,6 +267,7 @@ static const COMMAND_INFO AcpiGbl_DbCommands[] =
{"TABLES", 0},
{"TERMINATE", 0},
{"THREADS", 3},
+ {"TRACE", 1},
{"TREE", 0},
{"TYPE", 1},
{"UNLOAD", 1},
@@ -383,6 +385,7 @@ AcpiDbDisplayHelp (
AcpiOsPrintf ("Results Display method result stack\n");
AcpiOsPrintf ("Set <A|L> <#> <Value> Set method data (Arguments/Locals)\n");
AcpiOsPrintf ("Stop Terminate control method\n");
+ AcpiOsPrintf ("Trace <method name> Trace method execution\n");
AcpiOsPrintf ("Tree Display control method calling tree\n");
AcpiOsPrintf ("<Enter> Single step next AML opcode (over calls)\n");
return;
@@ -654,7 +657,7 @@ AcpiDbCommandDispatch (
break;
case CMD_DISASSEMBLE:
- AcpiDbDisassembleMethod (AcpiGbl_DbArgs[1]);
+ (void) AcpiDbDisassembleMethod (AcpiGbl_DbArgs[1]);
break;
case CMD_DUMP:
@@ -862,6 +865,10 @@ AcpiDbCommandDispatch (
AcpiGbl_DbArgs[3]);
break;
+ case CMD_TRACE:
+ AcpiDebugTrace (AcpiGbl_DbArgs[1],0,0,1);
+ break;
+
case CMD_TREE:
AcpiDbDisplayCallingTree ();
break;
diff --git a/usr/src/uts/i86pc/io/acpica/debugger/dbstats.c b/usr/src/uts/i86pc/io/acpica/debugger/dbstats.c
index 9bbd1aac2f..1049d2e019 100644
--- a/usr/src/uts/i86pc/io/acpica/debugger/dbstats.c
+++ b/usr/src/uts/i86pc/io/acpica/debugger/dbstats.c
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: dbstats - Generation and display of ACPI table statistics
- * $Revision: 78 $
+ * $Revision: 1.79 $
*
******************************************************************************/
@@ -141,6 +141,10 @@ AcpiDbClassifyOneObject (
void *Context,
void **ReturnValue);
+static void
+AcpiDbListInfo (
+ ACPI_MEMORY_LIST *List);
+
/*
* Statistics subcommands
@@ -178,7 +182,7 @@ static ARGUMENT_INFO AcpiDbStatTypes [] =
*
******************************************************************************/
-void
+static void
AcpiDbListInfo (
ACPI_MEMORY_LIST *List)
{
@@ -377,7 +381,7 @@ AcpiDbClassifyOneObject (
return AE_OK;
-#if ACPI_FUTURE_IMPLEMENTATION
+#ifdef ACPI_FUTURE_IMPLEMENTATION
/* TBD: These need to be counted during the initial parsing phase */
diff --git a/usr/src/uts/i86pc/io/acpica/debugger/dbutils.c b/usr/src/uts/i86pc/io/acpica/debugger/dbutils.c
index ce8eae082f..ad43a67244 100644
--- a/usr/src/uts/i86pc/io/acpica/debugger/dbutils.c
+++ b/usr/src/uts/i86pc/io/acpica/debugger/dbutils.c
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: dbutils - AML debugger utilities
- * $Revision: 74 $
+ * $Revision: 1.76 $
*
******************************************************************************/
@@ -116,11 +116,8 @@
#include "acpi.h"
-#include "acparser.h"
-#include "amlcode.h"
#include "acnamesp.h"
#include "acdebug.h"
-#include "acdispat.h"
#include "acdisasm.h"
@@ -249,7 +246,7 @@ AcpiDbDumpExternalObject (
{
case ACPI_TYPE_ANY:
- AcpiOsPrintf ("[Object Reference] = ", ObjDesc->Reference.Handle);
+ AcpiOsPrintf ("[Object Reference] = %p", ObjDesc->Reference.Handle);
AcpiDmDisplayInternalObject (ObjDesc->Reference.Handle, NULL);
break;
@@ -289,7 +286,7 @@ AcpiDbDumpExternalObject (
case ACPI_TYPE_PACKAGE:
- AcpiOsPrintf ("[Package] Contains %d Elements: \n",
+ AcpiOsPrintf ("[Package] Contains %d Elements:\n",
ObjDesc->Package.Count);
for (i = 0; i < ObjDesc->Package.Count; i++)
@@ -301,7 +298,7 @@ AcpiDbDumpExternalObject (
case ACPI_TYPE_LOCAL_REFERENCE:
- AcpiOsPrintf ("[Object Reference] = ", ObjDesc->Reference.Handle);
+ AcpiOsPrintf ("[Object Reference] = %p", ObjDesc->Reference.Handle);
AcpiDmDisplayInternalObject (ObjDesc->Reference.Handle, NULL);
break;
diff --git a/usr/src/uts/i86pc/io/acpica/debugger/dbxface.c b/usr/src/uts/i86pc/io/acpica/debugger/dbxface.c
index 0d1505b8df..6cc8d389be 100644
--- a/usr/src/uts/i86pc/io/acpica/debugger/dbxface.c
+++ b/usr/src/uts/i86pc/io/acpica/debugger/dbxface.c
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: dbxface - AML Debugger external interfaces
- * $Revision: 75 $
+ * $Revision: 1.75 $
*
******************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/events/evevent.c b/usr/src/uts/i86pc/io/acpica/events/evevent.c
index ae499480a5..d148ae55b9 100644
--- a/usr/src/uts/i86pc/io/acpica/events/evevent.c
+++ b/usr/src/uts/i86pc/io/acpica/events/evevent.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: evevent - Fixed Event handling and dispatch
- * $Revision: 117 $
+ * $Revision: 1.117 $
*
*****************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/events/evgpe.c b/usr/src/uts/i86pc/io/acpica/events/evgpe.c
index da17bb1ac7..2ec2407fbd 100644
--- a/usr/src/uts/i86pc/io/acpica/events/evgpe.c
+++ b/usr/src/uts/i86pc/io/acpica/events/evgpe.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: evgpe - General Purpose Event handling and dispatch
- * $Revision: 50 $
+ * $Revision: 1.52 $
*
*****************************************************************************/
@@ -728,7 +728,7 @@ AcpiEvGpeDispatch (
ACPI_REPORT_ERROR ((
"AcpiEvGpeDispatch: %s, Unable to clear GPE[%2X]\n",
AcpiFormatException (Status), GpeNumber));
- return_VALUE (ACPI_INTERRUPT_NOT_HANDLED);
+ return_UINT32 (ACPI_INTERRUPT_NOT_HANDLED);
}
}
@@ -772,7 +772,7 @@ AcpiEvGpeDispatch (
ACPI_REPORT_ERROR ((
"AcpiEvGpeDispatch: %s, Unable to clear GPE[%2X]\n",
AcpiFormatException (Status), GpeNumber));
- return_VALUE (ACPI_INTERRUPT_NOT_HANDLED);
+ return_UINT32 (ACPI_INTERRUPT_NOT_HANDLED);
}
}
break;
@@ -789,7 +789,7 @@ AcpiEvGpeDispatch (
ACPI_REPORT_ERROR ((
"AcpiEvGpeDispatch: %s, Unable to disable GPE[%2X]\n",
AcpiFormatException (Status), GpeNumber));
- return_VALUE (ACPI_INTERRUPT_NOT_HANDLED);
+ return_UINT32 (ACPI_INTERRUPT_NOT_HANDLED);
}
/*
@@ -824,12 +824,12 @@ AcpiEvGpeDispatch (
ACPI_REPORT_ERROR ((
"AcpiEvGpeDispatch: %s, Unable to disable GPE[%2X]\n",
AcpiFormatException (Status), GpeNumber));
- return_VALUE (ACPI_INTERRUPT_NOT_HANDLED);
+ return_UINT32 (ACPI_INTERRUPT_NOT_HANDLED);
}
break;
}
- return_VALUE (ACPI_INTERRUPT_HANDLED);
+ return_UINT32 (ACPI_INTERRUPT_HANDLED);
}
diff --git a/usr/src/uts/i86pc/io/acpica/events/evgpeblk.c b/usr/src/uts/i86pc/io/acpica/events/evgpeblk.c
index 15c95eaabc..90b90e415a 100644
--- a/usr/src/uts/i86pc/io/acpica/events/evgpeblk.c
+++ b/usr/src/uts/i86pc/io/acpica/events/evgpeblk.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: evgpeblk - GPE block creation and initialization.
- * $Revision: 45 $
+ * $Revision: 1.46 $
*
*****************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/events/evmisc.c b/usr/src/uts/i86pc/io/acpica/events/evmisc.c
index 85ba646831..a5e27013e3 100644
--- a/usr/src/uts/i86pc/io/acpica/events/evmisc.c
+++ b/usr/src/uts/i86pc/io/acpica/events/evmisc.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: evmisc - Miscellaneous event manager support functions
- * $Revision: 84 $
+ * $Revision: 1.86 $
*
*****************************************************************************/
@@ -506,6 +506,9 @@ AcpiEvInitGlobalLockHandler (
*/
if (Status == AE_NO_HARDWARE_RESPONSE)
{
+ ACPI_REPORT_ERROR ((
+ "No response from Global Lock hardware, disabling lock\n"));
+
AcpiGbl_GlobalLockPresent = FALSE;
Status = AE_OK;
}
diff --git a/usr/src/uts/i86pc/io/acpica/events/evregion.c b/usr/src/uts/i86pc/io/acpica/events/evregion.c
index 9d8af4abd0..04c2a3ee02 100644
--- a/usr/src/uts/i86pc/io/acpica/events/evregion.c
+++ b/usr/src/uts/i86pc/io/acpica/events/evregion.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: evregion - ACPI AddressSpace (OpRegion) handler dispatch
- * $Revision: 156 $
+ * $Revision: 1.156 $
*
*****************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/events/evrgnini.c b/usr/src/uts/i86pc/io/acpica/events/evrgnini.c
index 39aa4e4a4a..4e07532ae3 100644
--- a/usr/src/uts/i86pc/io/acpica/events/evrgnini.c
+++ b/usr/src/uts/i86pc/io/acpica/events/evrgnini.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: evrgnini- ACPI AddressSpace (OpRegion) init
- * $Revision: 78 $
+ * $Revision: 1.78 $
*
*****************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/events/evsci.c b/usr/src/uts/i86pc/io/acpica/events/evsci.c
index 35f57a2939..66e27083b1 100644
--- a/usr/src/uts/i86pc/io/acpica/events/evsci.c
+++ b/usr/src/uts/i86pc/io/acpica/events/evsci.c
@@ -2,7 +2,7 @@
*
* Module Name: evsci - System Control Interrupt configuration and
* legacy to ACPI mode state transition functions
- * $Revision: 97 $
+ * $Revision: 1.98 $
*
******************************************************************************/
@@ -171,7 +171,7 @@ AcpiEvSciXruptHandler (
*/
InterruptHandled |= AcpiEvGpeDetect (GpeXruptList);
- return_VALUE (InterruptHandled);
+ return_UINT32 (InterruptHandled);
}
@@ -209,7 +209,7 @@ AcpiEvGpeXruptHandler (
*/
InterruptHandled |= AcpiEvGpeDetect (GpeXruptList);
- return_VALUE (InterruptHandled);
+ return_UINT32 (InterruptHandled);
}
diff --git a/usr/src/uts/i86pc/io/acpica/events/evxface.c b/usr/src/uts/i86pc/io/acpica/events/evxface.c
index 65863cc967..4f179fe7c7 100644
--- a/usr/src/uts/i86pc/io/acpica/events/evxface.c
+++ b/usr/src/uts/i86pc/io/acpica/events/evxface.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: evxface - External interfaces for ACPI events
- * $Revision: 150 $
+ * $Revision: 1.151 $
*
*****************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/events/evxfevnt.c b/usr/src/uts/i86pc/io/acpica/events/evxfevnt.c
index ef06088758..4ebe9e7756 100644
--- a/usr/src/uts/i86pc/io/acpica/events/evxfevnt.c
+++ b/usr/src/uts/i86pc/io/acpica/events/evxfevnt.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: evxfevnt - External Interfaces, ACPI event disable/enable
- * $Revision: 82 $
+ * $Revision: 1.82 $
*
*****************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/events/evxfregn.c b/usr/src/uts/i86pc/io/acpica/events/evxfregn.c
index d18f7b8f54..38ad08c82b 100644
--- a/usr/src/uts/i86pc/io/acpica/events/evxfregn.c
+++ b/usr/src/uts/i86pc/io/acpica/events/evxfregn.c
@@ -2,7 +2,7 @@
*
* Module Name: evxfregn - External Interfaces, ACPI Operation Regions and
* Address Spaces.
- * $Revision: 64 $
+ * $Revision: 1.64 $
*
*****************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/hardware/hwacpi.c b/usr/src/uts/i86pc/io/acpica/hardware/hwacpi.c
index 57e638c791..d7b4a685e2 100644
--- a/usr/src/uts/i86pc/io/acpica/hardware/hwacpi.c
+++ b/usr/src/uts/i86pc/io/acpica/hardware/hwacpi.c
@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: hwacpi - ACPI Hardware Initialization/Mode Interface
- * $Revision: 69 $
+ * $Revision: 1.70 $
*
*****************************************************************************/
@@ -301,21 +301,21 @@ AcpiHwGetMode (
*/
if (!AcpiGbl_FADT->SmiCmd)
{
- return_VALUE (ACPI_SYS_MODE_ACPI);
+ return_UINT32 (ACPI_SYS_MODE_ACPI);
}
Status = AcpiGetRegister (ACPI_BITREG_SCI_ENABLE, &Value, ACPI_MTX_LOCK);
if (ACPI_FAILURE (Status))
{
- return_VALUE (ACPI_SYS_MODE_LEGACY);
+ return_UINT32 (ACPI_SYS_MODE_LEGACY);
}
if (Value)
{
- return_VALUE (ACPI_SYS_MODE_ACPI);
+ return_UINT32 (ACPI_SYS_MODE_ACPI);
}
else
{
- return_VALUE (ACPI_SYS_MODE_LEGACY);
+ return_UINT32 (ACPI_SYS_MODE_LEGACY);
}
}
diff --git a/usr/src/uts/i86pc/io/acpica/hardware/hwgpe.c b/usr/src/uts/i86pc/io/acpica/hardware/hwgpe.c
index cc8fe1f3b9..850f252f53 100644
--- a/usr/src/uts/i86pc/io/acpica/hardware/hwgpe.c
+++ b/usr/src/uts/i86pc/io/acpica/hardware/hwgpe.c
@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: hwgpe - Low level GPE enable/disable/clear functions
- * $Revision: 70 $
+ * $Revision: 1.71 $
*
*****************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/hardware/hwregs.c b/usr/src/uts/i86pc/io/acpica/hardware/hwregs.c
index 0cb2271fd8..256c42d07c 100644
--- a/usr/src/uts/i86pc/io/acpica/hardware/hwregs.c
+++ b/usr/src/uts/i86pc/io/acpica/hardware/hwregs.c
@@ -3,7 +3,7 @@
*
* Module Name: hwregs - Read/write access functions for the various ACPI
* control and status registers.
- * $Revision: 171 $
+ * $Revision: 1.172 $
*
******************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/hardware/hwsleep.c b/usr/src/uts/i86pc/io/acpica/hardware/hwsleep.c
index 4d0c58141d..6ecf893905 100644
--- a/usr/src/uts/i86pc/io/acpica/hardware/hwsleep.c
+++ b/usr/src/uts/i86pc/io/acpica/hardware/hwsleep.c
@@ -2,7 +2,7 @@
/******************************************************************************
*
* Name: hwsleep.c - ACPI Hardware Sleep/Wake Interface
- * $Revision: 75 $
+ * $Revision: 1.77 $
*
*****************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/hardware/hwtimer.c b/usr/src/uts/i86pc/io/acpica/hardware/hwtimer.c
index 8f171eed37..f6297d0340 100644
--- a/usr/src/uts/i86pc/io/acpica/hardware/hwtimer.c
+++ b/usr/src/uts/i86pc/io/acpica/hardware/hwtimer.c
@@ -2,7 +2,7 @@
/******************************************************************************
*
* Name: hwtimer.c - ACPI Power Management Timer Interface
- * $Revision: 30 $
+ * $Revision: 1.30 $
*
*****************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/interpreter/dispatcher/dsfield.c b/usr/src/uts/i86pc/io/acpica/interpreter/dispatcher/dsfield.c
index d02b679964..be680f3894 100644
--- a/usr/src/uts/i86pc/io/acpica/interpreter/dispatcher/dsfield.c
+++ b/usr/src/uts/i86pc/io/acpica/interpreter/dispatcher/dsfield.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: dsfield - Dispatcher field routines
- * $Revision: 78 $
+ * $Revision: 1.78 $
*
*****************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/interpreter/dispatcher/dsinit.c b/usr/src/uts/i86pc/io/acpica/interpreter/dispatcher/dsinit.c
index c62624b590..e355076d04 100644
--- a/usr/src/uts/i86pc/io/acpica/interpreter/dispatcher/dsinit.c
+++ b/usr/src/uts/i86pc/io/acpica/interpreter/dispatcher/dsinit.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: dsinit - Object initialization namespace walk
- * $Revision: 16 $
+ * $Revision: 1.17 $
*
*****************************************************************************/
@@ -160,20 +160,20 @@ AcpiDsInitOneObject (
void *Context,
void **ReturnValue)
{
+ ACPI_INIT_WALK_INFO *Info = (ACPI_INIT_WALK_INFO *) Context;
+ ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle;
ACPI_OBJECT_TYPE Type;
ACPI_STATUS Status;
- ACPI_INIT_WALK_INFO *Info = (ACPI_INIT_WALK_INFO *) Context;
ACPI_FUNCTION_NAME ("DsInitOneObject");
/*
- * We are only interested in objects owned by the table that
+ * We are only interested in NS nodes owned by the table that
* was just loaded
*/
- if (((ACPI_NAMESPACE_NODE *) ObjHandle)->OwnerId !=
- Info->TableDesc->OwnerId)
+ if (Node->OwnerId != Info->TableDesc->OwnerId)
{
return (AE_OK);
}
@@ -203,8 +203,6 @@ AcpiDsInitOneObject (
case ACPI_TYPE_METHOD:
- Info->MethodCount++;
-
/*
* Print a dot for each method unless we are going to print
* the entire pathname
@@ -222,7 +220,7 @@ AcpiDsInitOneObject (
*/
if (Info->TableDesc->Pointer->Revision == 1)
{
- ((ACPI_NAMESPACE_NODE *) ObjHandle)->Flags |= ANOBJ_DATA_WIDTH_32;
+ Node->Flags |= ANOBJ_DATA_WIDTH_32;
}
/*
@@ -233,22 +231,14 @@ AcpiDsInitOneObject (
if (ACPI_FAILURE (Status))
{
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
- "Method %p [%4.4s] - parse failure, %s\n",
+ "\n+Method %p [%4.4s] - parse failure, %s\n",
ObjHandle, AcpiUtGetNodeName (ObjHandle),
AcpiFormatException (Status)));
/* This parse failed, but we will continue parsing more methods */
-
- break;
}
- /*
- * Delete the parse tree. We simply re-parse the method
- * for every execution since there isn't much overhead
- */
- AcpiNsDeleteNamespaceSubtree (ObjHandle);
- AcpiNsDeleteNamespaceByOwner (
- ((ACPI_NAMESPACE_NODE *) ObjHandle)->Object->Method.OwnerId);
+ Info->MethodCount++;
break;
diff --git a/usr/src/uts/i86pc/io/acpica/interpreter/dispatcher/dsmethod.c b/usr/src/uts/i86pc/io/acpica/interpreter/dispatcher/dsmethod.c
index ecc3b294c4..f3b875fbf6 100644
--- a/usr/src/uts/i86pc/io/acpica/interpreter/dispatcher/dsmethod.c
+++ b/usr/src/uts/i86pc/io/acpica/interpreter/dispatcher/dsmethod.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: dsmethod - Parser/Interpreter interface - control method parsing
- * $Revision: 107 $
+ * $Revision: 1.110 $
*
*****************************************************************************/
@@ -132,12 +132,11 @@
*
* FUNCTION: AcpiDsParseMethod
*
- * PARAMETERS: ObjHandle - Method node
+ * PARAMETERS: Node - Method node
*
* RETURN: Status
*
- * DESCRIPTION: Call the parser and parse the AML that is associated with the
- * method.
+ * DESCRIPTION: Parse the AML that is associated with the method.
*
* MUTEX: Assumes parser is locked
*
@@ -145,31 +144,29 @@
ACPI_STATUS
AcpiDsParseMethod (
- ACPI_HANDLE ObjHandle)
+ ACPI_NAMESPACE_NODE *Node)
{
ACPI_STATUS Status;
ACPI_OPERAND_OBJECT *ObjDesc;
ACPI_PARSE_OBJECT *Op;
- ACPI_NAMESPACE_NODE *Node;
ACPI_WALK_STATE *WalkState;
- ACPI_FUNCTION_TRACE_PTR ("DsParseMethod", ObjHandle);
+ ACPI_FUNCTION_TRACE_PTR ("DsParseMethod", Node);
/* Parameter Validation */
- if (!ObjHandle)
+ if (!Node)
{
return_ACPI_STATUS (AE_NULL_ENTRY);
}
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "**** Parsing [%4.4s] **** NamedObj=%p\n",
- AcpiUtGetNodeName (ObjHandle), ObjHandle));
+ AcpiUtGetNodeName (Node), Node));
/* Extract the method object from the method Node */
- Node = (ACPI_NAMESPACE_NODE *) ObjHandle;
ObjDesc = AcpiNsGetAttachedObject (Node);
if (!ObjDesc)
{
@@ -252,10 +249,18 @@ AcpiDsParseMethod (
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
"**** [%4.4s] Parsed **** NamedObj=%p Op=%p\n",
- AcpiUtGetNodeName (ObjHandle), ObjHandle, Op));
+ AcpiUtGetNodeName (Node), Node, Op));
+
+ /*
+ * Delete the parse tree. We simply re-parse the method for every
+ * execution since there isn't much overhead (compared to keeping lots
+ * of parse trees around)
+ */
+ AcpiNsDeleteNamespaceSubtree (Node);
+ AcpiNsDeleteNamespaceByOwner (ObjDesc->Method.OwnerId);
Cleanup2:
- (void) AcpiUtReleaseOwnerId (ObjDesc->Method.OwnerId);
+ AcpiUtReleaseOwnerId (&ObjDesc->Method.OwnerId);
Cleanup:
AcpiPsDeleteParseTree (Op);
@@ -296,6 +301,15 @@ AcpiDsBeginMethodExecution (
return_ACPI_STATUS (AE_NULL_ENTRY);
}
+ /* Prevent wraparound of thread count */
+
+ if (ObjDesc->Method.ThreadCount == ACPI_UINT8_MAX)
+ {
+ ACPI_REPORT_ERROR ((
+ "Method reached maximum reentrancy limit (255)\n"));
+ return_ACPI_STATUS (AE_AML_METHOD_LIMIT);
+ }
+
/*
* If there is a concurrency limit on this method, we need to
* obtain a unit from the method semaphore.
@@ -327,6 +341,20 @@ AcpiDsBeginMethodExecution (
}
/*
+ * Allocate an Owner ID for this method, only if this is the first thread
+ * to begin concurrent execution. We only need one OwnerId, even if the
+ * method is invoked recursively.
+ */
+ if (!ObjDesc->Method.OwnerId)
+ {
+ Status = AcpiUtAllocateOwnerId (&ObjDesc->Method.OwnerId);
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+ }
+
+ /*
* Increment the method parse tree thread count since it has been
* reentered one more time (even if it is the same thread)
*/
@@ -383,12 +411,6 @@ AcpiDsCallControlMethod (
return_ACPI_STATUS (AE_NULL_OBJECT);
}
- Status = AcpiUtAllocateOwnerId (&ObjDesc->Method.OwnerId);
- if (ACPI_FAILURE (Status))
- {
- return_ACPI_STATUS (Status);
- }
-
/* Init for new method, wait on concurrency semaphore */
Status = AcpiDsBeginMethodExecution (MethodNode, ObjDesc,
@@ -444,9 +466,8 @@ AcpiDsCallControlMethod (
}
/*
* The resolved arguments were put on the previous walk state's operand
- * stack. Operands on the previous walk state stack always
- * start at index 0.
- * Null terminate the list of arguments
+ * stack. Operands on the previous walk state stack always
+ * start at index 0. Also, null terminate the list of arguments
*/
ThisWalkState->Operands [ThisWalkState->NumOperands] = NULL;
@@ -481,23 +502,22 @@ AcpiDsCallControlMethod (
if (ObjDesc->Method.MethodFlags & AML_METHOD_INTERNAL_ONLY)
{
Status = ObjDesc->Method.Implementation (NextWalkState);
- return_ACPI_STATUS (Status);
}
- return_ACPI_STATUS (AE_OK);
-
+ return_ACPI_STATUS (Status);
- /* On error, we must delete the new walk state */
Cleanup:
- (void) AcpiUtReleaseOwnerId (ObjDesc->Method.OwnerId);
+ /* Decrement the thread count on the method parse tree */
+
if (NextWalkState && (NextWalkState->MethodDesc))
{
- /* Decrement the thread count on the method parse tree */
-
- NextWalkState->MethodDesc->Method.ThreadCount--;
+ NextWalkState->MethodDesc->Method.ThreadCount--;
}
- (void) AcpiDsTerminateControlMethod (NextWalkState);
+
+ /* On error, we must delete the new walk state */
+
+ AcpiDsTerminateControlMethod (NextWalkState);
AcpiDsDeleteWalkState (NextWalkState);
return_ACPI_STATUS (Status);
}
@@ -590,7 +610,7 @@ AcpiDsRestartControlMethod (
*
* PARAMETERS: WalkState - State of the method
*
- * RETURN: Status
+ * RETURN: None
*
* DESCRIPTION: Terminate a control method. Delete everything that the method
* created, delete all locals and arguments, and delete the parse
@@ -598,7 +618,7 @@ AcpiDsRestartControlMethod (
*
******************************************************************************/
-ACPI_STATUS
+void
AcpiDsTerminateControlMethod (
ACPI_WALK_STATE *WalkState)
{
@@ -612,7 +632,7 @@ AcpiDsTerminateControlMethod (
if (!WalkState)
{
- return (AE_BAD_PARAMETER);
+ return_VOID;
}
/* The current method object was saved in the walk state */
@@ -620,7 +640,7 @@ AcpiDsTerminateControlMethod (
ObjDesc = WalkState->MethodDesc;
if (!ObjDesc)
{
- return_ACPI_STATUS (AE_OK);
+ return_VOID;
}
/* Delete all arguments and locals */
@@ -635,7 +655,7 @@ AcpiDsTerminateControlMethod (
Status = AcpiUtAcquireMutex (ACPI_MTX_PARSER);
if (ACPI_FAILURE (Status))
{
- return_ACPI_STATUS (Status);
+ return_VOID;
}
/* Signal completion of the execution of this method if necessary */
@@ -647,7 +667,6 @@ AcpiDsTerminateControlMethod (
if (ACPI_FAILURE (Status))
{
ACPI_REPORT_ERROR (("Could not signal method semaphore\n"));
- Status = AE_OK;
/* Ignore error and continue cleanup */
}
@@ -659,8 +678,7 @@ AcpiDsTerminateControlMethod (
"*** Not deleting method namespace, there are still %d threads\n",
WalkState->MethodDesc->Method.ThreadCount));
}
-
- if (!WalkState->MethodDesc->Method.ThreadCount)
+ else /* This is the last executing thread */
{
/*
* Support to dynamically change a method from NotSerialized to
@@ -675,9 +693,8 @@ AcpiDsTerminateControlMethod (
if ((WalkState->MethodDesc->Method.Concurrency == 1) &&
(!WalkState->MethodDesc->Method.Semaphore))
{
- Status = AcpiOsCreateSemaphore (1,
- 1,
- &WalkState->MethodDesc->Method.Semaphore);
+ Status = AcpiOsCreateSemaphore (1, 1,
+ &WalkState->MethodDesc->Method.Semaphore);
}
/*
@@ -695,7 +712,7 @@ AcpiDsTerminateControlMethod (
Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE (Status))
{
- return_ACPI_STATUS (Status);
+ goto Exit;
}
if (MethodNode->Child)
@@ -709,14 +726,12 @@ AcpiDsTerminateControlMethod (
*/
AcpiNsDeleteNamespaceByOwner (WalkState->MethodDesc->Method.OwnerId);
Status = AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
- if (ACPI_FAILURE (Status))
- {
- return_ACPI_STATUS (Status);
- }
+ AcpiUtReleaseOwnerId (&WalkState->MethodDesc->Method.OwnerId);
}
- Status = AcpiUtReleaseMutex (ACPI_MTX_PARSER);
- return_ACPI_STATUS (Status);
+Exit:
+ (void) AcpiUtReleaseMutex (ACPI_MTX_PARSER);
+ return_VOID;
}
diff --git a/usr/src/uts/i86pc/io/acpica/interpreter/dispatcher/dsmthdat.c b/usr/src/uts/i86pc/io/acpica/interpreter/dispatcher/dsmthdat.c
index c4ba0bbe54..b496374417 100644
--- a/usr/src/uts/i86pc/io/acpica/interpreter/dispatcher/dsmthdat.c
+++ b/usr/src/uts/i86pc/io/acpica/interpreter/dispatcher/dsmthdat.c
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: dsmthdat - control method arguments and local variables
- * $Revision: 85 $
+ * $Revision: 1.85 $
*
******************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/interpreter/dispatcher/dsobject.c b/usr/src/uts/i86pc/io/acpica/interpreter/dispatcher/dsobject.c
index 54142893ff..df1e21cc28 100644
--- a/usr/src/uts/i86pc/io/acpica/interpreter/dispatcher/dsobject.c
+++ b/usr/src/uts/i86pc/io/acpica/interpreter/dispatcher/dsobject.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: dsobject - Dispatcher object management routines
- * $Revision: 124 $
+ * $Revision: 1.124 $
*
*****************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/interpreter/dispatcher/dsopcode.c b/usr/src/uts/i86pc/io/acpica/interpreter/dispatcher/dsopcode.c
index dfeb2db1b9..3fad1548ff 100644
--- a/usr/src/uts/i86pc/io/acpica/interpreter/dispatcher/dsopcode.c
+++ b/usr/src/uts/i86pc/io/acpica/interpreter/dispatcher/dsopcode.c
@@ -2,7 +2,7 @@
*
* Module Name: dsopcode - Dispatcher Op Region support and handling of
* "control" opcodes
- * $Revision: 103 $
+ * $Revision: 1.103 $
*
*****************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/interpreter/dispatcher/dsutils.c b/usr/src/uts/i86pc/io/acpica/interpreter/dispatcher/dsutils.c
index 32c756dd76..1b4460727d 100644
--- a/usr/src/uts/i86pc/io/acpica/interpreter/dispatcher/dsutils.c
+++ b/usr/src/uts/i86pc/io/acpica/interpreter/dispatcher/dsutils.c
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: dsutils - Dispatcher utilities
- * $Revision: 113 $
+ * $Revision: 1.115 $
*
******************************************************************************/
@@ -273,7 +273,7 @@ AcpiDsIsResultUsed (
if (!Op)
{
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Null Op\n"));
- return_VALUE (TRUE);
+ return_UINT8 (TRUE);
}
/*
@@ -303,7 +303,7 @@ AcpiDsIsResultUsed (
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
"At Method level, result of [%s] not used\n",
AcpiPsGetOpcodeName (Op->Common.AmlOpcode)));
- return_VALUE (FALSE);
+ return_UINT8 (FALSE);
}
/* Get info on the parent. The RootOp is AML_SCOPE */
@@ -313,7 +313,7 @@ AcpiDsIsResultUsed (
{
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"Unknown parent opcode. Op=%p\n", Op));
- return_VALUE (FALSE);
+ return_UINT8 (FALSE);
}
/*
@@ -402,7 +402,7 @@ ResultUsed:
AcpiPsGetOpcodeName (Op->Common.AmlOpcode),
AcpiPsGetOpcodeName (Op->Common.Parent->Common.AmlOpcode), Op));
- return_VALUE (TRUE);
+ return_UINT8 (TRUE);
ResultNotUsed:
@@ -411,7 +411,7 @@ ResultNotUsed:
AcpiPsGetOpcodeName (Op->Common.AmlOpcode),
AcpiPsGetOpcodeName (Op->Common.Parent->Common.AmlOpcode), Op));
- return_VALUE (FALSE);
+ return_UINT8 (FALSE);
}
@@ -744,7 +744,7 @@ AcpiDsCreateOperand (
if (OpInfo->Flags & AML_HAS_RETVAL)
{
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
- "Argument previously created, already stacked \n"));
+ "Argument previously created, already stacked\n"));
ACPI_DEBUGGER_EXEC (AcpiDbDisplayArgumentObject (
WalkState->Operands [WalkState->NumOperands - 1], WalkState));
diff --git a/usr/src/uts/i86pc/io/acpica/interpreter/dispatcher/dswexec.c b/usr/src/uts/i86pc/io/acpica/interpreter/dispatcher/dswexec.c
index 952074df88..18bd863d01 100644
--- a/usr/src/uts/i86pc/io/acpica/interpreter/dispatcher/dswexec.c
+++ b/usr/src/uts/i86pc/io/acpica/interpreter/dispatcher/dswexec.c
@@ -2,7 +2,7 @@
*
* Module Name: dswexec - Dispatcher method execution callbacks;
* dispatch to interpreter.
- * $Revision: 120 $
+ * $Revision: 1.120 $
*
*****************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/interpreter/dispatcher/dswload.c b/usr/src/uts/i86pc/io/acpica/interpreter/dispatcher/dswload.c
index 85de3f8e23..c95b800a62 100644
--- a/usr/src/uts/i86pc/io/acpica/interpreter/dispatcher/dswload.c
+++ b/usr/src/uts/i86pc/io/acpica/interpreter/dispatcher/dswload.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: dswload - Dispatcher namespace load callbacks
- * $Revision: 96 $
+ * $Revision: 1.98 $
*
*****************************************************************************/
@@ -594,9 +594,11 @@ AcpiDsLoad2BeginOp (
(WalkState->Opcode != AML_INT_NAMEPATH_OP)) ||
(!(WalkState->OpInfo->Flags & AML_NAMED)))
{
+#ifdef ACPI_ENABLE_MODULE_LEVEL_CODE
if ((WalkState->OpInfo->Class == AML_CLASS_EXECUTE) ||
(WalkState->OpInfo->Class == AML_CLASS_CONTROL))
{
+
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
"Begin/EXEC: %s (fl %8.8X)\n", WalkState->OpInfo->Name,
WalkState->OpInfo->Flags));
@@ -606,6 +608,7 @@ AcpiDsLoad2BeginOp (
Status = AcpiDsExecBeginOp (WalkState, OutOp);
return_ACPI_STATUS (Status);
}
+#endif
return_ACPI_STATUS (AE_OK);
}
@@ -861,6 +864,7 @@ AcpiDsLoad2EndOp (
if (!(WalkState->OpInfo->Flags & AML_NSOBJECT))
{
#ifndef ACPI_NO_METHOD_EXECUTION
+#ifdef ACPI_ENABLE_MODULE_LEVEL_CODE
/* No namespace object. Executable opcode? */
if ((WalkState->OpInfo->Class == AML_CLASS_EXECUTE) ||
@@ -876,6 +880,7 @@ AcpiDsLoad2EndOp (
return_ACPI_STATUS (Status);
}
#endif
+#endif
return_ACPI_STATUS (AE_OK);
}
diff --git a/usr/src/uts/i86pc/io/acpica/interpreter/dispatcher/dswscope.c b/usr/src/uts/i86pc/io/acpica/interpreter/dispatcher/dswscope.c
index 7ddc03e0de..e9e4dc52ea 100644
--- a/usr/src/uts/i86pc/io/acpica/interpreter/dispatcher/dswscope.c
+++ b/usr/src/uts/i86pc/io/acpica/interpreter/dispatcher/dswscope.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: dswscope - Scope stack manipulation
- * $Revision: 63 $
+ * $Revision: 1.63 $
*
*****************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/interpreter/dispatcher/dswstate.c b/usr/src/uts/i86pc/io/acpica/interpreter/dispatcher/dswstate.c
index 5673293630..5af4c9aa83 100644
--- a/usr/src/uts/i86pc/io/acpica/interpreter/dispatcher/dswstate.c
+++ b/usr/src/uts/i86pc/io/acpica/interpreter/dispatcher/dswstate.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: dswstate - Dispatcher parse tree walk management routines
- * $Revision: 89 $
+ * $Revision: 1.90 $
*
*****************************************************************************/
@@ -844,7 +844,7 @@ AcpiDsInitAmlWalk (
UINT8 *AmlStart,
UINT32 AmlLength,
ACPI_PARAMETER_INFO *Info,
- UINT32 PassNumber)
+ UINT8 PassNumber)
{
ACPI_STATUS Status;
ACPI_PARSE_STATE *ParserState = &WalkState->ParserState;
@@ -862,7 +862,7 @@ AcpiDsInitAmlWalk (
/* The NextOp of the NextWalk will be the beginning of the method */
WalkState->NextOp = NULL;
- WalkState->PassNumber = (UINT8) PassNumber;
+ WalkState->PassNumber = PassNumber;
if (Info)
{
diff --git a/usr/src/uts/i86pc/io/acpica/interpreter/executer/exconfig.c b/usr/src/uts/i86pc/io/acpica/interpreter/executer/exconfig.c
index 53dcdd3ee0..bc78e19cb1 100644
--- a/usr/src/uts/i86pc/io/acpica/interpreter/executer/exconfig.c
+++ b/usr/src/uts/i86pc/io/acpica/interpreter/executer/exconfig.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: exconfig - Namespace reconfiguration (Load/Unload opcodes)
- * $Revision: 85 $
+ * $Revision: 1.87 $
*
*****************************************************************************/
@@ -175,6 +175,11 @@ AcpiExAddTable (
return_ACPI_STATUS (AE_NO_MEMORY);
}
+ /* Init the table handle */
+
+ ObjDesc->Reference.Opcode = AML_LOAD_OP;
+ *DdbHandle = ObjDesc;
+
/* Install the new table into the local data structures */
ACPI_MEMSET (&TableInfo, 0, sizeof (ACPI_TABLE_DESC));
@@ -185,8 +190,16 @@ AcpiExAddTable (
TableInfo.Allocation = ACPI_MEM_ALLOCATED;
Status = AcpiTbInstallTable (&TableInfo);
+ ObjDesc->Reference.Object = TableInfo.InstalledDesc;
+
if (ACPI_FAILURE (Status))
{
+ if (Status == AE_ALREADY_EXISTS)
+ {
+ /* Table already exists, just return the handle */
+
+ return_ACPI_STATUS (AE_OK);
+ }
goto Cleanup;
}
@@ -201,16 +214,12 @@ AcpiExAddTable (
goto Cleanup;
}
- /* Init the table handle */
-
- ObjDesc->Reference.Opcode = AML_LOAD_OP;
- ObjDesc->Reference.Object = TableInfo.InstalledDesc;
- *DdbHandle = ObjDesc;
return_ACPI_STATUS (AE_OK);
Cleanup:
AcpiUtRemoveReference (ObjDesc);
+ *DdbHandle = NULL;
return_ACPI_STATUS (Status);
}
@@ -594,6 +603,7 @@ AcpiExUnloadTable (
* (Offset contains the TableId)
*/
AcpiNsDeleteNamespaceByOwner (TableInfo->OwnerId);
+ AcpiUtReleaseOwnerId (&TableInfo->OwnerId);
/* Delete the table itself */
diff --git a/usr/src/uts/i86pc/io/acpica/interpreter/executer/exconvrt.c b/usr/src/uts/i86pc/io/acpica/interpreter/executer/exconvrt.c
index 5ca29ba3c7..118120d9c4 100644
--- a/usr/src/uts/i86pc/io/acpica/interpreter/executer/exconvrt.c
+++ b/usr/src/uts/i86pc/io/acpica/interpreter/executer/exconvrt.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: exconvrt - Object conversion routines
- * $Revision: 67 $
+ * $Revision: 1.67 $
*
*****************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/interpreter/executer/excreate.c b/usr/src/uts/i86pc/io/acpica/interpreter/executer/excreate.c
index 7df4fb0066..a035836a4b 100644
--- a/usr/src/uts/i86pc/io/acpica/interpreter/executer/excreate.c
+++ b/usr/src/uts/i86pc/io/acpica/interpreter/executer/excreate.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: excreate - Named object creation
- * $Revision: 106 $
+ * $Revision: 1.106 $
*
*****************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/interpreter/executer/exdump.c b/usr/src/uts/i86pc/io/acpica/interpreter/executer/exdump.c
index 61902d778f..31d23fc78d 100644
--- a/usr/src/uts/i86pc/io/acpica/interpreter/executer/exdump.c
+++ b/usr/src/uts/i86pc/io/acpica/interpreter/executer/exdump.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: exdump - Interpreter debug output routines
- * $Revision: 186 $
+ * $Revision: 1.188 $
*
*****************************************************************************/
@@ -321,7 +321,7 @@ AcpiExDumpOperand (
case ACPI_TYPE_BUFFER:
- AcpiOsPrintf ("Buffer len %X @ %p \n",
+ AcpiOsPrintf ("Buffer len %X @ %p\n",
ObjDesc->Buffer.Length, ObjDesc->Buffer.Pointer);
Length = ObjDesc->Buffer.Length;
@@ -437,19 +437,19 @@ AcpiExDumpOperand (
case ACPI_TYPE_BUFFER_FIELD:
AcpiOsPrintf (
- "BufferField: %X bits at byte %X bit %X of \n",
+ "BufferField: %X bits at byte %X bit %X of\n",
ObjDesc->BufferField.BitLength,
ObjDesc->BufferField.BaseByteOffset,
ObjDesc->BufferField.StartFieldBitOffset);
if (!ObjDesc->BufferField.BufferObj)
{
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "*NULL* \n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "*NULL*\n"));
}
else if (ACPI_GET_OBJECT_TYPE (ObjDesc->BufferField.BufferObj) !=
ACPI_TYPE_BUFFER)
{
- AcpiOsPrintf ("*not a Buffer* \n");
+ AcpiOsPrintf ("*not a Buffer*\n");
}
else
{
@@ -699,7 +699,7 @@ AcpiExDumpReference (
}
else
{
- AcpiOsPrintf ("%s\n", RetBuf.Pointer);
+ AcpiOsPrintf ("%s\n", (char *) RetBuf.Pointer);
ACPI_MEM_FREE (RetBuf.Pointer);
}
}
@@ -792,7 +792,7 @@ AcpiExDumpPackage (
case ACPI_TYPE_PACKAGE:
- AcpiOsPrintf ("[Package] Contains %d Elements: \n",
+ AcpiOsPrintf ("[Package] Contains %d Elements:\n",
ObjDesc->Package.Count);
for (i = 0; i < ObjDesc->Package.Count; i++)
diff --git a/usr/src/uts/i86pc/io/acpica/interpreter/executer/exfield.c b/usr/src/uts/i86pc/io/acpica/interpreter/executer/exfield.c
index 84a87a5c65..b24e12e652 100644
--- a/usr/src/uts/i86pc/io/acpica/interpreter/executer/exfield.c
+++ b/usr/src/uts/i86pc/io/acpica/interpreter/executer/exfield.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: exfield - ACPI AML (p-code) execution - field manipulation
- * $Revision: 124 $
+ * $Revision: 1.124 $
*
*****************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/interpreter/executer/exfldio.c b/usr/src/uts/i86pc/io/acpica/interpreter/executer/exfldio.c
index d71d2ff2b2..01afb33189 100644
--- a/usr/src/uts/i86pc/io/acpica/interpreter/executer/exfldio.c
+++ b/usr/src/uts/i86pc/io/acpica/interpreter/executer/exfldio.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: exfldio - Aml Field I/O
- * $Revision: 116 $
+ * $Revision: 1.116 $
*
*****************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/interpreter/executer/exmisc.c b/usr/src/uts/i86pc/io/acpica/interpreter/executer/exmisc.c
index 1435dc7ffa..84202340c8 100644
--- a/usr/src/uts/i86pc/io/acpica/interpreter/executer/exmisc.c
+++ b/usr/src/uts/i86pc/io/acpica/interpreter/executer/exmisc.c
@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exmisc - ACPI AML (p-code) execution - specific opcodes
- * $Revision: 131 $
+ * $Revision: 1.131 $
*
*****************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/interpreter/executer/exmutex.c b/usr/src/uts/i86pc/io/acpica/interpreter/executer/exmutex.c
index 02668fc9b0..fbabf91880 100644
--- a/usr/src/uts/i86pc/io/acpica/interpreter/executer/exmutex.c
+++ b/usr/src/uts/i86pc/io/acpica/interpreter/executer/exmutex.c
@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exmutex - ASL Mutex Acquire/Release functions
- * $Revision: 28 $
+ * $Revision: 1.28 $
*
*****************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/interpreter/executer/exnames.c b/usr/src/uts/i86pc/io/acpica/interpreter/executer/exnames.c
index f149a97a79..a696574822 100644
--- a/usr/src/uts/i86pc/io/acpica/interpreter/executer/exnames.c
+++ b/usr/src/uts/i86pc/io/acpica/interpreter/executer/exnames.c
@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exnames - interpreter/scanner name load/execute
- * $Revision: 102 $
+ * $Revision: 1.103 $
*
*****************************************************************************/
@@ -298,12 +298,12 @@ AcpiExNameSegment (
{
ACPI_STRCAT (NameString, CharBuf);
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
- "Appended to - %s \n", NameString));
+ "Appended to - %s\n", NameString));
}
else
{
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
- "No Name string - %s \n", CharBuf));
+ "No Name string - %s\n", CharBuf));
}
}
else if (Index == 0)
diff --git a/usr/src/uts/i86pc/io/acpica/interpreter/executer/exoparg1.c b/usr/src/uts/i86pc/io/acpica/interpreter/executer/exoparg1.c
index 506fcab5e3..06c96a08d1 100644
--- a/usr/src/uts/i86pc/io/acpica/interpreter/executer/exoparg1.c
+++ b/usr/src/uts/i86pc/io/acpica/interpreter/executer/exoparg1.c
@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exoparg1 - AML execution - opcodes with 1 argument
- * $Revision: 171 $
+ * $Revision: 1.172 $
*
*****************************************************************************/
@@ -1080,7 +1080,7 @@ AcpiExOpcode_1A_0T_1R (
ReturnDesc = *(Operand[0]->Reference.Where);
if (ReturnDesc)
{
- AcpiUtAddReference (ReturnDesc);
+ AcpiUtAddReference (ReturnDesc);
}
break;
diff --git a/usr/src/uts/i86pc/io/acpica/interpreter/executer/exoparg2.c b/usr/src/uts/i86pc/io/acpica/interpreter/executer/exoparg2.c
index f3516727e6..b23f3808dd 100644
--- a/usr/src/uts/i86pc/io/acpica/interpreter/executer/exoparg2.c
+++ b/usr/src/uts/i86pc/io/acpica/interpreter/executer/exoparg2.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: exoparg2 - AML execution - opcodes with 2 arguments
- * $Revision: 134 $
+ * $Revision: 1.134 $
*
*****************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/interpreter/executer/exoparg3.c b/usr/src/uts/i86pc/io/acpica/interpreter/executer/exoparg3.c
index acf5a1ffa8..4260e7cb69 100644
--- a/usr/src/uts/i86pc/io/acpica/interpreter/executer/exoparg3.c
+++ b/usr/src/uts/i86pc/io/acpica/interpreter/executer/exoparg3.c
@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exoparg3 - AML execution - opcodes with 3 arguments
- * $Revision: 27 $
+ * $Revision: 1.27 $
*
*****************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/interpreter/executer/exoparg6.c b/usr/src/uts/i86pc/io/acpica/interpreter/executer/exoparg6.c
index c18f01e74f..34af08b3af 100644
--- a/usr/src/uts/i86pc/io/acpica/interpreter/executer/exoparg6.c
+++ b/usr/src/uts/i86pc/io/acpica/interpreter/executer/exoparg6.c
@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exoparg6 - AML execution - opcodes with 6 arguments
- * $Revision: 23 $
+ * $Revision: 1.23 $
*
*****************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/interpreter/executer/exprep.c b/usr/src/uts/i86pc/io/acpica/interpreter/executer/exprep.c
index 2854277bc9..d6aa31b41f 100644
--- a/usr/src/uts/i86pc/io/acpica/interpreter/executer/exprep.c
+++ b/usr/src/uts/i86pc/io/acpica/interpreter/executer/exprep.c
@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exprep - ACPI AML (p-code) execution - field prep utilities
- * $Revision: 134 $
+ * $Revision: 1.135 $
*
*****************************************************************************/
@@ -364,7 +364,7 @@ AcpiExDecodeFieldAccess (
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"Unknown field access type %X\n",
Access));
- return_VALUE (0);
+ return_UINT32 (0);
}
if (ACPI_GET_OBJECT_TYPE (ObjDesc) == ACPI_TYPE_BUFFER_FIELD)
@@ -378,7 +378,7 @@ AcpiExDecodeFieldAccess (
}
*ReturnByteAlignment = ByteAlignment;
- return_VALUE (BitLength);
+ return_UINT32 (BitLength);
}
diff --git a/usr/src/uts/i86pc/io/acpica/interpreter/executer/exregion.c b/usr/src/uts/i86pc/io/acpica/interpreter/executer/exregion.c
index adf15b6e6a..1ca250ed37 100644
--- a/usr/src/uts/i86pc/io/acpica/interpreter/executer/exregion.c
+++ b/usr/src/uts/i86pc/io/acpica/interpreter/executer/exregion.c
@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exregion - ACPI default OpRegion (address space) handlers
- * $Revision: 90 $
+ * $Revision: 1.90 $
*
*****************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/interpreter/executer/exresnte.c b/usr/src/uts/i86pc/io/acpica/interpreter/executer/exresnte.c
index c6114d2bb9..0f5a7d28be 100644
--- a/usr/src/uts/i86pc/io/acpica/interpreter/executer/exresnte.c
+++ b/usr/src/uts/i86pc/io/acpica/interpreter/executer/exresnte.c
@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exresnte - AML Interpreter object resolution
- * $Revision: 68 $
+ * $Revision: 1.68 $
*
*****************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/interpreter/executer/exresolv.c b/usr/src/uts/i86pc/io/acpica/interpreter/executer/exresolv.c
index acbe04893f..93b53cff37 100644
--- a/usr/src/uts/i86pc/io/acpica/interpreter/executer/exresolv.c
+++ b/usr/src/uts/i86pc/io/acpica/interpreter/executer/exresolv.c
@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exresolv - AML Interpreter object resolution
- * $Revision: 132 $
+ * $Revision: 1.132 $
*
*****************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/interpreter/executer/exresop.c b/usr/src/uts/i86pc/io/acpica/interpreter/executer/exresop.c
index c7b3e7aa12..3f4a296e7b 100644
--- a/usr/src/uts/i86pc/io/acpica/interpreter/executer/exresop.c
+++ b/usr/src/uts/i86pc/io/acpica/interpreter/executer/exresop.c
@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exresop - AML Interpreter operand/object resolution
- * $Revision: 85 $
+ * $Revision: 1.86 $
*
*****************************************************************************/
@@ -250,7 +250,7 @@ AcpiExResolveOperands (
}
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
- "Opcode %X [%s] RequiredOperandTypes=%8.8X \n",
+ "Opcode %X [%s] RequiredOperandTypes=%8.8X\n",
Opcode, OpInfo->Name, ArgTypes));
/*
diff --git a/usr/src/uts/i86pc/io/acpica/interpreter/executer/exstore.c b/usr/src/uts/i86pc/io/acpica/interpreter/executer/exstore.c
index 44e455bbcf..65be7b51b1 100644
--- a/usr/src/uts/i86pc/io/acpica/interpreter/executer/exstore.c
+++ b/usr/src/uts/i86pc/io/acpica/interpreter/executer/exstore.c
@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exstore - AML Interpreter object store support
- * $Revision: 196 $
+ * $Revision: 1.196 $
*
*****************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/interpreter/executer/exstoren.c b/usr/src/uts/i86pc/io/acpica/interpreter/executer/exstoren.c
index 710b00b04d..174beca693 100644
--- a/usr/src/uts/i86pc/io/acpica/interpreter/executer/exstoren.c
+++ b/usr/src/uts/i86pc/io/acpica/interpreter/executer/exstoren.c
@@ -3,7 +3,7 @@
*
* Module Name: exstoren - AML Interpreter object store support,
* Store to Node (namespace object)
- * $Revision: 64 $
+ * $Revision: 1.64 $
*
*****************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/interpreter/executer/exstorob.c b/usr/src/uts/i86pc/io/acpica/interpreter/executer/exstorob.c
index d96f6029f0..5b7ff5739f 100644
--- a/usr/src/uts/i86pc/io/acpica/interpreter/executer/exstorob.c
+++ b/usr/src/uts/i86pc/io/acpica/interpreter/executer/exstorob.c
@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exstorob - AML Interpreter object store support, store to object
- * $Revision: 57 $
+ * $Revision: 1.57 $
*
*****************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/interpreter/executer/exsystem.c b/usr/src/uts/i86pc/io/acpica/interpreter/executer/exsystem.c
index 43088db16a..2b7eedc2a8 100644
--- a/usr/src/uts/i86pc/io/acpica/interpreter/executer/exsystem.c
+++ b/usr/src/uts/i86pc/io/acpica/interpreter/executer/exsystem.c
@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exsystem - Interface to OS services
- * $Revision: 84 $
+ * $Revision: 1.84 $
*
*****************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/interpreter/executer/exutils.c b/usr/src/uts/i86pc/io/acpica/interpreter/executer/exutils.c
index b8f13ceaf9..e5d8625464 100644
--- a/usr/src/uts/i86pc/io/acpica/interpreter/executer/exutils.c
+++ b/usr/src/uts/i86pc/io/acpica/interpreter/executer/exutils.c
@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exutils - interpreter/scanner utilities
- * $Revision: 117 $
+ * $Revision: 1.118 $
*
*****************************************************************************/
@@ -311,7 +311,7 @@ AcpiExAcquireGlobalLock (
}
}
- return_VALUE (Locked);
+ return_UINT8 (Locked);
}
@@ -388,7 +388,7 @@ AcpiExDigitsNeeded (
if (Value == 0)
{
- return_VALUE (1);
+ return_UINT32 (1);
}
CurrentValue = Value;
@@ -402,7 +402,7 @@ AcpiExDigitsNeeded (
NumDigits++;
}
- return_VALUE (NumDigits);
+ return_UINT32 (NumDigits);
}
diff --git a/usr/src/uts/i86pc/io/acpica/interpreter/parser/psargs.c b/usr/src/uts/i86pc/io/acpica/interpreter/parser/psargs.c
index 888fafcd26..275a3496da 100644
--- a/usr/src/uts/i86pc/io/acpica/interpreter/parser/psargs.c
+++ b/usr/src/uts/i86pc/io/acpica/interpreter/parser/psargs.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: psargs - Parse AML opcode arguments
- * $Revision: 80 $
+ * $Revision: 1.81 $
*
*****************************************************************************/
@@ -202,7 +202,7 @@ AcpiPsGetNextPackageLength (
break;
}
- return_VALUE (Length);
+ return_UINT32 (Length);
}
diff --git a/usr/src/uts/i86pc/io/acpica/interpreter/parser/psloop.c b/usr/src/uts/i86pc/io/acpica/interpreter/parser/psloop.c
index 4999b55283..e4d90cdeef 100644
--- a/usr/src/uts/i86pc/io/acpica/interpreter/parser/psloop.c
+++ b/usr/src/uts/i86pc/io/acpica/interpreter/parser/psloop.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: psloop - Main AML parse loop
- * $Revision: 3 $
+ * $Revision: 1.5 $
*
*****************************************************************************/
@@ -128,8 +128,6 @@
#include "acparser.h"
#include "acdispat.h"
#include "amlcode.h"
-#include "acnamesp.h"
-#include "acinterp.h"
#define _COMPONENT ACPI_PARSER
ACPI_MODULE_NAME ("psloop")
@@ -519,7 +517,7 @@ AcpiPsParseLoop (
/* TBD (remove): Temporary mechanism to disable this code if needed */
-#ifndef ACPI_NO_MODULE_LEVEL_CODE
+#ifdef ACPI_ENABLE_MODULE_LEVEL_CODE
if ((WalkState->PassNumber <= ACPI_IMODE_LOAD_PASS1) &&
((WalkState->ParseFlags & ACPI_PARSE_DISASSEMBLE) == 0))
@@ -538,6 +536,9 @@ AcpiPsParseLoop (
case AML_ELSE_OP:
case AML_WHILE_OP:
+ ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
+ "Pass1: Skipping an If/Else/While body\n"));
+
/* Skip body of if/else/while in pass 1 */
ParserState->Aml = ParserState->PkgEnd;
diff --git a/usr/src/uts/i86pc/io/acpica/interpreter/parser/psopcode.c b/usr/src/uts/i86pc/io/acpica/interpreter/parser/psopcode.c
index 8ef8a6d7a0..2459e0335a 100644
--- a/usr/src/uts/i86pc/io/acpica/interpreter/parser/psopcode.c
+++ b/usr/src/uts/i86pc/io/acpica/interpreter/parser/psopcode.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: psopcode - Parser/Interpreter opcode information table
- * $Revision: 93 $
+ * $Revision: 1.93 $
*
*****************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/interpreter/parser/psparse.c b/usr/src/uts/i86pc/io/acpica/interpreter/parser/psparse.c
index 1d1b1c622e..4f0a9fd9c6 100644
--- a/usr/src/uts/i86pc/io/acpica/interpreter/parser/psparse.c
+++ b/usr/src/uts/i86pc/io/acpica/interpreter/parser/psparse.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: psparse - Parser top level AML parse routines
- * $Revision: 157 $
+ * $Revision: 1.158 $
*
*****************************************************************************/
@@ -533,7 +533,6 @@ AcpiPsParseAml (
ACPI_WALK_STATE *WalkState)
{
ACPI_STATUS Status;
- ACPI_STATUS TerminateStatus;
ACPI_THREAD_STATE *Thread;
ACPI_THREAD_STATE *PrevWalkList = AcpiGbl_CurrentWalkList;
ACPI_WALK_STATE *PreviousWalkState;
@@ -610,6 +609,10 @@ AcpiPsParseAml (
ACPI_REPORT_METHOD_ERROR ("Method execution failed",
WalkState->MethodNode, NULL, Status);
+ /* Ensure proper cleanup */
+
+ WalkState->ParseFlags |= ACPI_PARSE_EXECUTE;
+
/* Check for possible multi-thread reentrancy problem */
if ((Status == AE_ALREADY_EXISTS) &&
@@ -626,16 +629,6 @@ AcpiPsParseAml (
}
}
- if (WalkState->MethodDesc)
- {
- /* Decrement the thread count on the method parse tree */
-
- if (WalkState->MethodDesc->Method.ThreadCount)
- {
- WalkState->MethodDesc->Method.ThreadCount--;
- }
- }
-
/* We are done with this walk, move on to the parent if any */
WalkState = AcpiDsPopWalkState (Thread);
@@ -650,14 +643,14 @@ AcpiPsParseAml (
*/
if ((WalkState->ParseFlags & ACPI_PARSE_MODE_MASK) == ACPI_PARSE_EXECUTE)
{
- TerminateStatus = AcpiDsTerminateControlMethod (WalkState);
- if (ACPI_FAILURE (TerminateStatus))
+ if (WalkState->MethodDesc)
{
- ACPI_REPORT_ERROR ((
- "Could not terminate control method properly\n"));
+ /* Decrement the thread count on the method parse tree */
- /* Ignore error and continue */
+ WalkState->MethodDesc->Method.ThreadCount--;
}
+
+ AcpiDsTerminateControlMethod (WalkState);
}
/* Delete this walk state and all linked control states */
diff --git a/usr/src/uts/i86pc/io/acpica/interpreter/parser/psscope.c b/usr/src/uts/i86pc/io/acpica/interpreter/parser/psscope.c
index 3b93e61062..8ef2d55ed1 100644
--- a/usr/src/uts/i86pc/io/acpica/interpreter/parser/psscope.c
+++ b/usr/src/uts/i86pc/io/acpica/interpreter/parser/psscope.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: psscope - Parser scope stack management routines
- * $Revision: 42 $
+ * $Revision: 1.42 $
*
*****************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/interpreter/parser/pstree.c b/usr/src/uts/i86pc/io/acpica/interpreter/parser/pstree.c
index 9a95799f02..36815b1e6b 100644
--- a/usr/src/uts/i86pc/io/acpica/interpreter/parser/pstree.c
+++ b/usr/src/uts/i86pc/io/acpica/interpreter/parser/pstree.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: pstree - Parser op tree manipulation/traversal/search
- * $Revision: 46 $
+ * $Revision: 1.46 $
*
*****************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/interpreter/parser/psutils.c b/usr/src/uts/i86pc/io/acpica/interpreter/parser/psutils.c
index 1e2afbe947..82983922a3 100644
--- a/usr/src/uts/i86pc/io/acpica/interpreter/parser/psutils.c
+++ b/usr/src/uts/i86pc/io/acpica/interpreter/parser/psutils.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: psutils - Parser miscellaneous utilities (Parser only)
- * $Revision: 65 $
+ * $Revision: 1.66 $
*
*****************************************************************************/
@@ -280,11 +280,11 @@ AcpiPsFreeOp (
if (Op->Common.Flags & ACPI_PARSEOP_GENERIC)
{
- AcpiOsReleaseObject (AcpiGbl_PsNodeCache, Op);
+ (void) AcpiOsReleaseObject (AcpiGbl_PsNodeCache, Op);
}
else
{
- AcpiOsReleaseObject (AcpiGbl_PsNodeExtCache, Op);
+ (void) AcpiOsReleaseObject (AcpiGbl_PsNodeExtCache, Op);
}
}
diff --git a/usr/src/uts/i86pc/io/acpica/interpreter/parser/pswalk.c b/usr/src/uts/i86pc/io/acpica/interpreter/parser/pswalk.c
index 87380a41ac..ae88ac5c6b 100644
--- a/usr/src/uts/i86pc/io/acpica/interpreter/parser/pswalk.c
+++ b/usr/src/uts/i86pc/io/acpica/interpreter/parser/pswalk.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: pswalk - Parser routines to walk parsed op tree(s)
- * $Revision: 75 $
+ * $Revision: 1.75 $
*
*****************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/interpreter/parser/psxface.c b/usr/src/uts/i86pc/io/acpica/interpreter/parser/psxface.c
index a1ffc60b98..1aa6b94473 100644
--- a/usr/src/uts/i86pc/io/acpica/interpreter/parser/psxface.c
+++ b/usr/src/uts/i86pc/io/acpica/interpreter/parser/psxface.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: psxface - Parser external interfaces
- * $Revision: 79 $
+ * $Revision: 1.84 $
*
*****************************************************************************/
@@ -120,19 +120,195 @@
#include "acparser.h"
#include "acdispat.h"
#include "acinterp.h"
-#include "acnamesp.h"
#define _COMPONENT ACPI_PARSER
ACPI_MODULE_NAME ("psxface")
+/* Local Prototypes */
+
+static void
+AcpiPsStartTrace (
+ ACPI_PARAMETER_INFO *Info);
+
+static void
+AcpiPsStopTrace (
+ ACPI_PARAMETER_INFO *Info);
+
+static ACPI_STATUS
+AcpiPsExecutePass (
+ ACPI_PARAMETER_INFO *Info);
+
+static void
+AcpiPsUpdateParameterList (
+ ACPI_PARAMETER_INFO *Info,
+ UINT16 Action);
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDebugTrace
+ *
+ * PARAMETERS: MethodName - Valid ACPI name string
+ * DebugLevel - Optional level mask. 0 to use default
+ * DebugLayer - Optional layer mask. 0 to use default
+ * Flags - bit 1: one shot(1) or persistent(0)
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: External interface to enable debug tracing during control
+ * method execution
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiDebugTrace (
+ char *Name,
+ UINT32 DebugLevel,
+ UINT32 DebugLayer,
+ UINT32 Flags)
+{
+ ACPI_STATUS Status;
+
+
+ Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ /* TBDs: Validate name, allow full path or just nameseg */
+
+ AcpiGbl_TraceMethodName = *(UINT32 *) Name;
+ AcpiGbl_TraceFlags = Flags;
+
+ if (DebugLevel)
+ {
+ AcpiGbl_TraceDbgLevel = DebugLevel;
+ }
+ if (DebugLayer)
+ {
+ AcpiGbl_TraceDbgLayer = DebugLayer;
+ }
+
+ (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
+ return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiPsStartTrace
+ *
+ * PARAMETERS: Info - Method info struct
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Start control method execution trace
+ *
+ ******************************************************************************/
+
+static void
+AcpiPsStartTrace (
+ ACPI_PARAMETER_INFO *Info)
+{
+ ACPI_STATUS Status;
+
+
+ ACPI_FUNCTION_ENTRY ();
+
+
+ Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+
+ if ((!AcpiGbl_TraceMethodName) ||
+ (AcpiGbl_TraceMethodName != Info->Node->Name.Integer))
+ {
+ goto Exit;
+ }
+
+ AcpiGbl_OriginalDbgLevel = AcpiDbgLevel;
+ AcpiGbl_OriginalDbgLayer = AcpiDbgLayer;
+
+ AcpiDbgLevel = 0x00FFFFFF;
+ AcpiDbgLayer = ACPI_UINT32_MAX;
+
+ if (AcpiGbl_TraceDbgLevel)
+ {
+ AcpiDbgLevel = AcpiGbl_TraceDbgLevel;
+ }
+ if (AcpiGbl_TraceDbgLayer)
+ {
+ AcpiDbgLayer = AcpiGbl_TraceDbgLayer;
+ }
+
+
+Exit:
+ (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
+}
+
/*******************************************************************************
*
- * FUNCTION: AcpiPsxExecute
+ * FUNCTION: AcpiPsStopTrace
+ *
+ * PARAMETERS: Info - Method info struct
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Stop control method execution trace
+ *
+ ******************************************************************************/
+
+static void
+AcpiPsStopTrace (
+ ACPI_PARAMETER_INFO *Info)
+{
+ ACPI_STATUS Status;
+
+
+ ACPI_FUNCTION_ENTRY ();
+
+
+ Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+
+ if ((!AcpiGbl_TraceMethodName) ||
+ (AcpiGbl_TraceMethodName != Info->Node->Name.Integer))
+ {
+ goto Exit;
+ }
+
+ /* Disable further tracing if type is one-shot */
+
+ if (AcpiGbl_TraceFlags & 1)
+ {
+ AcpiGbl_TraceMethodName = 0;
+ AcpiGbl_TraceDbgLevel = 0;
+ AcpiGbl_TraceDbgLayer = 0;
+ }
+
+ AcpiDbgLevel = AcpiGbl_OriginalDbgLevel;
+ AcpiDbgLayer = AcpiGbl_OriginalDbgLayer;
+
+Exit:
+ (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiPsExecuteMethod
*
* PARAMETERS: Info - Method info block, contains:
* Node - Method Node to execute
+ * ObjDesc - Method object
* Parameters - List of parameters to pass to the method,
* terminated by NULL. Params itself may be
* NULL if no parameters are being passed.
@@ -141,6 +317,7 @@
* ParameterType - Type of Parameter list
* ReturnObject - Where to put method's return value (if
* any). If NULL, no value is returned.
+ * PassNumber - Parse or execute pass
*
* RETURN: Status
*
@@ -149,191 +326,198 @@
******************************************************************************/
ACPI_STATUS
-AcpiPsxExecute (
+AcpiPsExecuteMethod (
ACPI_PARAMETER_INFO *Info)
{
ACPI_STATUS Status;
- ACPI_OPERAND_OBJECT *ObjDesc;
- UINT32 i;
- ACPI_PARSE_OBJECT *Op;
- ACPI_WALK_STATE *WalkState;
- ACPI_FUNCTION_TRACE ("PsxExecute");
+ ACPI_FUNCTION_TRACE ("PsExecuteMethod");
- /* Validate the Node and get the attached object */
+ /* Validate the Info and method Node */
if (!Info || !Info->Node)
{
return_ACPI_STATUS (AE_NULL_ENTRY);
}
- ObjDesc = AcpiNsGetAttachedObject (Info->Node);
- if (!ObjDesc)
- {
- return_ACPI_STATUS (AE_NULL_OBJECT);
- }
-
/* Init for new method, wait on concurrency semaphore */
- Status = AcpiDsBeginMethodExecution (Info->Node, ObjDesc, NULL);
+ Status = AcpiDsBeginMethodExecution (Info->Node, Info->ObjDesc, NULL);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
- if ((Info->ParameterType == ACPI_PARAM_ARGS) &&
- (Info->Parameters))
- {
- /*
- * The caller "owns" the parameters, so give each one an extra
- * reference
- */
- for (i = 0; Info->Parameters[i]; i++)
- {
- AcpiUtAddReference (Info->Parameters[i]);
- }
- }
-
/*
- * 1) Perform the first pass parse of the method to enter any
- * named objects that it creates into the namespace
+ * The caller "owns" the parameters, so give each one an extra
+ * reference
*/
- ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
- "**** Begin Method Parse **** Entry=%p obj=%p\n",
- Info->Node, ObjDesc));
+ AcpiPsUpdateParameterList (Info, REF_INCREMENT);
- /* Create and init a Root Node */
+ /* Begin tracing if requested */
- Op = AcpiPsCreateScopeOp ();
- if (!Op)
- {
- Status = AE_NO_MEMORY;
- goto Cleanup1;
- }
+ AcpiPsStartTrace (Info);
/*
- * Get a new OwnerId for objects created by this method. Namespace
- * objects (such as Operation Regions) can be created during the
- * first pass parse.
+ * 1) Perform the first pass parse of the method to enter any
+ * named objects that it creates into the namespace
*/
- Status = AcpiUtAllocateOwnerId (&ObjDesc->Method.OwnerId);
- if (ACPI_FAILURE (Status))
- {
- goto Cleanup2;
- }
-
- /* Create and initialize a new walk state */
-
- WalkState = AcpiDsCreateWalkState (ObjDesc->Method.OwnerId,
- NULL, NULL, NULL);
- if (!WalkState)
- {
- Status = AE_NO_MEMORY;
- goto Cleanup2;
- }
-
- Status = AcpiDsInitAmlWalk (WalkState, Op, Info->Node,
- ObjDesc->Method.AmlStart,
- ObjDesc->Method.AmlLength, NULL, 1);
- if (ACPI_FAILURE (Status))
- {
- goto Cleanup3;
- }
-
- /* Parse the AML */
+ ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
+ "**** Begin Method Parse **** Entry=%p obj=%p\n",
+ Info->Node, Info->ObjDesc));
- Status = AcpiPsParseAml (WalkState);
- AcpiPsDeleteParseTree (Op);
+ Info->PassNumber = 1;
+ Status = AcpiPsExecutePass (Info);
if (ACPI_FAILURE (Status))
{
- goto Cleanup1; /* Walk state is already deleted */
+ goto Cleanup;
}
/*
- * 2) Execute the method. Performs second pass parse simultaneously
+ * 2) Execute the method. Performs second pass parse simultaneously
*/
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
"**** Begin Method Execution **** Entry=%p obj=%p\n",
- Info->Node, ObjDesc));
+ Info->Node, Info->ObjDesc));
- /* Create and init a Root Node */
+ Info->PassNumber = 3;
+ Status = AcpiPsExecutePass (Info);
- Op = AcpiPsCreateScopeOp ();
- if (!Op)
- {
- Status = AE_NO_MEMORY;
- goto Cleanup1;
- }
- /* Init new op with the method name and pointer back to the NS node */
+Cleanup:
+ /* End optional tracing */
- AcpiPsSetName (Op, Info->Node->Name.Integer);
- Op->Common.Node = Info->Node;
+ AcpiPsStopTrace (Info);
- /* Create and initialize a new walk state */
+ /* Take away the extra reference that we gave the parameters above */
- WalkState = AcpiDsCreateWalkState (0, NULL, NULL, NULL);
- if (!WalkState)
+ AcpiPsUpdateParameterList (Info, REF_DECREMENT);
+
+ /* Exit now if error above */
+
+ if (ACPI_FAILURE (Status))
{
- Status = AE_NO_MEMORY;
- goto Cleanup2;
+ return_ACPI_STATUS (Status);
}
- Status = AcpiDsInitAmlWalk (WalkState, Op, Info->Node,
- ObjDesc->Method.AmlStart,
- ObjDesc->Method.AmlLength, Info, 3);
- if (ACPI_FAILURE (Status))
+ /*
+ * If the method has returned an object, signal this to the caller with
+ * a control exception code
+ */
+ if (Info->ReturnObject)
{
- goto Cleanup3;
+ ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Method returned ObjDesc=%p\n",
+ Info->ReturnObject));
+ ACPI_DUMP_STACK_ENTRY (Info->ReturnObject);
+
+ Status = AE_CTRL_RETURN_VALUE;
}
- /* The walk of the parse tree is where we actually execute the method */
+ return_ACPI_STATUS (Status);
+}
- Status = AcpiPsParseAml (WalkState);
- goto Cleanup2; /* Walk state already deleted */
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiPsUpdateParameterList
+ *
+ * PARAMETERS: Info - See ACPI_PARAMETER_INFO
+ * (Used: ParameterType and Parameters)
+ * Action - Add or Remove reference
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Update reference count on all method parameter objects
+ *
+ ******************************************************************************/
-Cleanup3:
- AcpiDsDeleteWalkState (WalkState);
+static void
+AcpiPsUpdateParameterList (
+ ACPI_PARAMETER_INFO *Info,
+ UINT16 Action)
+{
+ ACPI_NATIVE_UINT i;
-Cleanup2:
- AcpiPsDeleteParseTree (Op);
-Cleanup1:
if ((Info->ParameterType == ACPI_PARAM_ARGS) &&
(Info->Parameters))
{
- /* Take away the extra reference that we gave the parameters above */
+ /* Update reference count for each parameter */
for (i = 0; Info->Parameters[i]; i++)
{
/* Ignore errors, just do them all */
- (void) AcpiUtUpdateObjectReference (
- Info->Parameters[i], REF_DECREMENT);
+ (void) AcpiUtUpdateObjectReference (Info->Parameters[i], Action);
}
}
+}
- if (ACPI_FAILURE (Status))
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiPsExecutePass
+ *
+ * PARAMETERS: Info - See ACPI_PARAMETER_INFO
+ * (Used: PassNumber, Node, and ObjDesc)
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Single AML pass: Parse or Execute a control method
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiPsExecutePass (
+ ACPI_PARAMETER_INFO *Info)
+{
+ ACPI_STATUS Status;
+ ACPI_PARSE_OBJECT *Op;
+ ACPI_WALK_STATE *WalkState;
+
+
+ ACPI_FUNCTION_TRACE ("PsExecutePass");
+
+
+ /* Create and init a Root Node */
+
+ Op = AcpiPsCreateScopeOp ();
+ if (!Op)
{
- return_ACPI_STATUS (Status);
+ return_ACPI_STATUS (AE_NO_MEMORY);
}
- /*
- * If the method has returned an object, signal this to the caller with
- * a control exception code
- */
- if (Info->ReturnObject)
+ /* Create and initialize a new walk state */
+
+ WalkState = AcpiDsCreateWalkState (
+ Info->ObjDesc->Method.OwnerId, NULL, NULL, NULL);
+ if (!WalkState)
{
- ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Method returned ObjDesc=%p\n",
- Info->ReturnObject));
- ACPI_DUMP_STACK_ENTRY (Info->ReturnObject);
+ Status = AE_NO_MEMORY;
+ goto Cleanup;
+ }
- Status = AE_CTRL_RETURN_VALUE;
+ Status = AcpiDsInitAmlWalk (WalkState, Op, Info->Node,
+ Info->ObjDesc->Method.AmlStart,
+ Info->ObjDesc->Method.AmlLength,
+ Info->PassNumber == 1 ? NULL : Info,
+ Info->PassNumber);
+ if (ACPI_FAILURE (Status))
+ {
+ AcpiDsDeleteWalkState (WalkState);
+ goto Cleanup;
}
+ /* Parse the AML */
+
+ Status = AcpiPsParseAml (WalkState);
+
+ /* Walk state was deleted by ParseAml */
+
+Cleanup:
+ AcpiPsDeleteParseTree (Op);
return_ACPI_STATUS (Status);
}
diff --git a/usr/src/uts/i86pc/io/acpica/namespace/nsaccess.c b/usr/src/uts/i86pc/io/acpica/namespace/nsaccess.c
index aee8df15e8..d6c5ca0aed 100644
--- a/usr/src/uts/i86pc/io/acpica/namespace/nsaccess.c
+++ b/usr/src/uts/i86pc/io/acpica/namespace/nsaccess.c
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: nsaccess - Top-level functions for accessing ACPI namespace
- * $Revision: 190 $
+ * $Revision: 1.192 $
*
******************************************************************************/
@@ -243,19 +243,20 @@ AcpiNsRootInitialize (
ObjDesc->Method.ParamCount = (UINT8) ACPI_TO_INTEGER (Val);
ObjDesc->Common.Flags |= AOPOBJ_DATA_VALID;
-#if defined (ACPI_ASL_COMPILER) || defined (ACPI_DUMP_APP)
+#if defined (ACPI_ASL_COMPILER)
- /*
- * iASL Compiler cheats by putting parameter count
- * in the OwnerID (ParamCount max is 7)
- */
- NewNode->OwnerId = ObjDesc->Method.ParamCount;
+ /* Save the parameter count for the iASL compiler */
+
+ NewNode->Value = ObjDesc->Method.ParamCount;
#else
/* Mark this as a very SPECIAL method */
ObjDesc->Method.MethodFlags = AML_METHOD_INTERNAL_ONLY;
+
+#ifndef ACPI_DUMP_APP
ObjDesc->Method.Implementation = AcpiUtOsiImplementation;
#endif
+#endif
break;
case ACPI_TYPE_INTEGER:
@@ -600,7 +601,7 @@ AcpiNsLookup (
Path++;
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
- "Multi Pathname (%d Segments, Flags=%X) \n",
+ "Multi Pathname (%d Segments, Flags=%X)\n",
NumSegments, Flags));
break;
diff --git a/usr/src/uts/i86pc/io/acpica/namespace/nsalloc.c b/usr/src/uts/i86pc/io/acpica/namespace/nsalloc.c
index 736595fe26..0aaa350b44 100644
--- a/usr/src/uts/i86pc/io/acpica/namespace/nsalloc.c
+++ b/usr/src/uts/i86pc/io/acpica/namespace/nsalloc.c
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: nsalloc - Namespace allocation and deletion utilities
- * $Revision: 94 $
+ * $Revision: 1.97 $
*
******************************************************************************/
@@ -258,10 +258,9 @@ AcpiNsDeleteNode (
* DESCRIPTION: Initialize a new namespace node and install it amongst
* its peers.
*
- * Note: Current namespace lookup is linear search. However, the
- * nodes are linked in alphabetical order to 1) put all reserved
- * names (start with underscore) first, and to 2) make a readable
- * namespace dump.
+ * Note: Current namespace lookup is linear search. This appears
+ * to be sufficient as namespace searches consume only a small
+ * fraction of the execution time of the ACPI subsystem.
*
******************************************************************************/
@@ -274,10 +273,6 @@ AcpiNsInstallNode (
{
ACPI_OWNER_ID OwnerId = 0;
ACPI_NAMESPACE_NODE *ChildNode;
-#ifdef ACPI_ALPHABETIC_NAMESPACE
-
- ACPI_NAMESPACE_NODE *PreviousChildNode;
-#endif
ACPI_FUNCTION_TRACE ("NsInstallNode");
@@ -304,62 +299,6 @@ AcpiNsInstallNode (
}
else
{
-#ifdef ACPI_ALPHABETIC_NAMESPACE
- /*
- * Walk the list whilst searching for the correct
- * alphabetic placement.
- */
- PreviousChildNode = NULL;
- while (AcpiNsCompareNames (AcpiUtGetNodeName (ChildNode),
- AcpiUtGetNodeName (Node)) < 0)
- {
- if (ChildNode->Flags & ANOBJ_END_OF_PEER_LIST)
- {
- /* Last peer; Clear end-of-list flag */
-
- ChildNode->Flags &= ~ANOBJ_END_OF_PEER_LIST;
-
- /* This node is the new peer to the child node */
-
- ChildNode->Peer = Node;
-
- /* This node is the new end-of-list */
-
- Node->Flags |= ANOBJ_END_OF_PEER_LIST;
- Node->Peer = ParentNode;
- break;
- }
-
- /* Get next peer */
-
- PreviousChildNode = ChildNode;
- ChildNode = ChildNode->Peer;
- }
-
- /* Did the node get inserted at the end-of-list? */
-
- if (!(Node->Flags & ANOBJ_END_OF_PEER_LIST))
- {
- /*
- * Loop above terminated without reaching the end-of-list.
- * Insert the new node at the current location
- */
- if (PreviousChildNode)
- {
- /* Insert node alphabetically */
-
- Node->Peer = ChildNode;
- PreviousChildNode->Peer = Node;
- }
- else
- {
- /* Insert node alphabetically at start of list */
-
- Node->Peer = ChildNode;
- ParentNode->Child = Node;
- }
- }
-#else
while (!(ChildNode->Flags & ANOBJ_END_OF_PEER_LIST))
{
ChildNode = ChildNode->Peer;
@@ -370,9 +309,8 @@ AcpiNsInstallNode (
/* Clear end-of-list flag */
ChildNode->Flags &= ~ANOBJ_END_OF_PEER_LIST;
- Node->Flags |= ANOBJ_END_OF_PEER_LIST;
+ Node->Flags |= ANOBJ_END_OF_PEER_LIST;
Node->Peer = ParentNode;
-#endif
}
/* Init the new entry */
@@ -675,6 +613,11 @@ AcpiNsDeleteNamespaceByOwner (
ACPI_FUNCTION_TRACE_U32 ("NsDeleteNamespaceByOwner", OwnerId);
+ if (OwnerId == 0)
+ {
+ return_VOID;
+ }
+
ParentNode = AcpiGbl_RootNode;
ChildNode = NULL;
DeletionNode = NULL;
@@ -749,62 +692,7 @@ AcpiNsDeleteNamespaceByOwner (
}
}
- (void) AcpiUtReleaseOwnerId (OwnerId);
return_VOID;
}
-#ifdef ACPI_ALPHABETIC_NAMESPACE
-/*******************************************************************************
- *
- * FUNCTION: AcpiNsCompareNames
- *
- * PARAMETERS: Name1 - First name to compare
- * Name2 - Second name to compare
- *
- * RETURN: value from strncmp
- *
- * DESCRIPTION: Compare two ACPI names. Names that are prefixed with an
- * underscore are forced to be alphabetically first.
- *
- ******************************************************************************/
-
-int
-AcpiNsCompareNames (
- char *Name1,
- char *Name2)
-{
- char ReversedName1[ACPI_NAME_SIZE];
- char ReversedName2[ACPI_NAME_SIZE];
- UINT32 i;
- UINT32 j;
-
-
- /*
- * Replace all instances of "underscore" with a value that is smaller so
- * that all names that are prefixed with underscore(s) are alphabetically
- * first.
- *
- * Reverse the name bytewise so we can just do a 32-bit compare instead
- * of a strncmp.
- */
- for (i = 0, j= (ACPI_NAME_SIZE - 1); i < ACPI_NAME_SIZE; i++, j--)
- {
- ReversedName1[j] = Name1[i];
- if (Name1[i] == '_')
- {
- ReversedName1[j] = '*';
- }
-
- ReversedName2[j] = Name2[i];
- if (Name2[i] == '_')
- {
- ReversedName2[j] = '*';
- }
- }
-
- return (*(int *) ReversedName1 - *(int *) ReversedName2);
-}
-#endif
-
-
diff --git a/usr/src/uts/i86pc/io/acpica/namespace/nsdump.c b/usr/src/uts/i86pc/io/acpica/namespace/nsdump.c
index 218df13ed6..597856ebc8 100644
--- a/usr/src/uts/i86pc/io/acpica/namespace/nsdump.c
+++ b/usr/src/uts/i86pc/io/acpica/namespace/nsdump.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: nsdump - table dumping routines for debug
- * $Revision: 170 $
+ * $Revision: 1.172 $
*
*****************************************************************************/
@@ -160,6 +160,9 @@ AcpiNsPrintPathname (
UINT32 NumSegments,
char *Pathname)
{
+ ACPI_NATIVE_UINT i;
+
+
ACPI_FUNCTION_NAME ("NsPrintPathname");
@@ -174,9 +177,14 @@ AcpiNsPrintPathname (
while (NumSegments)
{
- AcpiOsPrintf ("%4.4s", Pathname);
- Pathname += ACPI_NAME_SIZE;
+ for (i = 0; i < 4; i++)
+ {
+ ACPI_IS_PRINT (Pathname[i]) ?
+ AcpiOsPrintf ("%c", Pathname[i]) :
+ AcpiOsPrintf ("?");
+ }
+ Pathname += ACPI_NAME_SIZE;
NumSegments--;
if (NumSegments)
{
diff --git a/usr/src/uts/i86pc/io/acpica/namespace/nsdumpdv.c b/usr/src/uts/i86pc/io/acpica/namespace/nsdumpdv.c
index 092f9a9db1..338befe518 100644
--- a/usr/src/uts/i86pc/io/acpica/namespace/nsdumpdv.c
+++ b/usr/src/uts/i86pc/io/acpica/namespace/nsdumpdv.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: nsdump - table dumping routines for debug
- * $Revision: 16 $
+ * $Revision: 1.16 $
*
*****************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/namespace/nseval.c b/usr/src/uts/i86pc/io/acpica/namespace/nseval.c
index 545b4e3392..99c1aed0f4 100644
--- a/usr/src/uts/i86pc/io/acpica/namespace/nseval.c
+++ b/usr/src/uts/i86pc/io/acpica/namespace/nseval.c
@@ -2,7 +2,7 @@
*
* Module Name: nseval - Object evaluation interfaces -- includes control
* method lookup and execution.
- * $Revision: 133 $
+ * $Revision: 1.134 $
*
******************************************************************************/
@@ -458,6 +458,7 @@ AcpiNsEvaluateByHandle (
*
* PARAMETERS: Info - Method info block, contains:
* Node - Method Node to execute
+ * ObjDesc - Method object
* Parameters - List of parameters to pass to the method,
* terminated by NULL. Params itself may be
* NULL if no parameters are being passed.
@@ -480,7 +481,6 @@ AcpiNsExecuteControlMethod (
ACPI_PARAMETER_INFO *Info)
{
ACPI_STATUS Status;
- ACPI_OPERAND_OBJECT *ObjDesc;
ACPI_FUNCTION_TRACE ("NsExecuteControlMethod");
@@ -488,8 +488,8 @@ AcpiNsExecuteControlMethod (
/* Verify that there is a method associated with this object */
- ObjDesc = AcpiNsGetAttachedObject (Info->Node);
- if (!ObjDesc)
+ Info->ObjDesc = AcpiNsGetAttachedObject (Info->Node);
+ if (!Info->ObjDesc)
{
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No attached method object\n"));
@@ -501,7 +501,7 @@ AcpiNsExecuteControlMethod (
ACPI_LV_INFO, _COMPONENT);
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Method at AML address %p Length %X\n",
- ObjDesc->Method.AmlStart + 1, ObjDesc->Method.AmlLength - 1));
+ Info->ObjDesc->Method.AmlStart + 1, Info->ObjDesc->Method.AmlLength - 1));
/*
* Unlock the namespace before execution. This allows namespace access
@@ -526,7 +526,7 @@ AcpiNsExecuteControlMethod (
return_ACPI_STATUS (Status);
}
- Status = AcpiPsxExecute (Info);
+ Status = AcpiPsExecuteMethod (Info);
AcpiExExitInterpreter ();
return_ACPI_STATUS (Status);
diff --git a/usr/src/uts/i86pc/io/acpica/namespace/nsinit.c b/usr/src/uts/i86pc/io/acpica/namespace/nsinit.c
index 6dac8dc216..6c2e40cebf 100644
--- a/usr/src/uts/i86pc/io/acpica/namespace/nsinit.c
+++ b/usr/src/uts/i86pc/io/acpica/namespace/nsinit.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: nsinit - namespace initialization
- * $Revision: 68 $
+ * $Revision: 1.68 $
*
*****************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/namespace/nsload.c b/usr/src/uts/i86pc/io/acpica/namespace/nsload.c
index 7b4a2fbf8f..7c72fb7bac 100644
--- a/usr/src/uts/i86pc/io/acpica/namespace/nsload.c
+++ b/usr/src/uts/i86pc/io/acpica/namespace/nsload.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: nsload - namespace loading/expanding/contracting procedures
- * $Revision: 72 $
+ * $Revision: 1.73 $
*
*****************************************************************************/
@@ -279,7 +279,7 @@ AcpiNsLoadTableByType (
{
case ACPI_TABLE_DSDT:
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Loading DSDT\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Namespace load: DSDT\n"));
TableDesc = AcpiGbl_TableLists[ACPI_TABLE_DSDT].Next;
@@ -301,18 +301,19 @@ AcpiNsLoadTableByType (
case ACPI_TABLE_SSDT:
+ case ACPI_TABLE_PSDT:
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Loading %d SSDTs\n",
- AcpiGbl_TableLists[ACPI_TABLE_SSDT].Count));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Namespace load: %d SSDT or PSDTs\n",
+ AcpiGbl_TableLists[TableType].Count));
/*
- * Traverse list of SSDT tables
+ * Traverse list of SSDT or PSDT tables
*/
- TableDesc = AcpiGbl_TableLists[ACPI_TABLE_SSDT].Next;
- for (i = 0; i < AcpiGbl_TableLists[ACPI_TABLE_SSDT].Count; i++)
+ TableDesc = AcpiGbl_TableLists[TableType].Next;
+ for (i = 0; i < AcpiGbl_TableLists[TableType].Count; i++)
{
/*
- * Only attempt to load table if it is not
+ * Only attempt to load table into namespace if it is not
* already loaded!
*/
if (!TableDesc->LoadedIntoNamespace)
@@ -331,36 +332,6 @@ AcpiNsLoadTableByType (
break;
- case ACPI_TABLE_PSDT:
-
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Loading %d PSDTs\n",
- AcpiGbl_TableLists[ACPI_TABLE_PSDT].Count));
-
- /*
- * Traverse list of PSDT tables
- */
- TableDesc = AcpiGbl_TableLists[ACPI_TABLE_PSDT].Next;
-
- for (i = 0; i < AcpiGbl_TableLists[ACPI_TABLE_PSDT].Count; i++)
- {
- /* Only attempt to load table if it is not already loaded! */
-
- if (!TableDesc->LoadedIntoNamespace)
- {
- Status = AcpiNsLoadTable (TableDesc, AcpiGbl_RootNode);
- if (ACPI_FAILURE (Status))
- {
- break;
- }
-
- TableDesc->LoadedIntoNamespace = TRUE;
- }
-
- TableDesc = TableDesc->Next;
- }
- break;
-
-
default:
Status = AE_SUPPORT;
break;
diff --git a/usr/src/uts/i86pc/io/acpica/namespace/nsnames.c b/usr/src/uts/i86pc/io/acpica/namespace/nsnames.c
index 8e8d1bd500..6792203a73 100644
--- a/usr/src/uts/i86pc/io/acpica/namespace/nsnames.c
+++ b/usr/src/uts/i86pc/io/acpica/namespace/nsnames.c
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: nsnames - Name manipulation and search
- * $Revision: 90 $
+ * $Revision: 1.91 $
*
******************************************************************************/
@@ -347,7 +347,7 @@ AcpiNsHandleToPathname (
AcpiNsBuildExternalPath (Node, RequiredSize, Buffer->Pointer);
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%s [%X] \n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%s [%X]\n",
(char *) Buffer->Pointer, (UINT32) RequiredSize));
return_ACPI_STATUS (AE_OK);
}
diff --git a/usr/src/uts/i86pc/io/acpica/namespace/nsobject.c b/usr/src/uts/i86pc/io/acpica/namespace/nsobject.c
index 753debd352..18a1d56c3b 100644
--- a/usr/src/uts/i86pc/io/acpica/namespace/nsobject.c
+++ b/usr/src/uts/i86pc/io/acpica/namespace/nsobject.c
@@ -2,7 +2,7 @@
*
* Module Name: nsobject - Utilities for objects attached to namespace
* table entries
- * $Revision: 93 $
+ * $Revision: 1.93 $
*
******************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/namespace/nsparse.c b/usr/src/uts/i86pc/io/acpica/namespace/nsparse.c
index f5d64b2927..5b6d318c6b 100644
--- a/usr/src/uts/i86pc/io/acpica/namespace/nsparse.c
+++ b/usr/src/uts/i86pc/io/acpica/namespace/nsparse.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: nsparse - namespace interface to AML parser
- * $Revision: 9 $
+ * $Revision: 1.10 $
*
*****************************************************************************/
@@ -141,7 +141,7 @@
ACPI_STATUS
AcpiNsOneCompleteParse (
- UINT32 PassNumber,
+ UINT8 PassNumber,
ACPI_TABLE_DESC *TableDesc)
{
ACPI_PARSE_OBJECT *ParseRoot;
diff --git a/usr/src/uts/i86pc/io/acpica/namespace/nssearch.c b/usr/src/uts/i86pc/io/acpica/namespace/nssearch.c
index 4063e15ab5..29952e0f93 100644
--- a/usr/src/uts/i86pc/io/acpica/namespace/nssearch.c
+++ b/usr/src/uts/i86pc/io/acpica/namespace/nssearch.c
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: nssearch - Namespace search
- * $Revision: 106 $
+ * $Revision: 1.106 $
*
******************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/namespace/nsutils.c b/usr/src/uts/i86pc/io/acpica/namespace/nsutils.c
index 93c7104171..4f5929da4f 100644
--- a/usr/src/uts/i86pc/io/acpica/namespace/nsutils.c
+++ b/usr/src/uts/i86pc/io/acpica/namespace/nsutils.c
@@ -2,7 +2,7 @@
*
* Module Name: nsutils - Utilities for accessing ACPI namespace, accessing
* parents and siblings and Scope manipulation
- * $Revision: 140 $
+ * $Revision: 1.141 $
*
*****************************************************************************/
@@ -363,10 +363,10 @@ AcpiNsGetType (
if (!Node)
{
ACPI_REPORT_WARNING (("NsGetType: Null Node input pointer\n"));
- return_VALUE (ACPI_TYPE_ANY);
+ return_UINT32 (ACPI_TYPE_ANY);
}
- return_VALUE ((ACPI_OBJECT_TYPE) Node->Type);
+ return_UINT32 ((ACPI_OBJECT_TYPE) Node->Type);
}
@@ -395,10 +395,10 @@ AcpiNsLocal (
/* Type code out of range */
ACPI_REPORT_WARNING (("NsLocal: Invalid Object Type\n"));
- return_VALUE (ACPI_NS_NORMAL);
+ return_UINT32 (ACPI_NS_NORMAL);
}
- return_VALUE ((UINT32) AcpiGbl_NsProperties[Type] & ACPI_NS_LOCAL);
+ return_UINT32 ((UINT32) AcpiGbl_NsProperties[Type] & ACPI_NS_LOCAL);
}
@@ -1018,10 +1018,10 @@ AcpiNsOpensScope (
/* type code out of range */
ACPI_REPORT_WARNING (("NsOpensScope: Invalid Object Type %X\n", Type));
- return_VALUE (ACPI_NS_NORMAL);
+ return_UINT32 (ACPI_NS_NORMAL);
}
- return_VALUE (((UINT32) AcpiGbl_NsProperties[Type]) & ACPI_NS_NEWSCOPE);
+ return_UINT32 (((UINT32) AcpiGbl_NsProperties[Type]) & ACPI_NS_NEWSCOPE);
}
diff --git a/usr/src/uts/i86pc/io/acpica/namespace/nswalk.c b/usr/src/uts/i86pc/io/acpica/namespace/nswalk.c
index f8c137fe92..af784e249a 100644
--- a/usr/src/uts/i86pc/io/acpica/namespace/nswalk.c
+++ b/usr/src/uts/i86pc/io/acpica/namespace/nswalk.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: nswalk - Functions for walking the ACPI namespace
- * $Revision: 39 $
+ * $Revision: 1.39 $
*
*****************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/namespace/nsxfeval.c b/usr/src/uts/i86pc/io/acpica/namespace/nsxfeval.c
index 87fc6004cc..643215c715 100644
--- a/usr/src/uts/i86pc/io/acpica/namespace/nsxfeval.c
+++ b/usr/src/uts/i86pc/io/acpica/namespace/nsxfeval.c
@@ -2,7 +2,7 @@
*
* Module Name: nsxfeval - Public interfaces to the ACPI subsystem
* ACPI Object evaluation interfaces
- * $Revision: 17 $
+ * $Revision: 1.17 $
*
******************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/namespace/nsxfname.c b/usr/src/uts/i86pc/io/acpica/namespace/nsxfname.c
index e285bb6794..42e57186e7 100644
--- a/usr/src/uts/i86pc/io/acpica/namespace/nsxfname.c
+++ b/usr/src/uts/i86pc/io/acpica/namespace/nsxfname.c
@@ -2,7 +2,7 @@
*
* Module Name: nsxfname - Public interfaces to the ACPI subsystem
* ACPI Namespace oriented interfaces
- * $Revision: 104 $
+ * $Revision: 1.104 $
*
*****************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/namespace/nsxfobj.c b/usr/src/uts/i86pc/io/acpica/namespace/nsxfobj.c
index 030a661487..0b77522e57 100644
--- a/usr/src/uts/i86pc/io/acpica/namespace/nsxfobj.c
+++ b/usr/src/uts/i86pc/io/acpica/namespace/nsxfobj.c
@@ -2,7 +2,7 @@
*
* Module Name: nsxfobj - Public interfaces to the ACPI subsystem
* ACPI Object oriented interfaces
- * $Revision: 119 $
+ * $Revision: 1.119 $
*
******************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/osl.c b/usr/src/uts/i86pc/io/acpica/osl.c
index 13faedb667..e1172a4f29 100644
--- a/usr/src/uts/i86pc/io/acpica/osl.c
+++ b/usr/src/uts/i86pc/io/acpica/osl.c
@@ -423,7 +423,7 @@ acpi_wrapper_isr(char *arg)
}
}
-int intr_hooked = 0;
+static int acpi_intr_hooked = 0;
ACPI_STATUS
AcpiOsInstallInterruptHandler(UINT32 InterruptNumber,
@@ -451,11 +451,10 @@ AcpiOsInstallInterruptHandler(UINT32 InterruptNumber,
retval = add_avintr(NULL, SCI_IPL, (avfunc)acpi_wrapper_isr,
"ACPI SCI", sci_vect, NULL, NULL, NULL, NULL);
if (retval) {
- intr_hooked = 1;
+ acpi_intr_hooked = 1;
return (AE_OK);
- } else {
+ } else
return (AE_BAD_PARAMETER);
- }
}
ACPI_STATUS
@@ -467,10 +466,10 @@ AcpiOsRemoveInterruptHandler(UINT32 InterruptNumber,
#ifdef DEBUG
cmn_err(CE_NOTE, "!acpica: detaching SCI %d", InterruptNumber);
#endif
- if (intr_hooked) {
+ if (acpi_intr_hooked) {
rem_avintr(NULL, LOCK_LEVEL - 1, (avfunc)acpi_wrapper_isr,
InterruptNumber);
- intr_hooked = 0;
+ acpi_intr_hooked = 0;
}
return (AE_OK);
}
@@ -919,6 +918,63 @@ void ACPI_INTERNAL_VAR_XFACE
AcpiOsPrintf(const char *Format, ...)
{
va_list ap;
+
+ va_start(ap, Format);
+ AcpiOsVprintf(Format, ap);
+ va_end(ap);
+}
+
+/*
+ * When != 0, sends output to console
+ * Patchable with kmdb or /etc/system.
+ */
+int acpica_console_out = 0;
+
+#define ACPICA_OUTBUF_LEN 160
+char acpica_outbuf[ACPICA_OUTBUF_LEN];
+int acpica_outbuf_offset;
+
+/*
+ *
+ */
+static void
+acpica_pr_buf(char *buf, int buflen)
+{
+ char c, *bufp, *outp;
+ int out_remaining;
+
+ /*
+ * copy the supplied buffer into the output buffer
+ * when we hit a '\n' or overflow the output buffer,
+ * output and reset the output buffer
+ */
+ bufp = buf;
+ outp = acpica_outbuf + acpica_outbuf_offset;
+ out_remaining = ACPICA_OUTBUF_LEN - acpica_outbuf_offset - 1;
+ while (c = *bufp++) {
+ *outp++ = c;
+ if (c == '\n' || --out_remaining == 0) {
+ *outp = '\0';
+ if (acpica_console_out)
+ printf(acpica_outbuf);
+ else
+ (void) strlog(0, 0, 0,
+ SL_CONSOLE | SL_NOTE | SL_LOGONLY,
+ acpica_outbuf);
+ acpica_outbuf_offset = 0;
+ outp = acpica_outbuf;
+ out_remaining = ACPICA_OUTBUF_LEN - 1;
+ }
+ }
+
+ acpica_outbuf_offset = outp - acpica_outbuf;
+ kmem_free(buf, buflen);
+}
+
+void
+AcpiOsVprintf(const char *Format, va_list Args)
+{
+ va_list save;
int buflen;
char *buf;
@@ -931,29 +987,15 @@ AcpiOsPrintf(const char *Format, ...)
* If we fail to allocate a string buffer, we resort
* to printf().
*/
- va_start(ap, Format);
- buflen = vsnprintf(NULL, 0, Format, ap) + 1;
- va_end(ap);
-
+ va_copy(save, Args);
+ buflen = vsnprintf(NULL, 0, Format, save) + 1;
buf = kmem_alloc(buflen, KM_NOSLEEP);
if (buf == NULL) {
- va_start(ap, Format);
- vprintf(Format, ap);
- va_end(ap);
+ vprintf(Format, Args);
return;
}
- va_start(ap, Format);
- (void) vsnprintf(buf, buflen, Format, ap);
- va_end(ap);
-
- (void) strlog(0, 0, 0, SL_CONSOLE | SL_NOTE | SL_LOGONLY, buf);
- kmem_free(buf, buflen);
-}
-
-void
-AcpiOsVprintf(const char *Format, va_list Args)
-{
- vprintf(Format, Args);
+ (void) vsnprintf(buf, buflen, Format, Args);
+ acpica_pr_buf(buf, buflen);
}
void
@@ -1351,7 +1393,7 @@ create_d2a_subtree(dev_info_t *dip, ACPI_HANDLE acpiobj, int bus)
int dev, func;
acld = NULL;
- while (AcpiGetNextObject(ACPI_TYPE_ANY, acpiobj, acld, &acld)
+ while (AcpiGetNextObject(ACPI_TYPE_DEVICE, acpiobj, acld, &acld)
== AE_OK) {
/*
diff --git a/usr/src/uts/i86pc/io/acpica/resources/rsaddr.c b/usr/src/uts/i86pc/io/acpica/resources/rsaddr.c
index 7aca0c46c2..187ed201c4 100644
--- a/usr/src/uts/i86pc/io/acpica/resources/rsaddr.c
+++ b/usr/src/uts/i86pc/io/acpica/resources/rsaddr.c
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: rsaddr - Address resource descriptors (16/32/64)
- * $Revision: 40 $
+ * $Revision: 1.47 $
*
******************************************************************************/
@@ -123,1147 +123,743 @@
ACPI_MODULE_NAME ("rsaddr")
-/*******************************************************************************
- *
- * FUNCTION: AcpiRsAddress16Resource
- *
- * PARAMETERS: ByteStreamBuffer - Pointer to the resource input byte
- * stream
- * BytesConsumed - Pointer to where the number of bytes
- * consumed the ByteStreamBuffer is
- * returned
- * OutputBuffer - Pointer to the return data buffer
- * StructureSize - Pointer to where the number of bytes
- * in the return data struct is returned
- *
- * RETURN: Status
- *
- * DESCRIPTION: Take the resource byte stream and fill out the appropriate
- * structure pointed to by the OutputBuffer. Return the
- * number of bytes consumed from the byte stream.
- *
- ******************************************************************************/
-
-ACPI_STATUS
-AcpiRsAddress16Resource (
- UINT8 *ByteStreamBuffer,
- ACPI_SIZE *BytesConsumed,
- UINT8 **OutputBuffer,
- ACPI_SIZE *StructureSize)
-{
- UINT32 Index;
- UINT16 Temp16;
- UINT8 Temp8;
- UINT8 *TempPtr;
- UINT8 *Buffer = ByteStreamBuffer;
- ACPI_RESOURCE *OutputStruct = (void *) *OutputBuffer;
- ACPI_SIZE StructSize = ACPI_SIZEOF_RESOURCE (
- ACPI_RESOURCE_ADDRESS16);
-
-
- ACPI_FUNCTION_TRACE ("RsAddress16Resource");
+/* Local prototypes */
+static void
+AcpiRsDecodeGeneralFlags (
+ ACPI_RESOURCE_DATA *Resource,
+ UINT8 Flags);
- /* Point past the Descriptor to get the number of bytes consumed */
+static UINT8
+AcpiRsEncodeGeneralFlags (
+ ACPI_RESOURCE_DATA *Resource);
- Buffer += 1;
- ACPI_MOVE_16_TO_16 (&Temp16, Buffer);
+static void
+AcpiRsDecodeSpecificFlags (
+ ACPI_RESOURCE_DATA *Resource,
+ UINT8 Flags);
- /* Validate minimum descriptor length */
+static UINT8
+AcpiRsEncodeSpecificFlags (
+ ACPI_RESOURCE_DATA *Resource);
- if (Temp16 < 13)
- {
- return_ACPI_STATUS (AE_AML_BAD_RESOURCE_LENGTH);
- }
+static void
+AcpiRsSetAddressCommon (
+ AML_RESOURCE *Aml,
+ ACPI_RESOURCE *Resource);
- *BytesConsumed = Temp16 + 3;
- OutputStruct->Id = ACPI_RSTYPE_ADDRESS16;
+static BOOLEAN
+AcpiRsGetAddressCommon (
+ ACPI_RESOURCE *Resource,
+ AML_RESOURCE *Aml);
- /* Get the Resource Type (Byte3) */
- Buffer += 2;
- Temp8 = *Buffer;
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiRsDecodeGeneralFlags
+ *
+ * PARAMETERS: Resource - Address resource data struct
+ * Flags - Raw AML flag byte
+ *
+ * RETURN: Decoded flag bits in resource struct
+ *
+ * DESCRIPTION: Decode a general flag byte to an address resource struct
+ *
+ ******************************************************************************/
- /* Values 0-2 and 0xC0-0xFF are valid */
+static void
+AcpiRsDecodeGeneralFlags (
+ ACPI_RESOURCE_DATA *Resource,
+ UINT8 Flags)
+{
+ ACPI_FUNCTION_ENTRY ();
- if ((Temp8 > 2) && (Temp8 < 0xC0))
- {
- return_ACPI_STATUS (AE_AML_INVALID_RESOURCE_TYPE);
- }
- OutputStruct->Data.Address16.ResourceType = Temp8;
+ /* Producer / Consumer - flag bit[0] */
- /* Get the General Flags (Byte4) */
+ Resource->Address.ProducerConsumer = (UINT32) (Flags & 0x01);
- Buffer += 1;
- Temp8 = *Buffer;
+ /* Decode (_DEC) - flag bit[1] */
- /* Producer / Consumer */
+ Resource->Address.Decode = (UINT32) ((Flags >> 1) & 0x01);
- OutputStruct->Data.Address16.ProducerConsumer = Temp8 & 0x01;
+ /* Min Address Fixed (_MIF) - flag bit[2] */
- /* Decode */
+ Resource->Address.MinAddressFixed = (UINT32) ((Flags >> 2) & 0x01);
- OutputStruct->Data.Address16.Decode = (Temp8 >> 1) & 0x01;
+ /* Max Address Fixed (_MAF) - flag bit[3] */
- /* Min Address Fixed */
+ Resource->Address.MaxAddressFixed = (UINT32) ((Flags >> 3) & 0x01);
+}
- OutputStruct->Data.Address16.MinAddressFixed = (Temp8 >> 2) & 0x01;
- /* Max Address Fixed */
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiRsEncodeGeneralFlags
+ *
+ * PARAMETERS: Resource - Address resource data struct
+ *
+ * RETURN: Encoded general flag byte
+ *
+ * DESCRIPTION: Construct a general flag byte from an address resource struct
+ *
+ ******************************************************************************/
- OutputStruct->Data.Address16.MaxAddressFixed = (Temp8 >> 3) & 0x01;
+static UINT8
+AcpiRsEncodeGeneralFlags (
+ ACPI_RESOURCE_DATA *Resource)
+{
+ ACPI_FUNCTION_ENTRY ();
- /* Get the Type Specific Flags (Byte5) */
- Buffer += 1;
- Temp8 = *Buffer;
+ return ((UINT8)
- if (ACPI_MEMORY_RANGE == OutputStruct->Data.Address16.ResourceType)
- {
- OutputStruct->Data.Address16.Attribute.Memory.ReadWriteAttribute =
- (UINT16) (Temp8 & 0x01);
- OutputStruct->Data.Address16.Attribute.Memory.CacheAttribute =
- (UINT16) ((Temp8 >> 1) & 0x03);
- }
- else
- {
- if (ACPI_IO_RANGE == OutputStruct->Data.Address16.ResourceType)
- {
- OutputStruct->Data.Address16.Attribute.Io.RangeAttribute =
- (UINT16) (Temp8 & 0x03);
- OutputStruct->Data.Address16.Attribute.Io.TranslationAttribute =
- (UINT16) ((Temp8 >> 4) & 0x03);
- }
- else
- {
- /* BUS_NUMBER_RANGE == Address16.Data->ResourceType */
- /* Nothing needs to be filled in */
- }
- }
+ /* Producer / Consumer - flag bit[0] */
- /* Get Granularity (Bytes 6-7) */
+ ((Resource->Address.ProducerConsumer & 0x01) |
- Buffer += 1;
- ACPI_MOVE_16_TO_32 (&OutputStruct->Data.Address16.Granularity, Buffer);
+ /* Decode (_DEC) - flag bit[1] */
- /* Get MinAddressRange (Bytes 8-9) */
+ ((Resource->Address.Decode & 0x01) << 1) |
- Buffer += 2;
- ACPI_MOVE_16_TO_32 (&OutputStruct->Data.Address16.MinAddressRange, Buffer);
+ /* Min Address Fixed (_MIF) - flag bit[2] */
- /* Get MaxAddressRange (Bytes 10-11) */
+ ((Resource->Address.MinAddressFixed & 0x01) << 2) |
- Buffer += 2;
- ACPI_MOVE_16_TO_32 (&OutputStruct->Data.Address16.MaxAddressRange, Buffer);
+ /* Max Address Fixed (_MAF) - flag bit[3] */
- /* Get AddressTranslationOffset (Bytes 12-13) */
-
- Buffer += 2;
- ACPI_MOVE_16_TO_32 (&OutputStruct->Data.Address16.AddressTranslationOffset,
- Buffer);
+ ((Resource->Address.MaxAddressFixed & 0x01) << 3))
+ );
+}
- /* Get AddressLength (Bytes 14-15) */
- Buffer += 2;
- ACPI_MOVE_16_TO_32 (&OutputStruct->Data.Address16.AddressLength, Buffer);
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiRsDecodeSpecificFlags
+ *
+ * PARAMETERS: Resource - Address resource data struct
+ * Flags - Raw AML flag byte
+ *
+ * RETURN: Decoded flag bits in attribute struct
+ *
+ * DESCRIPTION: Decode a type-specific flag byte to an attribute struct.
+ * Type-specific flags are only defined for the Memory and IO
+ * resource types.
+ *
+ ******************************************************************************/
- /* Resource Source Index (if present) */
+static void
+AcpiRsDecodeSpecificFlags (
+ ACPI_RESOURCE_DATA *Resource,
+ UINT8 Flags)
+{
+ ACPI_FUNCTION_ENTRY ();
- Buffer += 2;
- /*
- * This will leave us pointing to the Resource Source Index
- * If it is present, then save it off and calculate the
- * pointer to where the null terminated string goes:
- * Each Interrupt takes 32-bits + the 5 bytes of the
- * stream that are default.
- *
- * Note: Some resource descriptors will have an additional null, so
- * we add 1 to the length.
- */
- if (*BytesConsumed > (16 + 1))
+ if (Resource->Address.ResourceType == ACPI_MEMORY_RANGE)
{
- /* Dereference the Index */
-
- Temp8 = *Buffer;
- OutputStruct->Data.Address16.ResourceSource.Index = (UINT32) Temp8;
-
- /* Point to the String */
-
- Buffer += 1;
-
- /* Point the String pointer to the end of this structure */
-
- OutputStruct->Data.Address16.ResourceSource.StringPtr =
- (char *)((UINT8 * )OutputStruct + StructSize);
-
- TempPtr = (UINT8 *)
- OutputStruct->Data.Address16.ResourceSource.StringPtr;
-
- /* Copy the string into the buffer */
+ /* Write Status (_RW) - flag bit[0] */
- Index = 0;
+ Resource->Address.Attribute.Memory.ReadWriteAttribute =
+ (UINT16) (Flags & 0x01);
- while (0x00 != *Buffer)
- {
- *TempPtr = *Buffer;
+ /* Memory Attributes (_MEM) - flag bits[2:1] */
- TempPtr += 1;
- Buffer += 1;
- Index += 1;
- }
-
- /* Add the terminating null */
-
- *TempPtr = 0x00;
-
- OutputStruct->Data.Address16.ResourceSource.StringLength = Index + 1;
-
- /*
- * In order for the StructSize to fall on a 32-bit boundary,
- * calculate the length of the string and expand the
- * StructSize to the next 32-bit boundary.
- */
- Temp8 = (UINT8) (Index + 1);
- StructSize += ACPI_ROUND_UP_TO_32BITS (Temp8);
+ Resource->Address.Attribute.Memory.CacheAttribute =
+ (UINT16) ((Flags >> 1) & 0x03);
}
- else
+ else if (Resource->Address.ResourceType == ACPI_IO_RANGE)
{
- OutputStruct->Data.Address16.ResourceSource.Index = 0x00;
- OutputStruct->Data.Address16.ResourceSource.StringLength = 0;
- OutputStruct->Data.Address16.ResourceSource.StringPtr = NULL;
- }
+ /* Ranges (_RNG) - flag bits[1:0] */
- /* Set the Length parameter */
+ Resource->Address.Attribute.Io.RangeAttribute =
+ (UINT16) (Flags & 0x03);
- OutputStruct->Length = (UINT32) StructSize;
+ /* Translations (_TTP and _TRS) - flag bits[5:4] */
- /* Return the final size of the structure */
-
- *StructureSize = StructSize;
- return_ACPI_STATUS (AE_OK);
+ Resource->Address.Attribute.Io.TranslationAttribute =
+ (UINT16) ((Flags >> 4) & 0x03);
+ }
}
/*******************************************************************************
*
- * FUNCTION: AcpiRsAddress16Stream
+ * FUNCTION: AcpiRsEncodeSpecificFlags
*
- * PARAMETERS: LinkedList - Pointer to the resource linked list
- * OutputBuffer - Pointer to the user's return buffer
- * BytesConsumed - Pointer to where the number of bytes
- * used in the OutputBuffer is returned
+ * PARAMETERS: Resource - Address resource data struct
*
- * RETURN: Status
+ * RETURN: Encoded type-specific flag byte
*
- * DESCRIPTION: Take the linked list resource structure and fills in the
- * the appropriate bytes in a byte stream
+ * DESCRIPTION: Construct a type-specific flag byte from an attribute struct.
+ * Type-specific flags are only defined for the Memory and IO
+ * resource types.
*
******************************************************************************/
-ACPI_STATUS
-AcpiRsAddress16Stream (
- ACPI_RESOURCE *LinkedList,
- UINT8 **OutputBuffer,
- ACPI_SIZE *BytesConsumed)
+static UINT8
+AcpiRsEncodeSpecificFlags (
+ ACPI_RESOURCE_DATA *Resource)
{
- UINT8 *Buffer = *OutputBuffer;
- UINT8 *LengthField;
- UINT8 Temp8;
- char *TempPointer = NULL;
- ACPI_SIZE ActualBytes;
-
-
- ACPI_FUNCTION_TRACE ("RsAddress16Stream");
-
-
- /* The descriptor field is static */
-
- *Buffer = 0x88;
- Buffer += 1;
-
- /* Save a pointer to the Length field - to be filled in later */
-
- LengthField = Buffer;
- Buffer += 2;
-
- /* Set the Resource Type (Memory, Io, BusNumber) */
-
- Temp8 = (UINT8) (LinkedList->Data.Address16.ResourceType & 0x03);
- *Buffer = Temp8;
- Buffer += 1;
+ ACPI_FUNCTION_ENTRY ();
- /* Set the general flags */
-
- Temp8 = (UINT8) (LinkedList->Data.Address16.ProducerConsumer & 0x01);
-
- Temp8 |= (LinkedList->Data.Address16.Decode & 0x01) << 1;
- Temp8 |= (LinkedList->Data.Address16.MinAddressFixed & 0x01) << 2;
- Temp8 |= (LinkedList->Data.Address16.MaxAddressFixed & 0x01) << 3;
-
- *Buffer = Temp8;
- Buffer += 1;
-
- /* Set the type specific flags */
- Temp8 = 0;
-
- if (ACPI_MEMORY_RANGE == LinkedList->Data.Address16.ResourceType)
+ if (Resource->Address.ResourceType == ACPI_MEMORY_RANGE)
{
- Temp8 = (UINT8)
- (LinkedList->Data.Address16.Attribute.Memory.ReadWriteAttribute &
- 0x01);
-
- Temp8 |=
- (LinkedList->Data.Address16.Attribute.Memory.CacheAttribute &
- 0x03) << 1;
- }
- else if (ACPI_IO_RANGE == LinkedList->Data.Address16.ResourceType)
- {
- Temp8 = (UINT8)
- (LinkedList->Data.Address16.Attribute.Io.RangeAttribute &
- 0x03);
- Temp8 |=
- (LinkedList->Data.Address16.Attribute.Io.TranslationAttribute &
- 0x03) << 4;
- }
+ return ((UINT8)
- *Buffer = Temp8;
- Buffer += 1;
+ /* Write Status (_RW) - flag bit[0] */
- /* Set the address space granularity */
+ ((Resource->Address.Attribute.Memory.ReadWriteAttribute & 0x01) |
- ACPI_MOVE_32_TO_16 (Buffer, &LinkedList->Data.Address16.Granularity);
- Buffer += 2;
-
- /* Set the address range minimum */
-
- ACPI_MOVE_32_TO_16 (Buffer, &LinkedList->Data.Address16.MinAddressRange);
- Buffer += 2;
-
- /* Set the address range maximum */
-
- ACPI_MOVE_32_TO_16 (Buffer, &LinkedList->Data.Address16.MaxAddressRange);
- Buffer += 2;
-
- /* Set the address translation offset */
-
- ACPI_MOVE_32_TO_16 (Buffer,
- &LinkedList->Data.Address16.AddressTranslationOffset);
- Buffer += 2;
-
- /* Set the address length */
-
- ACPI_MOVE_32_TO_16 (Buffer, &LinkedList->Data.Address16.AddressLength);
- Buffer += 2;
-
- /* Resource Source Index and Resource Source are optional */
+ /* Memory Attributes (_MEM) - flag bits[2:1] */
- if (0 != LinkedList->Data.Address16.ResourceSource.StringLength)
+ ((Resource->Address.Attribute.Memory.CacheAttribute & 0x03) << 1)));
+ }
+ else if (Resource->Address.ResourceType == ACPI_IO_RANGE)
{
- Temp8 = (UINT8) LinkedList->Data.Address16.ResourceSource.Index;
-
- *Buffer = Temp8;
- Buffer += 1;
+ return ((UINT8)
- TempPointer = (char *) Buffer;
+ /* Ranges (_RNG) - flag bits[1:0] */
- /* Copy the string */
+ ((Resource->Address.Attribute.Io.RangeAttribute & 0x03) |
- ACPI_STRCPY (TempPointer,
- LinkedList->Data.Address16.ResourceSource.StringPtr);
+ /* Translations (_TTP and _TRS) - flag bits[5:4] */
- /*
- * Buffer needs to be set to the length of the sting + one for the
- * terminating null
- */
- Buffer += (ACPI_SIZE)(ACPI_STRLEN (
- LinkedList->Data.Address16.ResourceSource.StringPtr) + 1);
+ ((Resource->Address.Attribute.Io.TranslationAttribute & 0x03) << 4)));
}
- /* Return the number of bytes consumed in this operation */
-
- ActualBytes = ACPI_PTR_DIFF (Buffer, *OutputBuffer);
- *BytesConsumed = ActualBytes;
-
- /*
- * Set the length field to the number of bytes consumed
- * minus the header size (3 bytes)
- */
- ActualBytes -= 3;
- ACPI_MOVE_SIZE_TO_16 (LengthField, &ActualBytes);
- return_ACPI_STATUS (AE_OK);
+ return (0);
}
/*******************************************************************************
*
- * FUNCTION: AcpiRsAddress32Resource
+ * FUNCTION: AcpiRsSetAddressCommon
*
- * PARAMETERS: ByteStreamBuffer - Pointer to the resource input byte
- * stream
- * BytesConsumed - Pointer to where the number of bytes
- * consumed the ByteStreamBuffer is
- * returned
- * OutputBuffer - Pointer to the return data buffer
- * StructureSize - Pointer to where the number of bytes
- * in the return data struct is returned
+ * PARAMETERS: Aml - Pointer to the AML resource descriptor
+ * Resource - Pointer to the internal resource struct
*
- * RETURN: Status
+ * RETURN: None
*
- * DESCRIPTION: Take the resource byte stream and fill out the appropriate
- * structure pointed to by the OutputBuffer. Return the
- * number of bytes consumed from the byte stream.
+ * DESCRIPTION: Convert common flag fields from a resource descriptor to an
+ * AML descriptor
*
******************************************************************************/
-ACPI_STATUS
-AcpiRsAddress32Resource (
- UINT8 *ByteStreamBuffer,
- ACPI_SIZE *BytesConsumed,
- UINT8 **OutputBuffer,
- ACPI_SIZE *StructureSize)
+static void
+AcpiRsSetAddressCommon (
+ AML_RESOURCE *Aml,
+ ACPI_RESOURCE *Resource)
{
- UINT8 *Buffer;
- ACPI_RESOURCE *OutputStruct= (void *) *OutputBuffer;
- UINT16 Temp16;
- UINT8 Temp8;
- UINT8 *TempPtr;
- ACPI_SIZE StructSize;
- UINT32 Index;
+ ACPI_FUNCTION_ENTRY ();
- ACPI_FUNCTION_TRACE ("RsAddress32Resource");
+ /* Set the Resource Type (Memory, Io, BusNumber, etc.) */
+ Aml->Address.ResourceType = (UINT8) Resource->Data.Address.ResourceType;
- Buffer = ByteStreamBuffer;
- StructSize = ACPI_SIZEOF_RESOURCE (ACPI_RESOURCE_ADDRESS32);
+ /* Set the general flags */
- /* Point past the Descriptor to get the number of bytes consumed */
+ Aml->Address.Flags = AcpiRsEncodeGeneralFlags (&Resource->Data);
- Buffer += 1;
- ACPI_MOVE_16_TO_16 (&Temp16, Buffer);
+ /* Set the type-specific flags */
- /* Validate minimum descriptor length */
+ Aml->Address.SpecificFlags = AcpiRsEncodeSpecificFlags (&Resource->Data);
+}
- if (Temp16 < 23)
- {
- return_ACPI_STATUS (AE_AML_BAD_RESOURCE_LENGTH);
- }
- *BytesConsumed = Temp16 + 3;
- OutputStruct->Id = ACPI_RSTYPE_ADDRESS32;
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiRsGetAddressCommon
+ *
+ * PARAMETERS: Resource - Pointer to the internal resource struct
+ * Aml - Pointer to the AML resource descriptor
+ *
+ * RETURN: TRUE if the ResourceType field is OK, FALSE otherwise
+ *
+ * DESCRIPTION: Convert common flag fields from a raw AML resource descriptor
+ * to an internal resource descriptor
+ *
+ ******************************************************************************/
- /* Get the Resource Type (Byte3) */
+static BOOLEAN
+AcpiRsGetAddressCommon (
+ ACPI_RESOURCE *Resource,
+ AML_RESOURCE *Aml)
+{
+ ACPI_FUNCTION_ENTRY ();
- Buffer += 2;
- Temp8 = *Buffer;
- /* Values 0-2 and 0xC0-0xFF are valid */
+ /* Validate resource type */
- if ((Temp8 > 2) && (Temp8 < 0xC0))
+ if ((Aml->Address.ResourceType > 2) && (Aml->Address.ResourceType < 0xC0))
{
- return_ACPI_STATUS (AE_AML_INVALID_RESOURCE_TYPE);
+ return (FALSE);
}
- OutputStruct->Data.Address32.ResourceType = Temp8;
-
- /* Get the General Flags (Byte4) */
-
- Buffer += 1;
- Temp8 = *Buffer;
+ /* Get the Resource Type (Memory, Io, BusNumber, etc.) */
- /* Producer / Consumer */
+ Resource->Data.Address.ResourceType = Aml->Address.ResourceType;
- OutputStruct->Data.Address32.ProducerConsumer = Temp8 & 0x01;
+ /* Get the General Flags */
- /* Decode */
+ AcpiRsDecodeGeneralFlags (&Resource->Data, Aml->Address.Flags);
- OutputStruct->Data.Address32.Decode = (Temp8 >> 1) & 0x01;
+ /* Get the Type-Specific Flags */
- /* Min Address Fixed */
-
- OutputStruct->Data.Address32.MinAddressFixed = (Temp8 >> 2) & 0x01;
+ AcpiRsDecodeSpecificFlags (&Resource->Data, Aml->Address.SpecificFlags);
+ return (TRUE);
+}
- /* Max Address Fixed */
- OutputStruct->Data.Address32.MaxAddressFixed = (Temp8 >> 3) & 0x01;
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiRsGetAddress16
+ *
+ * PARAMETERS: Aml - Pointer to the AML resource descriptor
+ * AmlResourceLength - Length of the resource from the AML header
+ * Resource - Where the internal resource is returned
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Convert a raw AML resource descriptor to the corresponding
+ * internal resource descriptor, simplifying bitflags and handling
+ * alignment and endian issues if necessary.
+ *
+ ******************************************************************************/
- /* Get the Type Specific Flags (Byte5) */
+ACPI_STATUS
+AcpiRsGetAddress16 (
+ AML_RESOURCE *Aml,
+ UINT16 AmlResourceLength,
+ ACPI_RESOURCE *Resource)
+{
+ ACPI_FUNCTION_TRACE ("RsGetAddress16");
- Buffer += 1;
- Temp8 = *Buffer;
- if (ACPI_MEMORY_RANGE == OutputStruct->Data.Address32.ResourceType)
- {
- OutputStruct->Data.Address32.Attribute.Memory.ReadWriteAttribute =
- (UINT16) (Temp8 & 0x01);
+ /* Get the Resource Type, general flags, and type-specific flags */
- OutputStruct->Data.Address32.Attribute.Memory.CacheAttribute =
- (UINT16) ((Temp8 >> 1) & 0x03);
- }
- else
+ if (!AcpiRsGetAddressCommon (Resource, Aml))
{
- if (ACPI_IO_RANGE == OutputStruct->Data.Address32.ResourceType)
- {
- OutputStruct->Data.Address32.Attribute.Io.RangeAttribute =
- (UINT16) (Temp8 & 0x03);
- OutputStruct->Data.Address32.Attribute.Io.TranslationAttribute =
- (UINT16) ((Temp8 >> 4) & 0x03);
- }
- else
- {
- /* BUS_NUMBER_RANGE == OutputStruct->Data.Address32.ResourceType */
- /* Nothing needs to be filled in */
- }
+ return_ACPI_STATUS (AE_AML_INVALID_RESOURCE_TYPE);
}
- /* Get Granularity (Bytes 6-9) */
-
- Buffer += 1;
- ACPI_MOVE_32_TO_32 (&OutputStruct->Data.Address32.Granularity, Buffer);
-
- /* Get MinAddressRange (Bytes 10-13) */
-
- Buffer += 4;
- ACPI_MOVE_32_TO_32 (&OutputStruct->Data.Address32.MinAddressRange, Buffer);
-
- /* Get MaxAddressRange (Bytes 14-17) */
-
- Buffer += 4;
- ACPI_MOVE_32_TO_32 (&OutputStruct->Data.Address32.MaxAddressRange, Buffer);
-
- /* Get AddressTranslationOffset (Bytes 18-21) */
-
- Buffer += 4;
- ACPI_MOVE_32_TO_32 (&OutputStruct->Data.Address32.AddressTranslationOffset,
- Buffer);
-
- /* Get AddressLength (Bytes 22-25) */
-
- Buffer += 4;
- ACPI_MOVE_32_TO_32 (&OutputStruct->Data.Address32.AddressLength, Buffer);
-
- /* Resource Source Index (if present) */
-
- Buffer += 4;
-
/*
- * This will leave us pointing to the Resource Source Index
- * If it is present, then save it off and calculate the
- * pointer to where the null terminated string goes:
- *
- * Note: Some resource descriptors will have an additional null, so
- * we add 1 to the length.
+ * Get the following contiguous fields from the AML descriptor:
+ * Address Granularity
+ * Address Range Minimum
+ * Address Range Maximum
+ * Address Translation Offset
+ * Address Length
*/
- if (*BytesConsumed > (26 + 1))
- {
- /* Dereference the Index */
-
- Temp8 = *Buffer;
- OutputStruct->Data.Address32.ResourceSource.Index =
- (UINT32) Temp8;
-
- /* Point to the String */
-
- Buffer += 1;
-
- /* Point the String pointer to the end of this structure */
-
- OutputStruct->Data.Address32.ResourceSource.StringPtr =
- (char *)((UINT8 *)OutputStruct + StructSize);
+ AcpiRsMoveData (&Resource->Data.Address16.Granularity,
+ &Aml->Address16.Granularity, 5, ACPI_MOVE_TYPE_16_TO_32);
- TempPtr = (UINT8 *)
- OutputStruct->Data.Address32.ResourceSource.StringPtr;
+ /* Get the optional ResourceSource (index and string) */
- /* Copy the string into the buffer */
+ Resource->Length =
+ ACPI_SIZEOF_RESOURCE (ACPI_RESOURCE_ADDRESS16) +
- Index = 0;
- while (0x00 != *Buffer)
- {
- *TempPtr = *Buffer;
+ AcpiRsGetResourceSource (AmlResourceLength,
+ sizeof (AML_RESOURCE_ADDRESS16),
+ &Resource->Data.Address16.ResourceSource, Aml, NULL);
- TempPtr += 1;
- Buffer += 1;
- Index += 1;
- }
+ /* Complete the resource header */
- /* Add the terminating null */
-
- *TempPtr = 0x00;
- OutputStruct->Data.Address32.ResourceSource.StringLength = Index + 1;
-
- /*
- * In order for the StructSize to fall on a 32-bit boundary,
- * calculate the length of the string and expand the
- * StructSize to the next 32-bit boundary.
- */
- Temp8 = (UINT8) (Index + 1);
- StructSize += ACPI_ROUND_UP_TO_32BITS (Temp8);
- }
- else
- {
- OutputStruct->Data.Address32.ResourceSource.Index = 0x00;
- OutputStruct->Data.Address32.ResourceSource.StringLength = 0;
- OutputStruct->Data.Address32.ResourceSource.StringPtr = NULL;
- }
-
- /* Set the Length parameter */
-
- OutputStruct->Length = (UINT32) StructSize;
-
- /* Return the final size of the structure */
-
- *StructureSize = StructSize;
+ Resource->Type = ACPI_RESOURCE_TYPE_ADDRESS16;
return_ACPI_STATUS (AE_OK);
}
/*******************************************************************************
*
- * FUNCTION: AcpiRsAddress32Stream
+ * FUNCTION: AcpiRsSetAddress16
*
- * PARAMETERS: LinkedList - Pointer to the resource linked list
- * OutputBuffer - Pointer to the user's return buffer
- * BytesConsumed - Pointer to where the number of bytes
- * used in the OutputBuffer is returned
+ * PARAMETERS: Resource - Pointer to the resource descriptor
+ * Aml - Where the AML descriptor is returned
*
* RETURN: Status
*
- * DESCRIPTION: Take the linked list resource structure and fills in the
- * the appropriate bytes in a byte stream
+ * DESCRIPTION: Convert an internal resource descriptor to the corresponding
+ * external AML resource descriptor.
*
******************************************************************************/
ACPI_STATUS
-AcpiRsAddress32Stream (
- ACPI_RESOURCE *LinkedList,
- UINT8 **OutputBuffer,
- ACPI_SIZE *BytesConsumed)
+AcpiRsSetAddress16 (
+ ACPI_RESOURCE *Resource,
+ AML_RESOURCE *Aml)
{
- UINT8 *Buffer;
- UINT16 *LengthField;
- UINT8 Temp8;
- char *TempPointer;
-
+ ACPI_SIZE DescriptorLength;
- ACPI_FUNCTION_TRACE ("RsAddress32Stream");
+ ACPI_FUNCTION_TRACE ("RsSetAddress16");
- Buffer = *OutputBuffer;
- /* The descriptor field is static */
+ /* Set the Resource Type, General Flags, and Type-Specific Flags */
- *Buffer = 0x87;
- Buffer += 1;
+ AcpiRsSetAddressCommon (Aml, Resource);
- /* Set a pointer to the Length field - to be filled in later */
+ /*
+ * Set the following contiguous fields in the AML descriptor:
+ * Address Granularity
+ * Address Range Minimum
+ * Address Range Maximum
+ * Address Translation Offset
+ * Address Length
+ */
+ AcpiRsMoveData (&Aml->Address16.Granularity,
+ &Resource->Data.Address16.Granularity, 5, ACPI_MOVE_TYPE_32_TO_16);
- LengthField = ACPI_CAST_PTR (UINT16, Buffer);
- Buffer += 2;
+ /* Resource Source Index and Resource Source are optional */
- /* Set the Resource Type (Memory, Io, BusNumber) */
+ DescriptorLength = AcpiRsSetResourceSource (Aml,
+ sizeof (AML_RESOURCE_ADDRESS16),
+ &Resource->Data.Address16.ResourceSource);
- Temp8 = (UINT8) (LinkedList->Data.Address32.ResourceType & 0x03);
+ /* Complete the AML descriptor header */
- *Buffer = Temp8;
- Buffer += 1;
+ AcpiRsSetResourceHeader (ACPI_RESOURCE_NAME_ADDRESS16, DescriptorLength, Aml);
+ return_ACPI_STATUS (AE_OK);
+}
- /* Set the general flags */
- Temp8 = (UINT8) (LinkedList->Data.Address32.ProducerConsumer & 0x01);
- Temp8 |= (LinkedList->Data.Address32.Decode & 0x01) << 1;
- Temp8 |= (LinkedList->Data.Address32.MinAddressFixed & 0x01) << 2;
- Temp8 |= (LinkedList->Data.Address32.MaxAddressFixed & 0x01) << 3;
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiRsGetAddress32
+ *
+ * PARAMETERS: Aml - Pointer to the AML resource descriptor
+ * AmlResourceLength - Length of the resource from the AML header
+ * Resource - Where the internal resource is returned
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Convert a raw AML resource descriptor to the corresponding
+ * internal resource descriptor, simplifying bitflags and handling
+ * alignment and endian issues if necessary.
+ *
+ ******************************************************************************/
- *Buffer = Temp8;
- Buffer += 1;
+ACPI_STATUS
+AcpiRsGetAddress32 (
+ AML_RESOURCE *Aml,
+ UINT16 AmlResourceLength,
+ ACPI_RESOURCE *Resource)
+{
- /* Set the type specific flags */
+ ACPI_FUNCTION_TRACE ("RsGetAddress32");
- Temp8 = 0;
- if (ACPI_MEMORY_RANGE == LinkedList->Data.Address32.ResourceType)
- {
- Temp8 = (UINT8)
- (LinkedList->Data.Address32.Attribute.Memory.ReadWriteAttribute &
- 0x01);
+ /* Get the Resource Type, general flags, and type-specific flags */
- Temp8 |=
- (LinkedList->Data.Address32.Attribute.Memory.CacheAttribute &
- 0x03) << 1;
- }
- else if (ACPI_IO_RANGE == LinkedList->Data.Address32.ResourceType)
+ if (!AcpiRsGetAddressCommon (Resource, (void *) Aml))
{
- Temp8 = (UINT8)
- (LinkedList->Data.Address32.Attribute.Io.RangeAttribute &
- 0x03);
- Temp8 |=
- (LinkedList->Data.Address32.Attribute.Io.TranslationAttribute &
- 0x03) << 4;
+ return_ACPI_STATUS (AE_AML_INVALID_RESOURCE_TYPE);
}
- *Buffer = Temp8;
- Buffer += 1;
-
- /* Set the address space granularity */
-
- ACPI_MOVE_32_TO_32 (Buffer, &LinkedList->Data.Address32.Granularity);
- Buffer += 4;
+ /*
+ * Get the following contiguous fields from the AML descriptor:
+ * Address Granularity
+ * Address Range Minimum
+ * Address Range Maximum
+ * Address Translation Offset
+ * Address Length
+ */
+ AcpiRsMoveData (&Resource->Data.Address32.Granularity,
+ &Aml->Address32.Granularity, 5, ACPI_MOVE_TYPE_32_TO_32);
- /* Set the address range minimum */
+ /* Get the optional ResourceSource (index and string) */
- ACPI_MOVE_32_TO_32 (Buffer, &LinkedList->Data.Address32.MinAddressRange);
- Buffer += 4;
+ Resource->Length =
+ ACPI_SIZEOF_RESOURCE (ACPI_RESOURCE_ADDRESS32) +
- /* Set the address range maximum */
+ AcpiRsGetResourceSource (AmlResourceLength,
+ sizeof (AML_RESOURCE_ADDRESS32),
+ &Resource->Data.Address32.ResourceSource, Aml, NULL);
- ACPI_MOVE_32_TO_32 (Buffer, &LinkedList->Data.Address32.MaxAddressRange);
- Buffer += 4;
+ /* Complete the resource header */
- /* Set the address translation offset */
+ Resource->Type = ACPI_RESOURCE_TYPE_ADDRESS32;
+ return_ACPI_STATUS (AE_OK);
+}
- ACPI_MOVE_32_TO_32 (Buffer,
- &LinkedList->Data.Address32.AddressTranslationOffset);
- Buffer += 4;
- /* Set the address length */
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiRsSetAddress32
+ *
+ * PARAMETERS: Resource - Pointer to the resource descriptor
+ * Aml - Where the AML descriptor is returned
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Convert an internal resource descriptor to the corresponding
+ * external AML resource descriptor.
+ *
+ ******************************************************************************/
- ACPI_MOVE_32_TO_32 (Buffer, &LinkedList->Data.Address32.AddressLength);
- Buffer += 4;
+ACPI_STATUS
+AcpiRsSetAddress32 (
+ ACPI_RESOURCE *Resource,
+ AML_RESOURCE *Aml)
+{
+ ACPI_SIZE DescriptorLength;
- /* Resource Source Index and Resource Source are optional */
- if (0 != LinkedList->Data.Address32.ResourceSource.StringLength)
- {
- Temp8 = (UINT8) LinkedList->Data.Address32.ResourceSource.Index;
+ ACPI_FUNCTION_TRACE ("RsSetAddress32");
- *Buffer = Temp8;
- Buffer += 1;
- TempPointer = (char *) Buffer;
+ /* Set the Resource Type, General Flags, and Type-Specific Flags */
- /* Copy the string */
+ AcpiRsSetAddressCommon (Aml, Resource);
- ACPI_STRCPY (TempPointer,
- LinkedList->Data.Address32.ResourceSource.StringPtr);
+ /*
+ * Set the following contiguous fields in the AML descriptor:
+ * Address Granularity
+ * Address Range Minimum
+ * Address Range Maximum
+ * Address Translation Offset
+ * Address Length
+ */
+ AcpiRsMoveData (&Aml->Address32.Granularity,
+ &Resource->Data.Address32.Granularity, 5, ACPI_MOVE_TYPE_32_TO_32);
- /*
- * Buffer needs to be set to the length of the sting + one for the
- * terminating null
- */
- Buffer += (ACPI_SIZE)(ACPI_STRLEN (
- LinkedList->Data.Address32.ResourceSource.StringPtr) + 1);
- }
+ /* Resource Source Index and Resource Source are optional */
- /* Return the number of bytes consumed in this operation */
+ DescriptorLength = AcpiRsSetResourceSource (Aml,
+ sizeof (AML_RESOURCE_ADDRESS32),
+ &Resource->Data.Address32.ResourceSource);
- *BytesConsumed = ACPI_PTR_DIFF (Buffer, *OutputBuffer);
+ /* Complete the AML descriptor header */
- /*
- * Set the length field to the number of bytes consumed
- * minus the header size (3 bytes)
- */
- *LengthField = (UINT16) (*BytesConsumed - 3);
+ AcpiRsSetResourceHeader (ACPI_RESOURCE_NAME_ADDRESS32, DescriptorLength, Aml);
return_ACPI_STATUS (AE_OK);
}
/*******************************************************************************
*
- * FUNCTION: AcpiRsAddress64Resource
+ * FUNCTION: AcpiRsGetAddress64
*
- * PARAMETERS: ByteStreamBuffer - Pointer to the resource input byte
- * stream
- * BytesConsumed - Pointer to where the number of bytes
- * consumed the ByteStreamBuffer is
- * returned
- * OutputBuffer - Pointer to the return data buffer
- * StructureSize - Pointer to where the number of bytes
- * in the return data struct is returned
+ * PARAMETERS: Aml - Pointer to the AML resource descriptor
+ * AmlResourceLength - Length of the resource from the AML header
+ * Resource - Where the internal resource is returned
*
* RETURN: Status
*
- * DESCRIPTION: Take the resource byte stream and fill out the appropriate
- * structure pointed to by the OutputBuffer. Return the
- * number of bytes consumed from the byte stream.
+ * DESCRIPTION: Convert a raw AML resource descriptor to the corresponding
+ * internal resource descriptor, simplifying bitflags and handling
+ * alignment and endian issues if necessary.
*
******************************************************************************/
ACPI_STATUS
-AcpiRsAddress64Resource (
- UINT8 *ByteStreamBuffer,
- ACPI_SIZE *BytesConsumed,
- UINT8 **OutputBuffer,
- ACPI_SIZE *StructureSize)
+AcpiRsGetAddress64 (
+ AML_RESOURCE *Aml,
+ UINT16 AmlResourceLength,
+ ACPI_RESOURCE *Resource)
{
- UINT8 *Buffer;
- ACPI_RESOURCE *OutputStruct = (void *) *OutputBuffer;
- UINT16 Temp16;
- UINT8 Temp8;
- UINT8 ResourceType;
- UINT8 *TempPtr;
- ACPI_SIZE StructSize;
- UINT32 Index;
-
-
- ACPI_FUNCTION_TRACE ("RsAddress64Resource");
-
-
- Buffer = ByteStreamBuffer;
- StructSize = ACPI_SIZEOF_RESOURCE (ACPI_RESOURCE_ADDRESS64);
- ResourceType = *Buffer;
-
- /* Point past the Descriptor to get the number of bytes consumed */
+ ACPI_FUNCTION_TRACE ("RsGetAddress64");
- Buffer += 1;
- ACPI_MOVE_16_TO_16 (&Temp16, Buffer);
- /* Validate minimum descriptor length */
+ /* Get the Resource Type, general Flags, and type-specific Flags */
- if (Temp16 < 43)
- {
- return_ACPI_STATUS (AE_AML_BAD_RESOURCE_LENGTH);
- }
-
- *BytesConsumed = Temp16 + 3;
- OutputStruct->Id = ACPI_RSTYPE_ADDRESS64;
-
- /* Get the Resource Type (Byte3) */
-
- Buffer += 2;
- Temp8 = *Buffer;
-
- /* Values 0-2 and 0xC0-0xFF are valid */
-
- if ((Temp8 > 2) && (Temp8 < 0xC0))
+ if (!AcpiRsGetAddressCommon (Resource, Aml))
{
return_ACPI_STATUS (AE_AML_INVALID_RESOURCE_TYPE);
}
- OutputStruct->Data.Address64.ResourceType = Temp8;
-
- /* Get the General Flags (Byte4) */
-
- Buffer += 1;
- Temp8 = *Buffer;
-
- /* Producer / Consumer */
-
- OutputStruct->Data.Address64.ProducerConsumer = Temp8 & 0x01;
-
- /* Decode */
-
- OutputStruct->Data.Address64.Decode = (Temp8 >> 1) & 0x01;
-
- /* Min Address Fixed */
-
- OutputStruct->Data.Address64.MinAddressFixed = (Temp8 >> 2) & 0x01;
-
- /* Max Address Fixed */
-
- OutputStruct->Data.Address64.MaxAddressFixed = (Temp8 >> 3) & 0x01;
-
- /* Get the Type Specific Flags (Byte5) */
-
- Buffer += 1;
- Temp8 = *Buffer;
-
- if (ACPI_MEMORY_RANGE == OutputStruct->Data.Address64.ResourceType)
- {
- OutputStruct->Data.Address64.Attribute.Memory.ReadWriteAttribute =
- (UINT16) (Temp8 & 0x01);
-
- OutputStruct->Data.Address64.Attribute.Memory.CacheAttribute =
- (UINT16) ((Temp8 >> 1) & 0x03);
- }
- else
- {
- if (ACPI_IO_RANGE == OutputStruct->Data.Address64.ResourceType)
- {
- OutputStruct->Data.Address64.Attribute.Io.RangeAttribute =
- (UINT16) (Temp8 & 0x03);
- OutputStruct->Data.Address64.Attribute.Io.TranslationAttribute =
- (UINT16) ((Temp8 >> 4) & 0x03);
- }
- else
- {
- /* BUS_NUMBER_RANGE == OutputStruct->Data.Address64.ResourceType */
- /* Nothing needs to be filled in */
- }
- }
-
- if (ResourceType == ACPI_RDESC_TYPE_EXTENDED_ADDRESS_SPACE)
- {
- /* Move past RevisionId and Reserved byte */
-
- Buffer += 2;
- }
-
- /* Get Granularity (Bytes 6-13) or (Bytes 8-15) */
-
- Buffer += 1;
- ACPI_MOVE_64_TO_64 (&OutputStruct->Data.Address64.Granularity, Buffer);
-
- /* Get MinAddressRange (Bytes 14-21) or (Bytes 16-23) */
-
- Buffer += 8;
- ACPI_MOVE_64_TO_64 (&OutputStruct->Data.Address64.MinAddressRange, Buffer);
-
- /* Get MaxAddressRange (Bytes 22-29) or (Bytes 24-31) */
-
- Buffer += 8;
- ACPI_MOVE_64_TO_64 (&OutputStruct->Data.Address64.MaxAddressRange, Buffer);
-
- /* Get AddressTranslationOffset (Bytes 30-37) or (Bytes 32-39) */
-
- Buffer += 8;
- ACPI_MOVE_64_TO_64 (&OutputStruct->Data.Address64.AddressTranslationOffset,
- Buffer);
-
- /* Get AddressLength (Bytes 38-45) or (Bytes 40-47) */
-
- Buffer += 8;
- ACPI_MOVE_64_TO_64 (&OutputStruct->Data.Address64.AddressLength, Buffer);
-
- OutputStruct->Data.Address64.ResourceSource.Index = 0x00;
- OutputStruct->Data.Address64.ResourceSource.StringLength = 0;
- OutputStruct->Data.Address64.ResourceSource.StringPtr = NULL;
-
- if (ResourceType == ACPI_RDESC_TYPE_EXTENDED_ADDRESS_SPACE)
- {
- /* Get TypeSpecificAttribute (Bytes 48-55) */
+ /*
+ * Get the following contiguous fields from the AML descriptor:
+ * Address Granularity
+ * Address Range Minimum
+ * Address Range Maximum
+ * Address Translation Offset
+ * Address Length
+ */
+ AcpiRsMoveData (&Resource->Data.Address64.Granularity,
+ &Aml->Address64.Granularity, 5, ACPI_MOVE_TYPE_64_TO_64);
- Buffer += 8;
- ACPI_MOVE_64_TO_64 (
- &OutputStruct->Data.Address64.TypeSpecificAttributes,
- Buffer);
- }
- else
- {
- OutputStruct->Data.Address64.TypeSpecificAttributes = 0;
-
- /* Resource Source Index (if present) */
-
- Buffer += 8;
-
- /*
- * This will leave us pointing to the Resource Source Index
- * If it is present, then save it off and calculate the
- * pointer to where the null terminated string goes:
- * Each Interrupt takes 32-bits + the 5 bytes of the
- * stream that are default.
- *
- * Note: Some resource descriptors will have an additional null, so
- * we add 1 to the length.
- */
- if (*BytesConsumed > (46 + 1))
- {
- /* Dereference the Index */
-
- Temp8 = *Buffer;
- OutputStruct->Data.Address64.ResourceSource.Index =
- (UINT32) Temp8;
-
- /* Point to the String */
-
- Buffer += 1;
-
- /* Point the String pointer to the end of this structure */
-
- OutputStruct->Data.Address64.ResourceSource.StringPtr =
- (char *)((UINT8 *)OutputStruct + StructSize);
-
- TempPtr = (UINT8 *)
- OutputStruct->Data.Address64.ResourceSource.StringPtr;
-
- /* Copy the string into the buffer */
-
- Index = 0;
- while (0x00 != *Buffer)
- {
- *TempPtr = *Buffer;
-
- TempPtr += 1;
- Buffer += 1;
- Index += 1;
- }
-
- /*
- * Add the terminating null
- */
- *TempPtr = 0x00;
- OutputStruct->Data.Address64.ResourceSource.StringLength =
- Index + 1;
-
- /*
- * In order for the StructSize to fall on a 32-bit boundary,
- * calculate the length of the string and expand the
- * StructSize to the next 32-bit boundary.
- */
- Temp8 = (UINT8) (Index + 1);
- StructSize += ACPI_ROUND_UP_TO_32BITS (Temp8);
- }
- }
+ /* Get the optional ResourceSource (index and string) */
- /* Set the Length parameter */
+ Resource->Length =
+ ACPI_SIZEOF_RESOURCE (ACPI_RESOURCE_ADDRESS64) +
- OutputStruct->Length = (UINT32) StructSize;
+ AcpiRsGetResourceSource (AmlResourceLength,
+ sizeof (AML_RESOURCE_ADDRESS64),
+ &Resource->Data.Address64.ResourceSource, Aml, NULL);
- /* Return the final size of the structure */
+ /* Complete the resource header */
- *StructureSize = StructSize;
+ Resource->Type = ACPI_RESOURCE_TYPE_ADDRESS64;
return_ACPI_STATUS (AE_OK);
}
/*******************************************************************************
*
- * FUNCTION: AcpiRsAddress64Stream
+ * FUNCTION: AcpiRsSetAddress64
*
- * PARAMETERS: LinkedList - Pointer to the resource linked list
- * OutputBuffer - Pointer to the user's return buffer
- * BytesConsumed - Pointer to where the number of bytes
- * used in the OutputBuffer is returned
+ * PARAMETERS: Resource - Pointer to the resource descriptor
+ * Aml - Where the AML descriptor is returned
*
* RETURN: Status
*
- * DESCRIPTION: Take the linked list resource structure and fills in the
- * the appropriate bytes in a byte stream
+ * DESCRIPTION: Convert an internal resource descriptor to the corresponding
+ * external AML resource descriptor.
*
******************************************************************************/
ACPI_STATUS
-AcpiRsAddress64Stream (
- ACPI_RESOURCE *LinkedList,
- UINT8 **OutputBuffer,
- ACPI_SIZE *BytesConsumed)
+AcpiRsSetAddress64 (
+ ACPI_RESOURCE *Resource,
+ AML_RESOURCE *Aml)
{
- UINT8 *Buffer;
- UINT16 *LengthField;
- UINT8 Temp8;
- char *TempPointer;
+ ACPI_SIZE DescriptorLength;
- ACPI_FUNCTION_TRACE ("RsAddress64Stream");
+ ACPI_FUNCTION_TRACE ("RsSetAddress64");
- Buffer = *OutputBuffer;
+ /* Set the Resource Type, General Flags, and Type-Specific Flags */
- /* The descriptor field is static */
+ AcpiRsSetAddressCommon (Aml, Resource);
- *Buffer = 0x8A;
- Buffer += 1;
+ /*
+ * Set the following contiguous fields in the AML descriptor:
+ * Address Granularity
+ * Address Range Minimum
+ * Address Range Maximum
+ * Address Translation Offset
+ * Address Length
+ */
+ AcpiRsMoveData (&Aml->Address64.Granularity,
+ &Resource->Data.Address64.Granularity, 5, ACPI_MOVE_TYPE_64_TO_64);
- /* Set a pointer to the Length field - to be filled in later */
+ /* Resource Source Index and Resource Source are optional */
- LengthField = ACPI_CAST_PTR (UINT16, Buffer);
- Buffer += 2;
+ DescriptorLength = AcpiRsSetResourceSource (Aml,
+ sizeof (AML_RESOURCE_ADDRESS64),
+ &Resource->Data.Address64.ResourceSource);
- /* Set the Resource Type (Memory, Io, BusNumber) */
+ /* Complete the AML descriptor header */
- Temp8 = (UINT8) (LinkedList->Data.Address64.ResourceType & 0x03);
+ AcpiRsSetResourceHeader (ACPI_RESOURCE_NAME_ADDRESS64, DescriptorLength, Aml);
+ return_ACPI_STATUS (AE_OK);
+}
- *Buffer = Temp8;
- Buffer += 1;
- /* Set the general flags */
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiRsGetExtAddress64
+ *
+ * PARAMETERS: Aml - Pointer to the AML resource descriptor
+ * AmlResourceLength - Length of the resource from the AML header
+ * Resource - Where the internal resource is returned
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Convert a raw AML resource descriptor to the corresponding
+ * internal resource descriptor, simplifying bitflags and handling
+ * alignment and endian issues if necessary.
+ *
+ ******************************************************************************/
- Temp8 = (UINT8) (LinkedList->Data.Address64.ProducerConsumer & 0x01);
- Temp8 |= (LinkedList->Data.Address64.Decode & 0x01) << 1;
- Temp8 |= (LinkedList->Data.Address64.MinAddressFixed & 0x01) << 2;
- Temp8 |= (LinkedList->Data.Address64.MaxAddressFixed & 0x01) << 3;
+ACPI_STATUS
+AcpiRsGetExtAddress64 (
+ AML_RESOURCE *Aml,
+ UINT16 AmlResourceLength,
+ ACPI_RESOURCE *Resource)
+{
- *Buffer = Temp8;
- Buffer += 1;
+ ACPI_FUNCTION_TRACE ("RsGetExtAddress64");
- /* Set the type specific flags */
- Temp8 = 0;
+ /* Get the Resource Type, general flags, and type-specific flags */
- if (ACPI_MEMORY_RANGE == LinkedList->Data.Address64.ResourceType)
+ if (!AcpiRsGetAddressCommon (Resource, Aml))
{
- Temp8 = (UINT8)
- (LinkedList->Data.Address64.Attribute.Memory.ReadWriteAttribute &
- 0x01);
-
- Temp8 |=
- (LinkedList->Data.Address64.Attribute.Memory.CacheAttribute &
- 0x03) << 1;
+ return_ACPI_STATUS (AE_AML_INVALID_RESOURCE_TYPE);
}
- else if (ACPI_IO_RANGE == LinkedList->Data.Address64.ResourceType)
+
+ /*
+ * Get and validate the Revision ID
+ * Note: Only one revision ID is currently supported
+ */
+ Resource->Data.ExtAddress64.RevisionID = Aml->ExtAddress64.RevisionID;
+ if (Aml->ExtAddress64.RevisionID != AML_RESOURCE_EXTENDED_ADDRESS_REVISION)
{
- Temp8 = (UINT8)
- (LinkedList->Data.Address64.Attribute.Io.RangeAttribute &
- 0x03);
- Temp8 |=
- (LinkedList->Data.Address64.Attribute.Io.RangeAttribute &
- 0x03) << 4;
+ return_ACPI_STATUS (AE_SUPPORT);
}
- *Buffer = Temp8;
- Buffer += 1;
-
- /* Set the address space granularity */
-
- ACPI_MOVE_64_TO_64 (Buffer, &LinkedList->Data.Address64.Granularity);
- Buffer += 8;
-
- /* Set the address range minimum */
-
- ACPI_MOVE_64_TO_64 (Buffer, &LinkedList->Data.Address64.MinAddressRange);
- Buffer += 8;
-
- /* Set the address range maximum */
-
- ACPI_MOVE_64_TO_64 (Buffer, &LinkedList->Data.Address64.MaxAddressRange);
- Buffer += 8;
-
- /* Set the address translation offset */
-
- ACPI_MOVE_64_TO_64 (Buffer,
- &LinkedList->Data.Address64.AddressTranslationOffset);
- Buffer += 8;
-
- /* Set the address length */
+ /*
+ * Get the following contiguous fields from the AML descriptor:
+ * Address Granularity
+ * Address Range Minimum
+ * Address Range Maximum
+ * Address Translation Offset
+ * Address Length
+ * Type-Specific Attribute
+ */
+ AcpiRsMoveData (&Resource->Data.ExtAddress64.Granularity,
+ &Aml->ExtAddress64.Granularity, 6, ACPI_MOVE_TYPE_64_TO_64);
- ACPI_MOVE_64_TO_64 (Buffer, &LinkedList->Data.Address64.AddressLength);
- Buffer += 8;
+ /* Complete the resource header */
- /* Resource Source Index and Resource Source are optional */
+ Resource->Type = ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64;
+ Resource->Length = ACPI_SIZEOF_RESOURCE (ACPI_RESOURCE_EXTENDED_ADDRESS64);
+ return_ACPI_STATUS (AE_OK);
+}
- if (0 != LinkedList->Data.Address64.ResourceSource.StringLength)
- {
- Temp8 = (UINT8) LinkedList->Data.Address64.ResourceSource.Index;
- *Buffer = Temp8;
- Buffer += 1;
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiRsSetExtAddress64
+ *
+ * PARAMETERS: Resource - Pointer to the resource descriptor
+ * Aml - Where the AML descriptor is returned
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Convert an internal resource descriptor to the corresponding
+ * external AML resource descriptor.
+ *
+ ******************************************************************************/
- TempPointer = (char *) Buffer;
+ACPI_STATUS
+AcpiRsSetExtAddress64 (
+ ACPI_RESOURCE *Resource,
+ AML_RESOURCE *Aml)
+{
+ ACPI_FUNCTION_TRACE ("RsSetExtAddress64");
- /* Copy the string */
- ACPI_STRCPY (TempPointer,
- LinkedList->Data.Address64.ResourceSource.StringPtr);
+ /* Set the Resource Type, General Flags, and Type-Specific Flags */
- /*
- * Buffer needs to be set to the length of the sting + one for the
- * terminating null
- */
- Buffer += (ACPI_SIZE)(ACPI_STRLEN (
- LinkedList->Data.Address64.ResourceSource.StringPtr) + 1);
- }
+ AcpiRsSetAddressCommon (Aml, Resource);
- /* Return the number of bytes consumed in this operation */
+ /* Only one Revision ID is currently supported */
- *BytesConsumed = ACPI_PTR_DIFF (Buffer, *OutputBuffer);
+ Aml->ExtAddress64.RevisionID = AML_RESOURCE_EXTENDED_ADDRESS_REVISION;
+ Aml->ExtAddress64.Reserved = 0;
/*
- * Set the length field to the number of bytes consumed
- * minus the header size (3 bytes)
+ * Set the following contiguous fields in the AML descriptor:
+ * Address Granularity
+ * Address Range Minimum
+ * Address Range Maximum
+ * Address Translation Offset
+ * Address Length
+ * Type-Specific Attribute
*/
- *LengthField = (UINT16) (*BytesConsumed - 3);
+ AcpiRsMoveData (&Aml->ExtAddress64.Granularity,
+ &Resource->Data.Address64.Granularity, 6, ACPI_MOVE_TYPE_64_TO_64);
+
+ /* Complete the AML descriptor header */
+
+ AcpiRsSetResourceHeader (ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64,
+ sizeof (AML_RESOURCE_EXTENDED_ADDRESS64), Aml);
return_ACPI_STATUS (AE_OK);
}
diff --git a/usr/src/uts/i86pc/io/acpica/resources/rscalc.c b/usr/src/uts/i86pc/io/acpica/resources/rscalc.c
index 48dc5a19ae..0152da29e9 100644
--- a/usr/src/uts/i86pc/io/acpica/resources/rscalc.c
+++ b/usr/src/uts/i86pc/io/acpica/resources/rscalc.c
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: rscalc - Calculate stream and list lengths
- * $Revision: 57 $
+ * $Revision: 1.64 $
*
******************************************************************************/
@@ -125,677 +125,484 @@
ACPI_MODULE_NAME ("rscalc")
+/* Local prototypes */
+
+static UINT8
+AcpiRsCountSetBits (
+ UINT16 BitField);
+
+static ACPI_SIZE
+AcpiRsStructOptionLength (
+ ACPI_RESOURCE_SOURCE *ResourceSource);
+
+static UINT32
+AcpiRsStreamOptionLength (
+ UINT32 ResourceLength,
+ UINT32 MinimumTotalLength);
+
+
/*******************************************************************************
*
- * FUNCTION: AcpiRsGetByteStreamLength
+ * FUNCTION: AcpiRsCountSetBits
*
- * PARAMETERS: LinkedList - Pointer to the resource linked list
- * SizeNeeded - UINT32 pointer of the size buffer needed
- * to properly return the parsed data
+ * PARAMETERS: BitField - Field in which to count bits
*
- * RETURN: Status
+ * RETURN: Number of bits set within the field
*
- * DESCRIPTION: Takes the resource byte stream and parses it once, calculating
- * the size buffer needed to hold the linked list that conveys
- * the resource data.
+ * DESCRIPTION: Count the number of bits set in a resource field. Used for
+ * (Short descriptor) interrupt and DMA lists.
*
******************************************************************************/
-ACPI_STATUS
-AcpiRsGetByteStreamLength (
- ACPI_RESOURCE *LinkedList,
- ACPI_SIZE *SizeNeeded)
+static UINT8
+AcpiRsCountSetBits (
+ UINT16 BitField)
{
- ACPI_SIZE ByteStreamSizeNeeded = 0;
- ACPI_SIZE SegmentSize;
- BOOLEAN Done = FALSE;
+ UINT8 BitsSet;
- ACPI_FUNCTION_TRACE ("RsGetByteStreamLength");
+ ACPI_FUNCTION_ENTRY ();
- while (!Done)
+ for (BitsSet = 0; BitField; BitsSet++)
{
- /* Init the variable that will hold the size to add to the total. */
-
- SegmentSize = 0;
-
- switch (LinkedList->Id)
- {
- case ACPI_RSTYPE_IRQ:
- /*
- * IRQ Resource
- * For an IRQ Resource, Byte 3, although optional, will always be
- * created - it holds IRQ information.
- */
- SegmentSize = 4;
- break;
-
- case ACPI_RSTYPE_DMA:
- /*
- * DMA Resource
- * For this resource the size is static
- */
- SegmentSize = 3;
- break;
-
- case ACPI_RSTYPE_START_DPF:
- /*
- * Start Dependent Functions Resource
- * For a StartDependentFunctions Resource, Byte 1, although
- * optional, will always be created.
- */
- SegmentSize = 2;
- break;
-
- case ACPI_RSTYPE_END_DPF:
- /*
- * End Dependent Functions Resource
- * For this resource the size is static
- */
- SegmentSize = 1;
- break;
-
- case ACPI_RSTYPE_IO:
- /*
- * IO Port Resource
- * For this resource the size is static
- */
- SegmentSize = 8;
- break;
-
- case ACPI_RSTYPE_FIXED_IO:
- /*
- * Fixed IO Port Resource
- * For this resource the size is static
- */
- SegmentSize = 4;
- break;
-
- case ACPI_RSTYPE_VENDOR:
- /*
- * Vendor Defined Resource
- * For a Vendor Specific resource, if the Length is between 1 and 7
- * it will be created as a Small Resource data type, otherwise it
- * is a Large Resource data type.
- */
- if (LinkedList->Data.VendorSpecific.Length > 7)
- {
- SegmentSize = 3;
- }
- else
- {
- SegmentSize = 1;
- }
- SegmentSize += LinkedList->Data.VendorSpecific.Length;
- break;
-
- case ACPI_RSTYPE_END_TAG:
- /*
- * End Tag
- * For this resource the size is static
- */
- SegmentSize = 2;
- Done = TRUE;
- break;
-
- case ACPI_RSTYPE_MEM24:
- /*
- * 24-Bit Memory Resource
- * For this resource the size is static
- */
- SegmentSize = 12;
- break;
-
- case ACPI_RSTYPE_MEM32:
- /*
- * 32-Bit Memory Range Resource
- * For this resource the size is static
- */
- SegmentSize = 20;
- break;
+ /* Zero the least significant bit that is set */
- case ACPI_RSTYPE_FIXED_MEM32:
- /*
- * 32-Bit Fixed Memory Resource
- * For this resource the size is static
- */
- SegmentSize = 12;
- break;
+ BitField &= (BitField - 1);
+ }
- case ACPI_RSTYPE_ADDRESS16:
- /*
- * 16-Bit Address Resource
- * The base size of this byte stream is 16. If a Resource Source
- * string is not NULL, add 1 for the Index + the length of the null
- * terminated string Resource Source + 1 for the null.
- */
- SegmentSize = 16;
+ return (BitsSet);
+}
- if (LinkedList->Data.Address16.ResourceSource.StringPtr)
- {
- SegmentSize +=
- LinkedList->Data.Address16.ResourceSource.StringLength;
- SegmentSize++;
- }
- break;
- case ACPI_RSTYPE_ADDRESS32:
- /*
- * 32-Bit Address Resource
- * The base size of this byte stream is 26. If a Resource
- * Source string is not NULL, add 1 for the Index + the
- * length of the null terminated string Resource Source +
- * 1 for the null.
- */
- SegmentSize = 26;
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiRsStructOptionLength
+ *
+ * PARAMETERS: ResourceSource - Pointer to optional descriptor field
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Common code to handle optional ResourceSourceIndex and
+ * ResourceSource fields in some Large descriptors. Used during
+ * list-to-stream conversion
+ *
+ ******************************************************************************/
- if (LinkedList->Data.Address32.ResourceSource.StringPtr)
- {
- SegmentSize +=
- LinkedList->Data.Address32.ResourceSource.StringLength;
- SegmentSize++;
- }
- break;
+static ACPI_SIZE
+AcpiRsStructOptionLength (
+ ACPI_RESOURCE_SOURCE *ResourceSource)
+{
+ ACPI_FUNCTION_ENTRY ();
- case ACPI_RSTYPE_ADDRESS64:
- /*
- * 64-Bit Address Resource
- * The base size of this byte stream is 46. If a ResourceSource
- * string is not NULL, add 1 for the Index + the length of the null
- * terminated string Resource Source + 1 for the null.
- */
- SegmentSize = 46;
- if (LinkedList->Data.Address64.ResourceSource.StringPtr)
- {
- SegmentSize +=
- LinkedList->Data.Address64.ResourceSource.StringLength;
- SegmentSize++;
- }
- break;
+ /*
+ * If the ResourceSource string is valid, return the size of the string
+ * (StringLength includes the NULL terminator) plus the size of the
+ * ResourceSourceIndex (1).
+ */
+ if (ResourceSource->StringPtr)
+ {
+ return ((ACPI_SIZE) ResourceSource->StringLength + 1);
+ }
- case ACPI_RSTYPE_EXT_IRQ:
- /*
- * Extended IRQ Resource
- * The base size of this byte stream is 9. This is for an Interrupt
- * table length of 1. For each additional interrupt, add 4.
- * If a Resource Source string is not NULL, add 1 for the
- * Index + the length of the null terminated string
- * Resource Source + 1 for the null.
- */
- SegmentSize = 9 + (((ACPI_SIZE)
- LinkedList->Data.ExtendedIrq.NumberOfInterrupts - 1) * 4);
+ return (0);
+}
- if (LinkedList->Data.ExtendedIrq.ResourceSource.StringPtr)
- {
- SegmentSize +=
- LinkedList->Data.ExtendedIrq.ResourceSource.StringLength;
- SegmentSize++;
- }
- break;
- default:
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiRsStreamOptionLength
+ *
+ * PARAMETERS: ResourceLength - Length from the resource header
+ * MinimumTotalLength - Minimum length of this resource, before
+ * any optional fields. Includes header size
+ *
+ * RETURN: Length of optional string (0 if no string present)
+ *
+ * DESCRIPTION: Common code to handle optional ResourceSourceIndex and
+ * ResourceSource fields in some Large descriptors. Used during
+ * stream-to-list conversion
+ *
+ ******************************************************************************/
- /* If we get here, everything is out of sync, exit with error */
+static UINT32
+AcpiRsStreamOptionLength (
+ UINT32 ResourceLength,
+ UINT32 MinimumAmlResourceLength)
+{
+ UINT32 StringLength = 0;
- return_ACPI_STATUS (AE_AML_INVALID_RESOURCE_TYPE);
- } /* switch (LinkedList->Id) */
+ ACPI_FUNCTION_ENTRY ();
- /* Update the total */
- ByteStreamSizeNeeded += SegmentSize;
+ /*
+ * The ResourceSourceIndex and ResourceSource are optional elements of some
+ * Large-type resource descriptors.
+ */
- /* Point to the next object */
+ /*
+ * If the length of the actual resource descriptor is greater than the ACPI
+ * spec-defined minimum length, it means that a ResourceSourceIndex exists
+ * and is followed by a (required) null terminated string. The string length
+ * (including the null terminator) is the resource length minus the minimum
+ * length, minus one byte for the ResourceSourceIndex itself.
+ */
+ if (ResourceLength > MinimumAmlResourceLength)
+ {
+ /* Compute the length of the optional string */
- LinkedList = ACPI_PTR_ADD (ACPI_RESOURCE,
- LinkedList, LinkedList->Length);
+ StringLength = ResourceLength - MinimumAmlResourceLength - 1;
}
- /* This is the data the caller needs */
+ /* Round up length to 32 bits for internal structure alignment */
- *SizeNeeded = ByteStreamSizeNeeded;
- return_ACPI_STATUS (AE_OK);
+ return (ACPI_ROUND_UP_TO_32BITS (StringLength));
}
/*******************************************************************************
*
- * FUNCTION: AcpiRsGetListLength
+ * FUNCTION: AcpiRsGetAmlLength
*
- * PARAMETERS: ByteStreamBuffer - Pointer to the resource byte stream
- * ByteStreamBufferLength - Size of ByteStreamBuffer
- * SizeNeeded - UINT32 pointer of the size buffer
- * needed to properly return the
- * parsed data
+ * PARAMETERS: Resource - Pointer to the resource linked list
+ * SizeNeeded - Where the required size is returned
*
* RETURN: Status
*
- * DESCRIPTION: Takes the resource byte stream and parses it once, calculating
- * the size buffer needed to hold the linked list that conveys
- * the resource data.
+ * DESCRIPTION: Takes a linked list of internal resource descriptors and
+ * calculates the size buffer needed to hold the corresponding
+ * external resource byte stream.
*
******************************************************************************/
ACPI_STATUS
-AcpiRsGetListLength (
- UINT8 *ByteStreamBuffer,
- UINT32 ByteStreamBufferLength,
+AcpiRsGetAmlLength (
+ ACPI_RESOURCE *Resource,
ACPI_SIZE *SizeNeeded)
{
- UINT32 BufferSize = 0;
- UINT32 BytesParsed = 0;
- UINT8 NumberOfInterrupts = 0;
- UINT8 NumberOfChannels = 0;
- UINT8 ResourceType;
- UINT32 StructureSize;
- UINT32 BytesConsumed;
- UINT8 *Buffer;
- UINT8 Temp8;
- UINT16 Temp16;
- UINT8 Index;
- UINT8 AdditionalBytes;
+ ACPI_SIZE AmlSizeNeeded = 0;
+ ACPI_SIZE SegmentSize;
- ACPI_FUNCTION_TRACE ("RsGetListLength");
+ ACPI_FUNCTION_TRACE ("RsGetAmlLength");
- while (BytesParsed < ByteStreamBufferLength)
- {
- /* The next byte in the stream is the resource type */
+ /* Traverse entire list of internal resource descriptors */
- ResourceType = AcpiRsGetResourceType (*ByteStreamBuffer);
+ while (Resource)
+ {
+ /* Validate the descriptor type */
- switch (ResourceType)
+ if (Resource->Type > ACPI_RESOURCE_TYPE_MAX)
{
- case ACPI_RDESC_TYPE_MEMORY_24:
- /*
- * 24-Bit Memory Resource
- */
- BytesConsumed = 12;
+ return_ACPI_STATUS (AE_AML_INVALID_RESOURCE_TYPE);
+ }
- StructureSize = ACPI_SIZEOF_RESOURCE (ACPI_RESOURCE_MEM24);
- break;
+ /* Get the base size of the (external stream) resource descriptor */
+ SegmentSize = AcpiGbl_AmlResourceSizes [Resource->Type];
- case ACPI_RDESC_TYPE_LARGE_VENDOR:
+ /*
+ * Augment the base size for descriptors with optional and/or
+ * variable-length fields
+ */
+ switch (Resource->Type)
+ {
+ case ACPI_RESOURCE_TYPE_VENDOR:
/*
- * Vendor Defined Resource
+ * Vendor Defined Resource:
+ * For a Vendor Specific resource, if the Length is between 1 and 7
+ * it will be created as a Small Resource data type, otherwise it
+ * is a Large Resource data type.
*/
- Buffer = ByteStreamBuffer;
- ++Buffer;
-
- ACPI_MOVE_16_TO_16 (&Temp16, Buffer);
- BytesConsumed = Temp16 + 3;
+ if (Resource->Data.Vendor.ByteLength > 7)
+ {
+ /* Base size of a Large resource descriptor */
- /* Ensure a 32-bit boundary for the structure */
+ SegmentSize = sizeof (AML_RESOURCE_LARGE_HEADER);
+ }
- Temp16 = (UINT16) ACPI_ROUND_UP_TO_32BITS (Temp16);
+ /* Add the size of the vendor-specific data */
- StructureSize = ACPI_SIZEOF_RESOURCE (ACPI_RESOURCE_VENDOR) +
- (Temp16 * sizeof (UINT8));
+ SegmentSize += Resource->Data.Vendor.ByteLength;
break;
- case ACPI_RDESC_TYPE_MEMORY_32:
+ case ACPI_RESOURCE_TYPE_END_TAG:
/*
- * 32-Bit Memory Range Resource
+ * End Tag:
+ * We are done -- return the accumulated total size.
*/
- BytesConsumed = 20;
+ *SizeNeeded = AmlSizeNeeded + SegmentSize;
- StructureSize = ACPI_SIZEOF_RESOURCE (ACPI_RESOURCE_MEM32);
- break;
+ /* Normal exit */
+ return_ACPI_STATUS (AE_OK);
- case ACPI_RDESC_TYPE_FIXED_MEMORY_32:
- /*
- * 32-Bit Fixed Memory Resource
- */
- BytesConsumed = 12;
- StructureSize = ACPI_SIZEOF_RESOURCE (ACPI_RESOURCE_FIXED_MEM32);
- break;
-
-
- case ACPI_RDESC_TYPE_EXTENDED_ADDRESS_SPACE:
+ case ACPI_RESOURCE_TYPE_ADDRESS16:
/*
- * 64-Bit Address Resource
+ * 16-Bit Address Resource:
+ * Add the size of the optional ResourceSource info
*/
- Buffer = ByteStreamBuffer;
-
- ++Buffer;
- ACPI_MOVE_16_TO_16 (&Temp16, Buffer);
-
- BytesConsumed = Temp16 + 3;
- StructureSize = ACPI_SIZEOF_RESOURCE (ACPI_RESOURCE_ADDRESS64);
+ SegmentSize += AcpiRsStructOptionLength (
+ &Resource->Data.Address16.ResourceSource);
break;
- case ACPI_RDESC_TYPE_QWORD_ADDRESS_SPACE:
- /*
- * 64-Bit Address Resource
- */
- Buffer = ByteStreamBuffer;
-
- ++Buffer;
- ACPI_MOVE_16_TO_16 (&Temp16, Buffer);
-
- BytesConsumed = Temp16 + 3;
-
+ case ACPI_RESOURCE_TYPE_ADDRESS32:
/*
- * Resource Source Index and Resource Source are optional elements.
- * Check the length of the Bytestream. If it is greater than 43,
- * that means that an Index exists and is followed by a null
- * terminated string. Therefore, set the temp variable to the
- * length minus the minimum byte stream length plus the byte for
- * the Index to determine the size of the NULL terminated string.
+ * 32-Bit Address Resource:
+ * Add the size of the optional ResourceSource info
*/
- if (43 < Temp16)
- {
- Temp8 = (UINT8) (Temp16 - 44);
- }
- else
- {
- Temp8 = 0;
- }
-
- /* Ensure a 64-bit boundary for the structure */
-
- Temp8 = (UINT8) ACPI_ROUND_UP_TO_64BITS (Temp8);
-
- StructureSize = ACPI_SIZEOF_RESOURCE (ACPI_RESOURCE_ADDRESS64) +
- (Temp8 * sizeof (UINT8));
+ SegmentSize += AcpiRsStructOptionLength (
+ &Resource->Data.Address32.ResourceSource);
break;
- case ACPI_RDESC_TYPE_DWORD_ADDRESS_SPACE:
- /*
- * 32-Bit Address Resource
- */
- Buffer = ByteStreamBuffer;
-
- ++Buffer;
- ACPI_MOVE_16_TO_16 (&Temp16, Buffer);
-
- BytesConsumed = Temp16 + 3;
-
+ case ACPI_RESOURCE_TYPE_ADDRESS64:
/*
- * Resource Source Index and Resource Source are optional elements.
- * Check the length of the Bytestream. If it is greater than 23,
- * that means that an Index exists and is followed by a null
- * terminated string. Therefore, set the temp variable to the
- * length minus the minimum byte stream length plus the byte for
- * the Index to determine the size of the NULL terminated string.
+ * 64-Bit Address Resource:
+ * Add the size of the optional ResourceSource info
*/
- if (23 < Temp16)
- {
- Temp8 = (UINT8) (Temp16 - 24);
- }
- else
- {
- Temp8 = 0;
- }
-
- /* Ensure a 32-bit boundary for the structure */
-
- Temp8 = (UINT8) ACPI_ROUND_UP_TO_32BITS (Temp8);
-
- StructureSize = ACPI_SIZEOF_RESOURCE (ACPI_RESOURCE_ADDRESS32) +
- (Temp8 * sizeof (UINT8));
+ SegmentSize += AcpiRsStructOptionLength (
+ &Resource->Data.Address64.ResourceSource);
break;
- case ACPI_RDESC_TYPE_WORD_ADDRESS_SPACE:
+ case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
/*
- * 16-Bit Address Resource
+ * Extended IRQ Resource:
+ * Add the size of each additional optional interrupt beyond the
+ * required 1 (4 bytes for each UINT32 interrupt number)
*/
- Buffer = ByteStreamBuffer;
+ SegmentSize += (((ACPI_SIZE)
+ Resource->Data.ExtendedIrq.InterruptCount - 1) * 4);
- ++Buffer;
- ACPI_MOVE_16_TO_16 (&Temp16, Buffer);
+ /* Add the size of the optional ResourceSource info */
- BytesConsumed = Temp16 + 3;
-
- /*
- * Resource Source Index and Resource Source are optional elements.
- * Check the length of the Bytestream. If it is greater than 13,
- * that means that an Index exists and is followed by a null
- * terminated string. Therefore, set the temp variable to the
- * length minus the minimum byte stream length plus the byte for
- * the Index to determine the size of the NULL terminated string.
- */
- if (13 < Temp16)
- {
- Temp8 = (UINT8) (Temp16 - 14);
- }
- else
- {
- Temp8 = 0;
- }
-
- /* Ensure a 32-bit boundary for the structure */
+ SegmentSize += AcpiRsStructOptionLength (
+ &Resource->Data.ExtendedIrq.ResourceSource);
+ break;
- Temp8 = (UINT8) ACPI_ROUND_UP_TO_32BITS (Temp8);
- StructureSize = ACPI_SIZEOF_RESOURCE (ACPI_RESOURCE_ADDRESS16) +
- (Temp8 * sizeof (UINT8));
+ default:
break;
+ }
+ /* Update the total */
- case ACPI_RDESC_TYPE_EXTENDED_XRUPT:
- /*
- * Extended IRQ
- */
- Buffer = ByteStreamBuffer;
+ AmlSizeNeeded += SegmentSize;
- ++Buffer;
- ACPI_MOVE_16_TO_16 (&Temp16, Buffer);
+ /* Point to the next object */
- BytesConsumed = Temp16 + 3;
+ Resource = ACPI_PTR_ADD (ACPI_RESOURCE,
+ Resource, Resource->Length);
+ }
- /*
- * Point past the length field and the Interrupt vector flags to
- * save off the Interrupt table length to the Temp8 variable.
- */
- Buffer += 3;
- Temp8 = *Buffer;
+ /* Did not find an END_TAG descriptor */
- /*
- * To compensate for multiple interrupt numbers, add 4 bytes for
- * each additional interrupts greater than 1
- */
- AdditionalBytes = (UINT8) ((Temp8 - 1) * 4);
-
- /*
- * Resource Source Index and Resource Source are optional elements.
- * Check the length of the Bytestream. If it is greater than 9,
- * that means that an Index exists and is followed by a null
- * terminated string. Therefore, set the temp variable to the
- * length minus the minimum byte stream length plus the byte for
- * the Index to determine the size of the NULL terminated string.
- */
- if (9 + AdditionalBytes < Temp16)
- {
- Temp8 = (UINT8) (Temp16 - (9 + AdditionalBytes));
- }
- else
- {
- Temp8 = 0;
- }
+ return_ACPI_STATUS (AE_AML_INVALID_RESOURCE_TYPE);
+}
- /* Ensure a 32-bit boundary for the structure */
- Temp8 = (UINT8) ACPI_ROUND_UP_TO_32BITS (Temp8);
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiRsGetListLength
+ *
+ * PARAMETERS: AmlBuffer - Pointer to the resource byte stream
+ * AmlBufferLength - Size of AmlBuffer
+ * SizeNeeded - Where the size needed is returned
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Takes an external resource byte stream and calculates the size
+ * buffer needed to hold the corresponding internal resource
+ * descriptor linked list.
+ *
+ ******************************************************************************/
- StructureSize = ACPI_SIZEOF_RESOURCE (ACPI_RESOURCE_EXT_IRQ) +
- (AdditionalBytes * sizeof (UINT8)) +
- (Temp8 * sizeof (UINT8));
- break;
+ACPI_STATUS
+AcpiRsGetListLength (
+ UINT8 *AmlBuffer,
+ UINT32 AmlBufferLength,
+ ACPI_SIZE *SizeNeeded)
+{
+ UINT8 *Buffer;
+ ACPI_RESOURCE_INFO *ResourceInfo;
+ UINT32 BufferSize = 0;
+ UINT32 BytesParsed = 0;
+ UINT8 ResourceType;
+ UINT16 Temp16;
+ UINT16 ResourceLength;
+ UINT16 HeaderLength;
+ UINT32 ExtraStructBytes;
- case ACPI_RDESC_TYPE_IRQ_FORMAT:
- /*
- * IRQ Resource.
- * Determine if it there are two or three trailing bytes
- */
- Buffer = ByteStreamBuffer;
- Temp8 = *Buffer;
+ ACPI_FUNCTION_TRACE ("RsGetListLength");
- if(Temp8 & 0x01)
- {
- BytesConsumed = 4;
- }
- else
- {
- BytesConsumed = 3;
- }
- /* Point past the descriptor */
+ while (BytesParsed < AmlBufferLength)
+ {
+ /* The next byte in the stream is the resource descriptor type */
- ++Buffer;
+ ResourceType = AcpiRsGetResourceType (*AmlBuffer);
- /* Look at the number of bits set */
+ /* Get the base stream size and structure sizes for the descriptor */
- ACPI_MOVE_16_TO_16 (&Temp16, Buffer);
+ ResourceInfo = AcpiRsGetResourceInfo (ResourceType);
+ if (!ResourceInfo)
+ {
+ return_ACPI_STATUS (AE_AML_INVALID_RESOURCE_TYPE);
+ }
- for (Index = 0; Index < 16; Index++)
- {
- if (Temp16 & 0x1)
- {
- ++NumberOfInterrupts;
- }
+ /* Get the Length field from the input resource descriptor */
- Temp16 >>= 1;
- }
+ ResourceLength = AcpiRsGetResourceLength (
+ ACPI_CAST_PTR (AML_RESOURCE, AmlBuffer));
- StructureSize = ACPI_SIZEOF_RESOURCE (ACPI_RESOURCE_IO) +
- (NumberOfInterrupts * sizeof (UINT32));
- break;
+ /* Augment the size for descriptors with optional fields */
+ ExtraStructBytes = 0;
- case ACPI_RDESC_TYPE_DMA_FORMAT:
+ if (!(ResourceType & ACPI_RESOURCE_NAME_LARGE))
+ {
/*
- * DMA Resource
+ * Small resource descriptors
*/
- Buffer = ByteStreamBuffer;
- BytesConsumed = 3;
-
- /* Point past the descriptor */
-
- ++Buffer;
+ HeaderLength = sizeof (AML_RESOURCE_SMALL_HEADER);
+ Buffer = AmlBuffer + HeaderLength;
- /* Look at the number of bits set */
-
- Temp8 = *Buffer;
-
- for(Index = 0; Index < 8; Index++)
+ switch (ResourceType)
{
- if(Temp8 & 0x1)
- {
- ++NumberOfChannels;
- }
+ case ACPI_RESOURCE_NAME_IRQ:
+ /*
+ * IRQ Resource:
+ * Get the number of bits set in the IRQ word
+ */
+ ACPI_MOVE_16_TO_16 (&Temp16, Buffer);
+ ExtraStructBytes = (AcpiRsCountSetBits (Temp16) *
+ sizeof (UINT32));
+ break;
- Temp8 >>= 1;
- }
- StructureSize = ACPI_SIZEOF_RESOURCE (ACPI_RESOURCE_DMA) +
- (NumberOfChannels * sizeof (UINT32));
- break;
+ case ACPI_RESOURCE_NAME_DMA:
+ /*
+ * DMA Resource:
+ * Get the number of bits set in the DMA channels byte
+ */
+ ACPI_MOVE_16_TO_16 (&Temp16, Buffer);
+ ExtraStructBytes = (AcpiRsCountSetBits (Temp16) *
+ sizeof (UINT32));
+ break;
- case ACPI_RDESC_TYPE_START_DEPENDENT:
- /*
- * Start Dependent Functions Resource
- * Determine if it there are two or three trailing bytes
- */
- Buffer = ByteStreamBuffer;
- Temp8 = *Buffer;
+ case ACPI_RESOURCE_NAME_VENDOR_SMALL:
+ /*
+ * Vendor Specific Resource:
+ * Ensure a 32-bit boundary for the structure
+ */
+ ExtraStructBytes = ACPI_ROUND_UP_TO_32BITS (ResourceLength);
+ break;
- if(Temp8 & 0x01)
- {
- BytesConsumed = 2;
- }
- else
- {
- BytesConsumed = 1;
- }
- StructureSize = ACPI_SIZEOF_RESOURCE (ACPI_RESOURCE_START_DPF);
- break;
+ case ACPI_RESOURCE_NAME_END_TAG:
+ /*
+ * End Tag:
+ * Terminate the loop now
+ */
+ AmlBufferLength = BytesParsed;
+ break;
- case ACPI_RDESC_TYPE_END_DEPENDENT:
+ default:
+ break;
+ }
+ }
+ else
+ {
/*
- * End Dependent Functions Resource
+ * Large resource descriptors
*/
- BytesConsumed = 1;
- StructureSize = ACPI_RESOURCE_LENGTH;
- break;
-
+ HeaderLength = sizeof (AML_RESOURCE_LARGE_HEADER);
+ Buffer = AmlBuffer + HeaderLength;
- case ACPI_RDESC_TYPE_IO_PORT:
- /*
- * IO Port Resource
- */
- BytesConsumed = 8;
- StructureSize = ACPI_SIZEOF_RESOURCE (ACPI_RESOURCE_IO);
- break;
+ switch (ResourceType)
+ {
+ case ACPI_RESOURCE_NAME_VENDOR_LARGE:
+ /*
+ * Vendor Defined Resource:
+ * Add vendor data and ensure a 32-bit boundary for the structure
+ */
+ ExtraStructBytes = ACPI_ROUND_UP_TO_32BITS (ResourceLength);
+ break;
- case ACPI_RDESC_TYPE_FIXED_IO_PORT:
- /*
- * Fixed IO Port Resource
- */
- BytesConsumed = 4;
- StructureSize = ACPI_SIZEOF_RESOURCE (ACPI_RESOURCE_FIXED_IO);
- break;
+ case ACPI_RESOURCE_NAME_ADDRESS32:
+ case ACPI_RESOURCE_NAME_ADDRESS16:
+ /*
+ * 32-Bit or 16-bit Address Resource:
+ * Add the size of any optional data (ResourceSource)
+ */
+ ExtraStructBytes = AcpiRsStreamOptionLength (ResourceLength,
+ ResourceInfo->MinimumAmlResourceLength);
+ break;
- case ACPI_RDESC_TYPE_SMALL_VENDOR:
- /*
- * Vendor Specific Resource
- */
- Buffer = ByteStreamBuffer;
+ case ACPI_RESOURCE_NAME_EXTENDED_IRQ:
+ /*
+ * Extended IRQ:
+ * Point past the InterruptVectorFlags to get the
+ * InterruptTableLength.
+ */
+ Buffer++;
- Temp8 = *Buffer;
- Temp8 = (UINT8) (Temp8 & 0x7);
- BytesConsumed = Temp8 + 1;
+ /*
+ * Add 4 bytes for each additional interrupt. Note: at least one
+ * interrupt is required and is included in the minimum
+ * descriptor size
+ */
+ ExtraStructBytes = ((*Buffer - 1) * sizeof (UINT32));
- /* Ensure a 32-bit boundary for the structure */
+ /* Add the size of any optional data (ResourceSource) */
- Temp8 = (UINT8) ACPI_ROUND_UP_TO_32BITS (Temp8);
- StructureSize = ACPI_SIZEOF_RESOURCE (ACPI_RESOURCE_VENDOR) +
- (Temp8 * sizeof (UINT8));
- break;
+ ExtraStructBytes += AcpiRsStreamOptionLength (
+ ResourceLength - ExtraStructBytes,
+ ResourceInfo->MinimumAmlResourceLength);
+ break;
- case ACPI_RDESC_TYPE_END_TAG:
- /*
- * End Tag
- */
- BytesConsumed = 2;
- StructureSize = ACPI_RESOURCE_LENGTH;
- ByteStreamBufferLength = BytesParsed;
- break;
+ case ACPI_RESOURCE_NAME_ADDRESS64:
+ /*
+ * 64-Bit Address Resource:
+ * Add the size of any optional data (ResourceSource)
+ * Ensure a 64-bit boundary for the structure
+ */
+ ExtraStructBytes = ACPI_ROUND_UP_TO_64BITS (
+ AcpiRsStreamOptionLength (ResourceLength,
+ ResourceInfo->MinimumAmlResourceLength));
+ break;
- default:
- /*
- * If we get here, everything is out of sync,
- * exit with an error
- */
- return_ACPI_STATUS (AE_AML_INVALID_RESOURCE_TYPE);
+ default:
+ break;
+ }
}
- /* Update the return value and counter */
-
- BufferSize += (UINT32) ACPI_ALIGN_RESOURCE_SIZE (StructureSize);
- BytesParsed += BytesConsumed;
+ /* Update the required buffer size for the internal descriptor structs */
- /* Set the byte stream to point to the next resource */
+ Temp16 = (UINT16) (ResourceInfo->MinimumInternalStructLength + ExtraStructBytes);
+ BufferSize += (UINT32) ACPI_ALIGN_RESOURCE_SIZE (Temp16);
- ByteStreamBuffer += BytesConsumed;
+ /*
+ * Update byte count and point to the next resource within the stream
+ * using the size of the header plus the length contained in the header
+ */
+ Temp16 = (UINT16) (HeaderLength + ResourceLength);
+ BytesParsed += Temp16;
+ AmlBuffer += Temp16;
}
/* This is the data the caller needs */
diff --git a/usr/src/uts/i86pc/io/acpica/resources/rscreate.c b/usr/src/uts/i86pc/io/acpica/resources/rscreate.c
index 8caf2506f1..0342459502 100644
--- a/usr/src/uts/i86pc/io/acpica/resources/rscreate.c
+++ b/usr/src/uts/i86pc/io/acpica/resources/rscreate.c
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: rscreate - Create resource lists/tables
- * $Revision: 70 $
+ * $Revision: 1.71 $
*
******************************************************************************/
@@ -130,10 +130,10 @@
*
* FUNCTION: AcpiRsCreateResourceList
*
- * PARAMETERS: ByteStreamBuffer - Pointer to the resource byte stream
- * OutputBuffer - Pointer to the user's buffer
+ * PARAMETERS: AmlBuffer - Pointer to the resource byte stream
+ * OutputBuffer - Pointer to the user's buffer
*
- * RETURN: Status - AE_OK if okay, else a valid ACPI_STATUS code
+ * RETURN: Status: AE_OK if okay, else a valid ACPI_STATUS code
* If OutputBuffer is not large enough, OutputBufferLength
* indicates how large OutputBuffer should be, else it
* indicates how may UINT8 elements of OutputBuffer are valid.
@@ -146,32 +146,32 @@
ACPI_STATUS
AcpiRsCreateResourceList (
- ACPI_OPERAND_OBJECT *ByteStreamBuffer,
+ ACPI_OPERAND_OBJECT *AmlBuffer,
ACPI_BUFFER *OutputBuffer)
{
ACPI_STATUS Status;
- UINT8 *ByteStreamStart;
+ UINT8 *AmlStart;
ACPI_SIZE ListSizeNeeded = 0;
- UINT32 ByteStreamBufferLength;
+ UINT32 AmlBufferLength;
ACPI_FUNCTION_TRACE ("RsCreateResourceList");
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "ByteStreamBuffer = %p\n",
- ByteStreamBuffer));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "AmlBuffer = %p\n",
+ AmlBuffer));
/* Params already validated, so we don't re-validate here */
- ByteStreamBufferLength = ByteStreamBuffer->Buffer.Length;
- ByteStreamStart = ByteStreamBuffer->Buffer.Pointer;
+ AmlBufferLength = AmlBuffer->Buffer.Length;
+ AmlStart = AmlBuffer->Buffer.Pointer;
/*
- * Pass the ByteStreamBuffer into a module that can calculate
+ * Pass the AmlBuffer into a module that can calculate
* the buffer size needed for the linked list
*/
- Status = AcpiRsGetListLength (ByteStreamStart, ByteStreamBufferLength,
+ Status = AcpiRsGetListLength (AmlStart, AmlBufferLength,
&ListSizeNeeded);
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Status=%X ListSizeNeeded=%X\n",
@@ -191,7 +191,7 @@ AcpiRsCreateResourceList (
/* Do the conversion */
- Status = AcpiRsByteStreamToList (ByteStreamStart, ByteStreamBufferLength,
+ Status = AcpiRsConvertAmlToResources (AmlStart, AmlBufferLength,
OutputBuffer->Pointer);
if (ACPI_FAILURE (Status))
{
@@ -448,7 +448,7 @@ AcpiRsCreatePciRoutingTable (
/*******************************************************************************
*
- * FUNCTION: AcpiRsCreateByteStream
+ * FUNCTION: AcpiRsCreateAmlResources
*
* PARAMETERS: LinkedListBuffer - Pointer to the resource linked list
* OutputBuffer - Pointer to the user's buffer
@@ -465,15 +465,15 @@ AcpiRsCreatePciRoutingTable (
******************************************************************************/
ACPI_STATUS
-AcpiRsCreateByteStream (
+AcpiRsCreateAmlResources (
ACPI_RESOURCE *LinkedListBuffer,
ACPI_BUFFER *OutputBuffer)
{
ACPI_STATUS Status;
- ACPI_SIZE ByteStreamSizeNeeded = 0;
+ ACPI_SIZE AmlSizeNeeded = 0;
- ACPI_FUNCTION_TRACE ("RsCreateByteStream");
+ ACPI_FUNCTION_TRACE ("RsCreateAmlResources");
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "LinkedListBuffer = %p\n",
@@ -485,11 +485,11 @@ AcpiRsCreateByteStream (
* Pass the LinkedListBuffer into a module that calculates
* the buffer size needed for the byte stream.
*/
- Status = AcpiRsGetByteStreamLength (LinkedListBuffer,
- &ByteStreamSizeNeeded);
+ Status = AcpiRsGetAmlLength (LinkedListBuffer,
+ &AmlSizeNeeded);
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "ByteStreamSizeNeeded=%X, %s\n",
- (UINT32) ByteStreamSizeNeeded, AcpiFormatException (Status)));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "AmlSizeNeeded=%X, %s\n",
+ (UINT32) AmlSizeNeeded, AcpiFormatException (Status)));
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -497,7 +497,7 @@ AcpiRsCreateByteStream (
/* Validate/Allocate/Clear caller buffer */
- Status = AcpiUtInitializeBuffer (OutputBuffer, ByteStreamSizeNeeded);
+ Status = AcpiUtInitializeBuffer (OutputBuffer, AmlSizeNeeded);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -505,7 +505,7 @@ AcpiRsCreateByteStream (
/* Do the conversion */
- Status = AcpiRsListToByteStream (LinkedListBuffer, ByteStreamSizeNeeded,
+ Status = AcpiRsConvertResourcesToAml (LinkedListBuffer, AmlSizeNeeded,
OutputBuffer->Pointer);
if (ACPI_FAILURE (Status))
{
diff --git a/usr/src/uts/i86pc/io/acpica/resources/rsdump.c b/usr/src/uts/i86pc/io/acpica/resources/rsdump.c
index 29120d8715..7bae17a2c6 100644
--- a/usr/src/uts/i86pc/io/acpica/resources/rsdump.c
+++ b/usr/src/uts/i86pc/io/acpica/resources/rsdump.c
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: rsdump - Functions to display the resource structures.
- * $Revision: 45 $
+ * $Revision: 1.53 $
*
******************************************************************************/
@@ -129,251 +129,583 @@
/* Local prototypes */
static void
-AcpiRsDumpIrq (
- ACPI_RESOURCE_DATA *Data);
+AcpiRsOutString (
+ char *Title,
+ char *Value);
static void
-AcpiRsDumpAddress16 (
- ACPI_RESOURCE_DATA *Data);
+AcpiRsOutInteger8 (
+ char *Title,
+ UINT8 Value);
static void
-AcpiRsDumpAddress32 (
- ACPI_RESOURCE_DATA *Data);
+AcpiRsOutInteger16 (
+ char *Title,
+ UINT16 Value);
static void
-AcpiRsDumpAddress64 (
- ACPI_RESOURCE_DATA *Data);
+AcpiRsOutInteger32 (
+ char *Title,
+ UINT32 Value);
static void
-AcpiRsDumpDma (
- ACPI_RESOURCE_DATA *Data);
+AcpiRsOutInteger64 (
+ char *Title,
+ UINT64 Value);
static void
-AcpiRsDumpIo (
- ACPI_RESOURCE_DATA *Data);
+AcpiRsOutTitle (
+ char *Title);
static void
-AcpiRsDumpExtendedIrq (
- ACPI_RESOURCE_DATA *Data);
+AcpiRsDumpByteList (
+ UINT32 Length,
+ UINT8 *Data);
static void
-AcpiRsDumpFixedIo (
- ACPI_RESOURCE_DATA *Data);
+AcpiRsDumpDwordList (
+ UINT32 Length,
+ UINT32 *Data);
static void
-AcpiRsDumpFixedMemory32 (
- ACPI_RESOURCE_DATA *Data);
+AcpiRsDumpShortByteList (
+ UINT32 Length,
+ UINT32 *Data);
static void
-AcpiRsDumpMemory24 (
- ACPI_RESOURCE_DATA *Data);
+AcpiRsDumpResourceSource (
+ ACPI_RESOURCE_SOURCE *ResourceSource);
static void
-AcpiRsDumpMemory32 (
- ACPI_RESOURCE_DATA *Data);
+AcpiRsDumpAddressCommon (
+ ACPI_RESOURCE_DATA *Resource);
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiRsOut*
+ *
+ * PARAMETERS: Title - Name of the resource field
+ * Value - Value of the resource field
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Miscellaneous helper functions to consistently format the
+ * output of the resource dump routines
+ *
+ ******************************************************************************/
+
+static void
+AcpiRsOutString (
+ char *Title,
+ char *Value)
+{
+ AcpiOsPrintf ("%27s : %s\n", Title, Value);
+}
static void
-AcpiRsDumpStartDependFns (
- ACPI_RESOURCE_DATA *Data);
+AcpiRsOutInteger8 (
+ char *Title,
+ UINT8 Value)
+{
+ AcpiOsPrintf ("%27s : %2.2X\n", Title, Value);
+}
static void
-AcpiRsDumpVendorSpecific (
- ACPI_RESOURCE_DATA *Data);
+AcpiRsOutInteger16 (
+ char *Title,
+ UINT16 Value)
+{
+ AcpiOsPrintf ("%27s : %4.4X\n", Title, Value);
+}
+
+static void
+AcpiRsOutInteger32 (
+ char *Title,
+ UINT32 Value)
+{
+ AcpiOsPrintf ("%27s : %8.8X\n", Title, Value);
+}
+
+static void
+AcpiRsOutInteger64 (
+ char *Title,
+ UINT64 Value)
+{
+ AcpiOsPrintf ("%27s : %8.8X%8.8X\n", Title,
+ ACPI_FORMAT_UINT64 (Value));
+}
+
+static void
+AcpiRsOutTitle (
+ char *Title)
+{
+ AcpiOsPrintf ("%27s : ", Title);
+}
/*******************************************************************************
*
- * FUNCTION: AcpiRsDumpIrq
+ * FUNCTION: AcpiRsDump*List
*
- * PARAMETERS: Data - pointer to the resource structure to dump.
+ * PARAMETERS: Length - Number of elements in the list
+ * Data - Start of the list
*
* RETURN: None
*
- * DESCRIPTION: Prints out the various members of the Data structure type.
+ * DESCRIPTION: Miscellaneous functions to dump lists of raw data
*
******************************************************************************/
static void
-AcpiRsDumpIrq (
- ACPI_RESOURCE_DATA *Data)
+AcpiRsDumpByteList (
+ UINT32 Length,
+ UINT8 *Data)
{
- ACPI_RESOURCE_IRQ *IrqData = (ACPI_RESOURCE_IRQ *) Data;
- UINT8 Index = 0;
+ UINT32 i;
- ACPI_FUNCTION_ENTRY ();
+ for (i = 0; i < Length; i++)
+ {
+ AcpiOsPrintf ("%25s%2.2X : %2.2X\n",
+ "Byte", i, Data[i]);
+ }
+}
+static void
+AcpiRsDumpDwordList (
+ UINT32 Length,
+ UINT32 *Data)
+{
+ UINT32 i;
- AcpiOsPrintf ("IRQ Resource\n");
- AcpiOsPrintf (" %s Triggered\n",
- ACPI_LEVEL_SENSITIVE == IrqData->EdgeLevel ? "Level" : "Edge");
+ for (i = 0; i < Length; i++)
+ {
+ AcpiOsPrintf ("%25s%2.2X : %8.8X\n",
+ "Dword", i, Data[i]);
+ }
+}
+
+static void
+AcpiRsDumpShortByteList (
+ UINT32 Length,
+ UINT32 *Data)
+{
+ UINT32 i;
+
+
+ for (i = 0; i < Length; i++)
+ {
+ AcpiOsPrintf ("%X ", Data[i]);
+ }
+ AcpiOsPrintf ("\n");
+}
- AcpiOsPrintf (" Active %s\n",
- ACPI_ACTIVE_LOW == IrqData->ActiveHighLow ? "Low" : "High");
+static void
+AcpiRsDumpMemoryAttribute (
+ UINT32 ReadWriteAttribute)
+{
- AcpiOsPrintf (" %s\n",
- ACPI_SHARED == IrqData->SharedExclusive ? "Shared" : "Exclusive");
+ AcpiRsOutString ("Read/Write Attribute",
+ ACPI_READ_WRITE_MEMORY == ReadWriteAttribute ?
+ "Read/Write" : "Read-Only");
+}
- AcpiOsPrintf (" %X Interrupts ( ", IrqData->NumberOfInterrupts);
- for (Index = 0; Index < IrqData->NumberOfInterrupts; Index++)
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiRsDumpResourceSource
+ *
+ * PARAMETERS: ResourceSource - Pointer to a Resource Source struct
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Common routine for dumping the optional ResourceSource and the
+ * corresponding ResourceSourceIndex.
+ *
+ ******************************************************************************/
+
+static void
+AcpiRsDumpResourceSource (
+ ACPI_RESOURCE_SOURCE *ResourceSource)
+{
+ ACPI_FUNCTION_ENTRY ();
+
+
+ if (ResourceSource->Index == 0xFF)
{
- AcpiOsPrintf ("%X ", IrqData->Interrupts[Index]);
+ return;
}
- AcpiOsPrintf (")\n");
- return;
+ AcpiRsOutInteger8 ("Resource Source Index",
+ (UINT8) ResourceSource->Index);
+
+ AcpiRsOutString ("Resource Source",
+ ResourceSource->StringPtr ?
+ ResourceSource->StringPtr : "[Not Specified]");
}
/*******************************************************************************
*
- * FUNCTION: AcpiRsDumpDma
+ * FUNCTION: AcpiRsDumpAddressCommon
*
- * PARAMETERS: Data - pointer to the resource structure to dump.
+ * PARAMETERS: Resource - Pointer to an internal resource descriptor
*
* RETURN: None
*
- * DESCRIPTION: Prints out the various members of the Data structure type.
+ * DESCRIPTION: Dump the fields that are common to all Address resource
+ * descriptors
*
******************************************************************************/
static void
-AcpiRsDumpDma (
- ACPI_RESOURCE_DATA *Data)
+AcpiRsDumpAddressCommon (
+ ACPI_RESOURCE_DATA *Resource)
+{
+ ACPI_FUNCTION_ENTRY ();
+
+
+ /* Decode the type-specific flags */
+
+ switch (Resource->Address.ResourceType)
+ {
+ case ACPI_MEMORY_RANGE:
+
+ AcpiRsOutString ("Resource Type", "Memory Range");
+
+ AcpiRsOutTitle ("Type-Specific Flags");
+
+ switch (Resource->Address.Attribute.Memory.CacheAttribute)
+ {
+ case ACPI_NON_CACHEABLE_MEMORY:
+ AcpiOsPrintf ("Noncacheable memory\n");
+ break;
+
+ case ACPI_CACHABLE_MEMORY:
+ AcpiOsPrintf ("Cacheable memory\n");
+ break;
+
+ case ACPI_WRITE_COMBINING_MEMORY:
+ AcpiOsPrintf ("Write-combining memory\n");
+ break;
+
+ case ACPI_PREFETCHABLE_MEMORY:
+ AcpiOsPrintf ("Prefetchable memory\n");
+ break;
+
+ default:
+ AcpiOsPrintf ("Invalid cache attribute\n");
+ break;
+ }
+
+ AcpiRsDumpMemoryAttribute (
+ Resource->Address.Attribute.Memory.ReadWriteAttribute);
+ break;
+
+ case ACPI_IO_RANGE:
+
+ AcpiRsOutString ("Resource Type", "I/O Range");
+
+ AcpiRsOutTitle ("Type-Specific Flags");
+
+ switch (Resource->Address.Attribute.Io.RangeAttribute)
+ {
+ case ACPI_NON_ISA_ONLY_RANGES:
+ AcpiOsPrintf ("Non-ISA I/O Addresses\n");
+ break;
+
+ case ACPI_ISA_ONLY_RANGES:
+ AcpiOsPrintf ("ISA I/O Addresses\n");
+ break;
+
+ case ACPI_ENTIRE_RANGE:
+ AcpiOsPrintf ("ISA and non-ISA I/O Addresses\n");
+ break;
+
+ default:
+ AcpiOsPrintf ("Invalid range attribute\n");
+ break;
+ }
+
+ AcpiRsOutString ("Translation Attribute",
+ ACPI_SPARSE_TRANSLATION ==
+ Resource->Address.Attribute.Io.TranslationAttribute ?
+ "Sparse Translation" : "Dense Translation");
+ break;
+
+ case ACPI_BUS_NUMBER_RANGE:
+
+ AcpiRsOutString ("Resource Type", "Bus Number Range");
+ break;
+
+ default:
+
+ AcpiRsOutInteger8 ("Resource Type",
+ (UINT8) Resource->Address.ResourceType);
+ break;
+ }
+
+ /* Decode the general flags */
+
+ AcpiRsOutString ("Resource",
+ ACPI_CONSUMER == Resource->Address.ProducerConsumer ?
+ "Consumer" : "Producer");
+
+ AcpiRsOutString ("Decode",
+ ACPI_SUB_DECODE == Resource->Address.Decode ?
+ "Subtractive" : "Positive");
+
+ AcpiRsOutString ("Min Address",
+ ACPI_ADDRESS_FIXED == Resource->Address.MinAddressFixed ?
+ "Fixed" : "Not Fixed");
+
+ AcpiRsOutString ("Max Address",
+ ACPI_ADDRESS_FIXED == Resource->Address.MaxAddressFixed ?
+ "Fixed" : "Not Fixed");
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiRsDumpResourceList
+ *
+ * PARAMETERS: ResourceList - Pointer to a resource descriptor list
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Dispatches the structure to the correct dump routine.
+ *
+ ******************************************************************************/
+
+void
+AcpiRsDumpResourceList (
+ ACPI_RESOURCE *ResourceList)
{
- ACPI_RESOURCE_DMA *DmaData = (ACPI_RESOURCE_DMA *) Data;
- UINT8 Index = 0;
+ UINT32 Count = 0;
ACPI_FUNCTION_ENTRY ();
+ if (!(AcpiDbgLevel & ACPI_LV_RESOURCES) || !( _COMPONENT & AcpiDbgLayer))
+ {
+ return;
+ }
+
+ /* Dump all resource descriptors in the list */
+
+ while (ResourceList)
+ {
+ AcpiOsPrintf ("\n[%02X] ", Count);
+
+ /* Validate Type before dispatch */
+
+ if (ResourceList->Type > ACPI_RESOURCE_TYPE_MAX)
+ {
+ AcpiOsPrintf (
+ "Invalid descriptor type (%X) in resource list\n",
+ ResourceList->Type);
+ return;
+ }
+
+ /* Dump the resource descriptor */
+
+ AcpiGbl_DumpResourceDispatch[ResourceList->Type] (&ResourceList->Data);
+
+ /* Exit on end tag */
+
+ if (ResourceList->Type == ACPI_RESOURCE_TYPE_END_TAG)
+ {
+ return;
+ }
+
+ /* Get the next resource structure */
+
+ ResourceList = ACPI_PTR_ADD (ACPI_RESOURCE, ResourceList,
+ ResourceList->Length);
+ Count++;
+ }
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiRsDumpIrq
+ *
+ * PARAMETERS: Resource - Pointer to an internal resource descriptor
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Dump the field names and values of the resource descriptor
+ *
+ ******************************************************************************/
+
+void
+AcpiRsDumpIrq (
+ ACPI_RESOURCE_DATA *Resource)
+{
+ ACPI_FUNCTION_ENTRY ();
+
+
+ AcpiOsPrintf ("IRQ Resource\n");
+
+ AcpiRsOutString ("Triggering",
+ ACPI_LEVEL_SENSITIVE == Resource->Irq.Triggering ? "Level" : "Edge");
+
+ AcpiRsOutString ("Active",
+ ACPI_ACTIVE_LOW == Resource->Irq.Polarity ? "Low" : "High");
+
+ AcpiRsOutString ("Sharing",
+ ACPI_SHARED == Resource->Irq.Sharable ? "Shared" : "Exclusive");
+
+ AcpiRsOutInteger8 ("Interrupt Count",
+ (UINT8) Resource->Irq.InterruptCount);
+
+ AcpiRsOutTitle ("Interrupt List");
+ AcpiRsDumpShortByteList (Resource->Irq.InterruptCount,
+ Resource->Irq.Interrupts);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiRsDumpDma
+ *
+ * PARAMETERS: Resource - Pointer to an internal resource descriptor
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Dump the field names and values of the resource descriptor
+ *
+ ******************************************************************************/
+
+void
+AcpiRsDumpDma (
+ ACPI_RESOURCE_DATA *Resource)
+{
+ ACPI_FUNCTION_ENTRY ();
+
+
AcpiOsPrintf ("DMA Resource\n");
- switch (DmaData->Type)
+ AcpiRsOutTitle ("DMA Type");
+ switch (Resource->Dma.Type)
{
case ACPI_COMPATIBILITY:
- AcpiOsPrintf (" Compatibility mode\n");
+ AcpiOsPrintf ("Compatibility mode\n");
break;
case ACPI_TYPE_A:
- AcpiOsPrintf (" Type A\n");
+ AcpiOsPrintf ("Type A\n");
break;
case ACPI_TYPE_B:
- AcpiOsPrintf (" Type B\n");
+ AcpiOsPrintf ("Type B\n");
break;
case ACPI_TYPE_F:
- AcpiOsPrintf (" Type F\n");
+ AcpiOsPrintf ("Type F\n");
break;
default:
- AcpiOsPrintf (" Invalid DMA type\n");
+ AcpiOsPrintf ("**** Invalid DMA type\n");
break;
}
- AcpiOsPrintf (" %sBus Master\n",
- ACPI_BUS_MASTER == DmaData->BusMaster ? "" : "Not a ");
-
+ AcpiRsOutString ("Bus Master",
+ ACPI_BUS_MASTER == Resource->Dma.BusMaster ? "Yes" : "No");
- switch (DmaData->Transfer)
+ AcpiRsOutTitle ("Transfer Type");
+ switch (Resource->Dma.Transfer)
{
case ACPI_TRANSFER_8:
- AcpiOsPrintf (" 8-bit only transfer\n");
+ AcpiOsPrintf ("8-bit transfers only\n");
break;
case ACPI_TRANSFER_8_16:
- AcpiOsPrintf (" 8 and 16-bit transfer\n");
+ AcpiOsPrintf ("8-bit and 16-bit transfers\n");
break;
case ACPI_TRANSFER_16:
- AcpiOsPrintf (" 16 bit only transfer\n");
+ AcpiOsPrintf ("16-bit transfers only\n");
break;
default:
- AcpiOsPrintf (" Invalid transfer preference\n");
+ AcpiOsPrintf ("**** Invalid transfer preference\n");
break;
}
- AcpiOsPrintf (" Number of Channels: %X ( ",
- DmaData->NumberOfChannels);
-
- for (Index = 0; Index < DmaData->NumberOfChannels; Index++)
- {
- AcpiOsPrintf ("%X ", DmaData->Channels[Index]);
- }
+ AcpiRsOutInteger8 ("DMA Channel Count",
+ (UINT8) Resource->Dma.ChannelCount);
- AcpiOsPrintf (")\n");
- return;
+ AcpiRsOutTitle ("Channel List");
+ AcpiRsDumpShortByteList (Resource->Dma.ChannelCount,
+ Resource->Dma.Channels);
}
/*******************************************************************************
*
- * FUNCTION: AcpiRsDumpStartDependFns
+ * FUNCTION: AcpiRsDumpStartDpf
*
- * PARAMETERS: Data - pointer to the resource structure to dump.
+ * PARAMETERS: Resource - Pointer to an internal resource descriptor
*
* RETURN: None
*
- * DESCRIPTION: Prints out the various members of the Data structure type.
+ * DESCRIPTION: Dump the field names and values of the resource descriptor
*
******************************************************************************/
-static void
-AcpiRsDumpStartDependFns (
- ACPI_RESOURCE_DATA *Data)
+void
+AcpiRsDumpStartDpf (
+ ACPI_RESOURCE_DATA *Resource)
{
- ACPI_RESOURCE_START_DPF *SdfData = (ACPI_RESOURCE_START_DPF *) Data;
-
-
ACPI_FUNCTION_ENTRY ();
AcpiOsPrintf ("Start Dependent Functions Resource\n");
- switch (SdfData->CompatibilityPriority)
+ AcpiRsOutTitle ("Compatibility Priority");
+ switch (Resource->StartDpf.CompatibilityPriority)
{
case ACPI_GOOD_CONFIGURATION:
- AcpiOsPrintf (" Good configuration\n");
+ AcpiOsPrintf ("Good configuration\n");
break;
case ACPI_ACCEPTABLE_CONFIGURATION:
- AcpiOsPrintf (" Acceptable configuration\n");
+ AcpiOsPrintf ("Acceptable configuration\n");
break;
case ACPI_SUB_OPTIMAL_CONFIGURATION:
- AcpiOsPrintf (" Sub-optimal configuration\n");
+ AcpiOsPrintf ("Sub-optimal configuration\n");
break;
default:
- AcpiOsPrintf (" Invalid compatibility priority\n");
+ AcpiOsPrintf ("**** Invalid compatibility priority\n");
break;
}
- switch(SdfData->PerformanceRobustness)
+ AcpiRsOutTitle ("Performance/Robustness");
+ switch (Resource->StartDpf.PerformanceRobustness)
{
case ACPI_GOOD_CONFIGURATION:
- AcpiOsPrintf (" Good configuration\n");
+ AcpiOsPrintf ("Good configuration\n");
break;
case ACPI_ACCEPTABLE_CONFIGURATION:
- AcpiOsPrintf (" Acceptable configuration\n");
+ AcpiOsPrintf ("Acceptable configuration\n");
break;
case ACPI_SUB_OPTIMAL_CONFIGURATION:
- AcpiOsPrintf (" Sub-optimal configuration\n");
+ AcpiOsPrintf ("Sub-optimal configuration\n");
break;
default:
- AcpiOsPrintf (" Invalid performance robustness preference\n");
+ AcpiOsPrintf ("**** Invalid performance robustness preference\n");
break;
}
-
- return;
}
@@ -381,38 +713,37 @@ AcpiRsDumpStartDependFns (
*
* FUNCTION: AcpiRsDumpIo
*
- * PARAMETERS: Data - pointer to the resource structure to dump.
+ * PARAMETERS: Resource - Pointer to an internal resource descriptor
*
* RETURN: None
*
- * DESCRIPTION: Prints out the various members of the Data structure type.
+ * DESCRIPTION: Dump the field names and values of the resource descriptor
*
******************************************************************************/
-static void
+void
AcpiRsDumpIo (
- ACPI_RESOURCE_DATA *Data)
+ ACPI_RESOURCE_DATA *Resource)
{
- ACPI_RESOURCE_IO *IoData = (ACPI_RESOURCE_IO *) Data;
-
-
ACPI_FUNCTION_ENTRY ();
- AcpiOsPrintf ("Io Resource\n");
+ AcpiOsPrintf ("I/O Resource\n");
- AcpiOsPrintf (" %d bit decode\n",
- ACPI_DECODE_16 == IoData->IoDecode ? 16 : 10);
+ AcpiRsOutString ("Decode",
+ ACPI_DECODE_16 == Resource->Io.IoDecode ? "16-bit" : "10-bit");
- AcpiOsPrintf (" Range minimum base: %08X\n", IoData->MinBaseAddress);
+ AcpiRsOutInteger32 ("Address Minimum",
+ Resource->Io.Minimum);
- AcpiOsPrintf (" Range maximum base: %08X\n", IoData->MaxBaseAddress);
+ AcpiRsOutInteger32 ("Address Maximum",
+ Resource->Io.Maximum);
- AcpiOsPrintf (" Alignment: %08X\n", IoData->Alignment);
+ AcpiRsOutInteger32 ("Alignment",
+ Resource->Io.Alignment);
- AcpiOsPrintf (" Range Length: %08X\n", IoData->RangeLength);
-
- return;
+ AcpiRsOutInteger32 ("Address Length",
+ Resource->Io.AddressLength);
}
@@ -420,67 +751,57 @@ AcpiRsDumpIo (
*
* FUNCTION: AcpiRsDumpFixedIo
*
- * PARAMETERS: Data - pointer to the resource structure to dump.
+ * PARAMETERS: Resource - Pointer to an internal resource descriptor
*
* RETURN: None
*
- * DESCRIPTION: Prints out the various members of the Data structure type.
+ * DESCRIPTION: Dump the field names and values of the resource descriptor
*
******************************************************************************/
-static void
+void
AcpiRsDumpFixedIo (
- ACPI_RESOURCE_DATA *Data)
+ ACPI_RESOURCE_DATA *Resource)
{
- ACPI_RESOURCE_FIXED_IO *FixedIoData = (ACPI_RESOURCE_FIXED_IO *) Data;
-
-
ACPI_FUNCTION_ENTRY ();
- AcpiOsPrintf ("Fixed Io Resource\n");
- AcpiOsPrintf (" Range base address: %08X", FixedIoData->BaseAddress);
+ AcpiOsPrintf ("Fixed I/O Resource\n");
- AcpiOsPrintf (" Range length: %08X", FixedIoData->RangeLength);
+ AcpiRsOutInteger32 ("Address",
+ Resource->FixedIo.Address);
- return;
+ AcpiRsOutInteger32 ("Address Length",
+ Resource->FixedIo.AddressLength);
}
/*******************************************************************************
*
- * FUNCTION: AcpiRsDumpVendorSpecific
+ * FUNCTION: AcpiRsDumpVendor
*
- * PARAMETERS: Data - pointer to the resource structure to dump.
+ * PARAMETERS: Resource - Pointer to an internal resource descriptor
*
* RETURN: None
*
- * DESCRIPTION: Prints out the various members of the Data structure type.
+ * DESCRIPTION: Dump the field names and values of the resource descriptor
*
******************************************************************************/
-static void
-AcpiRsDumpVendorSpecific (
- ACPI_RESOURCE_DATA *Data)
+void
+AcpiRsDumpVendor (
+ ACPI_RESOURCE_DATA *Resource)
{
- ACPI_RESOURCE_VENDOR *VendorData = (ACPI_RESOURCE_VENDOR *) Data;
- UINT16 Index = 0;
-
-
ACPI_FUNCTION_ENTRY ();
AcpiOsPrintf ("Vendor Specific Resource\n");
- AcpiOsPrintf (" Length: %08X\n", VendorData->Length);
-
- for (Index = 0; Index < VendorData->Length; Index++)
- {
- AcpiOsPrintf (" Byte %X: %08X\n",
- Index, VendorData->Reserved[Index]);
- }
+ AcpiRsOutInteger16 ("Length",
+ (UINT16) Resource->Vendor.ByteLength);
- return;
+ AcpiRsDumpByteList (Resource->Vendor.ByteLength,
+ Resource->Vendor.ByteData);
}
@@ -488,42 +809,37 @@ AcpiRsDumpVendorSpecific (
*
* FUNCTION: AcpiRsDumpMemory24
*
- * PARAMETERS: Data - pointer to the resource structure to dump.
+ * PARAMETERS: Resource - Pointer to an internal resource descriptor
*
* RETURN: None
*
- * DESCRIPTION: Prints out the various members of the Data structure type.
+ * DESCRIPTION: Dump the field names and values of the resource descriptor
*
******************************************************************************/
-static void
+void
AcpiRsDumpMemory24 (
- ACPI_RESOURCE_DATA *Data)
+ ACPI_RESOURCE_DATA *Resource)
{
- ACPI_RESOURCE_MEM24 *Memory24Data = (ACPI_RESOURCE_MEM24 *) Data;
-
-
ACPI_FUNCTION_ENTRY ();
AcpiOsPrintf ("24-Bit Memory Range Resource\n");
- AcpiOsPrintf (" Read%s\n",
- ACPI_READ_WRITE_MEMORY ==
- Memory24Data->ReadWriteAttribute ?
- "/Write" : " only");
+ AcpiRsDumpMemoryAttribute (
+ Resource->Memory24.ReadWriteAttribute);
- AcpiOsPrintf (" Range minimum base: %08X\n",
- Memory24Data->MinBaseAddress);
+ AcpiRsOutInteger16 ("Address Minimum",
+ (UINT16) Resource->Memory24.Minimum);
- AcpiOsPrintf (" Range maximum base: %08X\n",
- Memory24Data->MaxBaseAddress);
+ AcpiRsOutInteger16 ("Address Maximum",
+ (UINT16) Resource->Memory24.Maximum);
- AcpiOsPrintf (" Alignment: %08X\n", Memory24Data->Alignment);
+ AcpiRsOutInteger16 ("Alignment",
+ (UINT16) Resource->Memory24.Alignment);
- AcpiOsPrintf (" Range length: %08X\n", Memory24Data->RangeLength);
-
- return;
+ AcpiRsOutInteger16 ("Address Length",
+ (UINT16) Resource->Memory24.AddressLength);
}
@@ -531,42 +847,37 @@ AcpiRsDumpMemory24 (
*
* FUNCTION: AcpiRsDumpMemory32
*
- * PARAMETERS: Data - pointer to the resource structure to dump.
+ * PARAMETERS: Resource - Pointer to an internal resource descriptor
*
* RETURN: None
*
- * DESCRIPTION: Prints out the various members of the Data structure type.
+ * DESCRIPTION: Dump the field names and values of the resource descriptor
*
******************************************************************************/
-static void
+void
AcpiRsDumpMemory32 (
- ACPI_RESOURCE_DATA *Data)
+ ACPI_RESOURCE_DATA *Resource)
{
- ACPI_RESOURCE_MEM32 *Memory32Data = (ACPI_RESOURCE_MEM32 *) Data;
-
-
ACPI_FUNCTION_ENTRY ();
AcpiOsPrintf ("32-Bit Memory Range Resource\n");
- AcpiOsPrintf (" Read%s\n",
- ACPI_READ_WRITE_MEMORY ==
- Memory32Data->ReadWriteAttribute ?
- "/Write" : " only");
-
- AcpiOsPrintf (" Range minimum base: %08X\n",
- Memory32Data->MinBaseAddress);
+ AcpiRsDumpMemoryAttribute (
+ Resource->Memory32.ReadWriteAttribute);
- AcpiOsPrintf (" Range maximum base: %08X\n",
- Memory32Data->MaxBaseAddress);
+ AcpiRsOutInteger32 ("Address Minimum",
+ Resource->Memory32.Minimum);
- AcpiOsPrintf (" Alignment: %08X\n", Memory32Data->Alignment);
+ AcpiRsOutInteger32 ("Address Maximum",
+ Resource->Memory32.Maximum);
- AcpiOsPrintf (" Range length: %08X\n", Memory32Data->RangeLength);
+ AcpiRsOutInteger32 ("Alignment",
+ Resource->Memory32.Alignment);
- return;
+ AcpiRsOutInteger32 ("Address Length",
+ Resource->Memory32.AddressLength);
}
@@ -574,38 +885,31 @@ AcpiRsDumpMemory32 (
*
* FUNCTION: AcpiRsDumpFixedMemory32
*
- * PARAMETERS: Data - pointer to the resource structure to dump.
+ * PARAMETERS: Resource - Pointer to an internal resource descriptor
*
* RETURN:
*
- * DESCRIPTION: Prints out the various members of the Data structure type.
+ * DESCRIPTION: Dump the field names and values of the resource descriptor
*
******************************************************************************/
-static void
+void
AcpiRsDumpFixedMemory32 (
- ACPI_RESOURCE_DATA *Data)
+ ACPI_RESOURCE_DATA *Resource)
{
- ACPI_RESOURCE_FIXED_MEM32 *FixedMemory32Data =
- (ACPI_RESOURCE_FIXED_MEM32 *) Data;
-
-
ACPI_FUNCTION_ENTRY ();
AcpiOsPrintf ("32-Bit Fixed Location Memory Range Resource\n");
- AcpiOsPrintf (" Read%s\n",
- ACPI_READ_WRITE_MEMORY ==
- FixedMemory32Data->ReadWriteAttribute ? "/Write" : " Only");
-
- AcpiOsPrintf (" Range base address: %08X\n",
- FixedMemory32Data->RangeBaseAddress);
+ AcpiRsDumpMemoryAttribute (
+ Resource->FixedMemory32.ReadWriteAttribute);
- AcpiOsPrintf (" Range length: %08X\n",
- FixedMemory32Data->RangeLength);
+ AcpiRsOutInteger32 ("Address",
+ Resource->FixedMemory32.Address);
- return;
+ AcpiRsOutInteger32 ("Address Length",
+ Resource->FixedMemory32.AddressLength);
}
@@ -613,143 +917,41 @@ AcpiRsDumpFixedMemory32 (
*
* FUNCTION: AcpiRsDumpAddress16
*
- * PARAMETERS: Data - pointer to the resource structure to dump.
+ * PARAMETERS: Resource - Pointer to an internal resource descriptor
*
* RETURN: None
*
- * DESCRIPTION: Prints out the various members of the Data structure type.
+ * DESCRIPTION: Dump the field names and values of the resource descriptor
*
******************************************************************************/
-static void
+void
AcpiRsDumpAddress16 (
- ACPI_RESOURCE_DATA *Data)
+ ACPI_RESOURCE_DATA *Resource)
{
- ACPI_RESOURCE_ADDRESS16 *Address16Data = (ACPI_RESOURCE_ADDRESS16 *) Data;
-
-
ACPI_FUNCTION_ENTRY ();
- AcpiOsPrintf ("16-Bit Address Space Resource\n");
- AcpiOsPrintf (" Resource Type: ");
-
- switch (Address16Data->ResourceType)
- {
- case ACPI_MEMORY_RANGE:
-
- AcpiOsPrintf ("Memory Range\n");
-
- switch (Address16Data->Attribute.Memory.CacheAttribute)
- {
- case ACPI_NON_CACHEABLE_MEMORY:
- AcpiOsPrintf (" Type Specific: Noncacheable memory\n");
- break;
-
- case ACPI_CACHABLE_MEMORY:
- AcpiOsPrintf (" Type Specific: Cacheable memory\n");
- break;
-
- case ACPI_WRITE_COMBINING_MEMORY:
- AcpiOsPrintf (" Type Specific: Write-combining memory\n");
- break;
-
- case ACPI_PREFETCHABLE_MEMORY:
- AcpiOsPrintf (" Type Specific: Prefetchable memory\n");
- break;
-
- default:
- AcpiOsPrintf (" Type Specific: Invalid cache attribute\n");
- break;
- }
-
- AcpiOsPrintf (" Type Specific: Read%s\n",
- ACPI_READ_WRITE_MEMORY ==
- Address16Data->Attribute.Memory.ReadWriteAttribute ?
- "/Write" : " Only");
- break;
-
- case ACPI_IO_RANGE:
-
- AcpiOsPrintf ("I/O Range\n");
-
- switch (Address16Data->Attribute.Io.RangeAttribute)
- {
- case ACPI_NON_ISA_ONLY_RANGES:
- AcpiOsPrintf (" Type Specific: Non-ISA Io Addresses\n");
- break;
-
- case ACPI_ISA_ONLY_RANGES:
- AcpiOsPrintf (" Type Specific: ISA Io Addresses\n");
- break;
-
- case ACPI_ENTIRE_RANGE:
- AcpiOsPrintf (" Type Specific: ISA and non-ISA Io Addresses\n");
- break;
-
- default:
- AcpiOsPrintf (" Type Specific: Invalid range attribute\n");
- break;
- }
-
- AcpiOsPrintf (" Type Specific: %s Translation\n",
- ACPI_SPARSE_TRANSLATION ==
- Address16Data->Attribute.Io.TranslationAttribute ?
- "Sparse" : "Dense");
- break;
-
- case ACPI_BUS_NUMBER_RANGE:
-
- AcpiOsPrintf ("Bus Number Range\n");
- break;
-
- default:
-
- AcpiOsPrintf ("0x%2.2X\n", Address16Data->ResourceType);
- break;
- }
-
- AcpiOsPrintf (" Resource %s\n",
- ACPI_CONSUMER == Address16Data->ProducerConsumer ?
- "Consumer" : "Producer");
-
- AcpiOsPrintf (" %s decode\n",
- ACPI_SUB_DECODE == Address16Data->Decode ?
- "Subtractive" : "Positive");
+ AcpiOsPrintf ("16-Bit WORD Address Space Resource\n");
- AcpiOsPrintf (" Min address is %s fixed\n",
- ACPI_ADDRESS_FIXED == Address16Data->MinAddressFixed ?
- "" : "not");
+ AcpiRsDumpAddressCommon (Resource);
- AcpiOsPrintf (" Max address is %s fixed\n",
- ACPI_ADDRESS_FIXED == Address16Data->MaxAddressFixed ?
- "" : "not");
+ AcpiRsOutInteger16 ("Granularity",
+ (UINT16) Resource->Address16.Granularity);
- AcpiOsPrintf (" Granularity: %08X\n",
- Address16Data->Granularity);
+ AcpiRsOutInteger16 ("Address Minimum",
+ (UINT16) Resource->Address16.Minimum);
- AcpiOsPrintf (" Address range min: %08X\n",
- Address16Data->MinAddressRange);
+ AcpiRsOutInteger16 ("Address Maximum",
+ (UINT16) Resource->Address16.Maximum);
- AcpiOsPrintf (" Address range max: %08X\n",
- Address16Data->MaxAddressRange);
+ AcpiRsOutInteger16 ("Translation Offset",
+ (UINT16) Resource->Address16.TranslationOffset);
- AcpiOsPrintf (" Address translation offset: %08X\n",
- Address16Data->AddressTranslationOffset);
+ AcpiRsOutInteger16 ("Address Length",
+ (UINT16) Resource->Address16.AddressLength);
- AcpiOsPrintf (" Address Length: %08X\n",
- Address16Data->AddressLength);
-
- if (0xFF != Address16Data->ResourceSource.Index)
- {
- AcpiOsPrintf (" Resource Source Index: %X\n",
- Address16Data->ResourceSource.Index);
-
- AcpiOsPrintf (" Resource Source: %s\n",
- Address16Data->ResourceSource.StringPtr);
- }
-
- return;
+ AcpiRsDumpResourceSource (&Resource->Address16.ResourceSource);
}
@@ -757,143 +959,41 @@ AcpiRsDumpAddress16 (
*
* FUNCTION: AcpiRsDumpAddress32
*
- * PARAMETERS: Data - pointer to the resource structure to dump.
+ * PARAMETERS: Resource - Pointer to an internal resource descriptor
*
* RETURN: None
*
- * DESCRIPTION: Prints out the various members of the Data structure type.
+ * DESCRIPTION: Dump the field names and values of the resource descriptor
*
******************************************************************************/
-static void
+void
AcpiRsDumpAddress32 (
- ACPI_RESOURCE_DATA *Data)
+ ACPI_RESOURCE_DATA *Resource)
{
- ACPI_RESOURCE_ADDRESS32 *Address32Data = (ACPI_RESOURCE_ADDRESS32 *) Data;
-
-
ACPI_FUNCTION_ENTRY ();
- AcpiOsPrintf ("32-Bit Address Space Resource\n");
-
- switch (Address32Data->ResourceType)
- {
- case ACPI_MEMORY_RANGE:
-
- AcpiOsPrintf (" Resource Type: Memory Range\n");
-
- switch (Address32Data->Attribute.Memory.CacheAttribute)
- {
- case ACPI_NON_CACHEABLE_MEMORY:
- AcpiOsPrintf (" Type Specific: Noncacheable memory\n");
- break;
-
- case ACPI_CACHABLE_MEMORY:
- AcpiOsPrintf (" Type Specific: Cacheable memory\n");
- break;
-
- case ACPI_WRITE_COMBINING_MEMORY:
- AcpiOsPrintf (" Type Specific: Write-combining memory\n");
- break;
-
- case ACPI_PREFETCHABLE_MEMORY:
- AcpiOsPrintf (" Type Specific: Prefetchable memory\n");
- break;
-
- default:
- AcpiOsPrintf (" Type Specific: Invalid cache attribute\n");
- break;
- }
-
- AcpiOsPrintf (" Type Specific: Read%s\n",
- ACPI_READ_WRITE_MEMORY ==
- Address32Data->Attribute.Memory.ReadWriteAttribute ?
- "/Write" : " Only");
- break;
-
- case ACPI_IO_RANGE:
-
- AcpiOsPrintf (" Resource Type: Io Range\n");
-
- switch (Address32Data->Attribute.Io.RangeAttribute)
- {
- case ACPI_NON_ISA_ONLY_RANGES:
- AcpiOsPrintf (" Type Specific: Non-ISA Io Addresses\n");
- break;
-
- case ACPI_ISA_ONLY_RANGES:
- AcpiOsPrintf (" Type Specific: ISA Io Addresses\n");
- break;
-
- case ACPI_ENTIRE_RANGE:
- AcpiOsPrintf (" Type Specific: ISA and non-ISA Io Addresses\n");
- break;
-
- default:
- AcpiOsPrintf (" Type Specific: Invalid Range attribute");
- break;
- }
-
- AcpiOsPrintf (" Type Specific: %s Translation\n",
- ACPI_SPARSE_TRANSLATION ==
- Address32Data->Attribute.Io.TranslationAttribute ?
- "Sparse" : "Dense");
- break;
-
- case ACPI_BUS_NUMBER_RANGE:
-
- AcpiOsPrintf (" Resource Type: Bus Number Range\n");
- break;
-
- default:
-
- AcpiOsPrintf (" Resource Type: 0x%2.2X\n",
- Address32Data->ResourceType);
- break;
- }
-
- AcpiOsPrintf (" Resource %s\n",
- ACPI_CONSUMER == Address32Data->ProducerConsumer ?
- "Consumer" : "Producer");
+ AcpiOsPrintf ("32-Bit DWORD Address Space Resource\n");
- AcpiOsPrintf (" %s decode\n",
- ACPI_SUB_DECODE == Address32Data->Decode ?
- "Subtractive" : "Positive");
+ AcpiRsDumpAddressCommon (Resource);
- AcpiOsPrintf (" Min address is %s fixed\n",
- ACPI_ADDRESS_FIXED == Address32Data->MinAddressFixed ?
- "" : "not ");
+ AcpiRsOutInteger32 ("Granularity",
+ Resource->Address32.Granularity);
- AcpiOsPrintf (" Max address is %s fixed\n",
- ACPI_ADDRESS_FIXED == Address32Data->MaxAddressFixed ?
- "" : "not ");
+ AcpiRsOutInteger32 ("Address Minimum",
+ Resource->Address32.Minimum);
- AcpiOsPrintf (" Granularity: %08X\n",
- Address32Data->Granularity);
+ AcpiRsOutInteger32 ("Address Maximum",
+ Resource->Address32.Maximum);
- AcpiOsPrintf (" Address range min: %08X\n",
- Address32Data->MinAddressRange);
+ AcpiRsOutInteger32 ("Translation Offset",
+ Resource->Address32.TranslationOffset);
- AcpiOsPrintf (" Address range max: %08X\n",
- Address32Data->MaxAddressRange);
+ AcpiRsOutInteger32 ("Address Length",
+ Resource->Address32.AddressLength);
- AcpiOsPrintf (" Address translation offset: %08X\n",
- Address32Data->AddressTranslationOffset);
-
- AcpiOsPrintf (" Address Length: %08X\n",
- Address32Data->AddressLength);
-
- if(0xFF != Address32Data->ResourceSource.Index)
- {
- AcpiOsPrintf (" Resource Source Index: %X\n",
- Address32Data->ResourceSource.Index);
-
- AcpiOsPrintf (" Resource Source: %s\n",
- Address32Data->ResourceSource.StringPtr);
- }
-
- return;
+ AcpiRsDumpResourceSource (&Resource->Address32.ResourceSource);
}
@@ -901,328 +1001,227 @@ AcpiRsDumpAddress32 (
*
* FUNCTION: AcpiRsDumpAddress64
*
- * PARAMETERS: Data - pointer to the resource structure to dump.
+ * PARAMETERS: Resource - Pointer to an internal resource descriptor
*
* RETURN: None
*
- * DESCRIPTION: Prints out the various members of the Data structure type.
+ * DESCRIPTION: Dump the field names and values of the resource descriptor
*
******************************************************************************/
-static void
+void
AcpiRsDumpAddress64 (
- ACPI_RESOURCE_DATA *Data)
+ ACPI_RESOURCE_DATA *Resource)
{
- ACPI_RESOURCE_ADDRESS64 *Address64Data = (ACPI_RESOURCE_ADDRESS64 *) Data;
-
-
ACPI_FUNCTION_ENTRY ();
- AcpiOsPrintf ("64-Bit Address Space Resource\n");
-
- switch (Address64Data->ResourceType)
- {
- case ACPI_MEMORY_RANGE:
-
- AcpiOsPrintf (" Resource Type: Memory Range\n");
-
- switch (Address64Data->Attribute.Memory.CacheAttribute)
- {
- case ACPI_NON_CACHEABLE_MEMORY:
- AcpiOsPrintf (" Type Specific: Noncacheable memory\n");
- break;
-
- case ACPI_CACHABLE_MEMORY:
- AcpiOsPrintf (" Type Specific: Cacheable memory\n");
- break;
-
- case ACPI_WRITE_COMBINING_MEMORY:
- AcpiOsPrintf (" Type Specific: Write-combining memory\n");
- break;
-
- case ACPI_PREFETCHABLE_MEMORY:
- AcpiOsPrintf (" Type Specific: Prefetchable memory\n");
- break;
-
- default:
- AcpiOsPrintf (" Type Specific: Invalid cache attribute\n");
- break;
- }
-
- AcpiOsPrintf (" Type Specific: Read%s\n",
- ACPI_READ_WRITE_MEMORY ==
- Address64Data->Attribute.Memory.ReadWriteAttribute ?
- "/Write" : " Only");
- break;
-
- case ACPI_IO_RANGE:
-
- AcpiOsPrintf (" Resource Type: Io Range\n");
-
- switch (Address64Data->Attribute.Io.RangeAttribute)
- {
- case ACPI_NON_ISA_ONLY_RANGES:
- AcpiOsPrintf (" Type Specific: Non-ISA Io Addresses\n");
- break;
-
- case ACPI_ISA_ONLY_RANGES:
- AcpiOsPrintf (" Type Specific: ISA Io Addresses\n");
- break;
-
- case ACPI_ENTIRE_RANGE:
- AcpiOsPrintf (" Type Specific: ISA and non-ISA Io Addresses\n");
- break;
+ AcpiOsPrintf ("64-Bit QWORD Address Space Resource\n");
- default:
- AcpiOsPrintf (" Type Specific: Invalid Range attribute");
- break;
- }
+ AcpiRsDumpAddressCommon (Resource);
- AcpiOsPrintf (" Type Specific: %s Translation\n",
- ACPI_SPARSE_TRANSLATION ==
- Address64Data->Attribute.Io.TranslationAttribute ?
- "Sparse" : "Dense");
- break;
+ AcpiRsOutInteger64 ("Granularity",
+ Resource->Address64.Granularity);
- case ACPI_BUS_NUMBER_RANGE:
+ AcpiRsOutInteger64 ("Address Minimum",
+ Resource->Address64.Minimum);
- AcpiOsPrintf (" Resource Type: Bus Number Range\n");
- break;
+ AcpiRsOutInteger64 ("Address Maximum",
+ Resource->Address64.Maximum);
- default:
+ AcpiRsOutInteger64 ("Translation Offset",
+ Resource->Address64.TranslationOffset);
- AcpiOsPrintf (" Resource Type: 0x%2.2X\n",
- Address64Data->ResourceType);
- break;
- }
+ AcpiRsOutInteger64 ("Address Length",
+ Resource->Address64.AddressLength);
- AcpiOsPrintf (" Resource %s\n",
- ACPI_CONSUMER == Address64Data->ProducerConsumer ?
- "Consumer" : "Producer");
+ AcpiRsDumpResourceSource (&Resource->Address64.ResourceSource);
+}
- AcpiOsPrintf (" %s decode\n",
- ACPI_SUB_DECODE == Address64Data->Decode ?
- "Subtractive" : "Positive");
- AcpiOsPrintf (" Min address is %s fixed\n",
- ACPI_ADDRESS_FIXED == Address64Data->MinAddressFixed ?
- "" : "not ");
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiRsDumpExtAddress64
+ *
+ * PARAMETERS: Resource - Pointer to an internal resource descriptor
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Dump the field names and values of the resource descriptor
+ *
+ ******************************************************************************/
- AcpiOsPrintf (" Max address is %s fixed\n",
- ACPI_ADDRESS_FIXED == Address64Data->MaxAddressFixed ?
- "" : "not ");
+void
+AcpiRsDumpExtAddress64 (
+ ACPI_RESOURCE_DATA *Resource)
+{
+ ACPI_FUNCTION_ENTRY ();
- AcpiOsPrintf (" Granularity: %8.8X%8.8X\n",
- ACPI_FORMAT_UINT64 (Address64Data->Granularity));
- AcpiOsPrintf (" Address range min: %8.8X%8.8X\n",
- ACPI_FORMAT_UINT64 (Address64Data->MinAddressRange));
+ AcpiOsPrintf ("64-Bit Extended Address Space Resource\n");
- AcpiOsPrintf (" Address range max: %8.8X%8.8X\n",
- ACPI_FORMAT_UINT64 (Address64Data->MaxAddressRange));
+ AcpiRsDumpAddressCommon (Resource);
- AcpiOsPrintf (" Address translation offset: %8.8X%8.8X\n",
- ACPI_FORMAT_UINT64 (Address64Data->AddressTranslationOffset));
+ AcpiRsOutInteger64 ("Granularity",
+ Resource->ExtAddress64.Granularity);
- AcpiOsPrintf (" Address Length: %8.8X%8.8X\n",
- ACPI_FORMAT_UINT64 (Address64Data->AddressLength));
+ AcpiRsOutInteger64 ("Address Minimum",
+ Resource->ExtAddress64.Minimum);
- AcpiOsPrintf (" Type Specific Attributes: %8.8X%8.8X\n",
- ACPI_FORMAT_UINT64 (Address64Data->TypeSpecificAttributes));
+ AcpiRsOutInteger64 ("Address Maximum",
+ Resource->ExtAddress64.Maximum);
- if (0xFF != Address64Data->ResourceSource.Index)
- {
- AcpiOsPrintf (" Resource Source Index: %X\n",
- Address64Data->ResourceSource.Index);
+ AcpiRsOutInteger64 ("Translation Offset",
+ Resource->ExtAddress64.TranslationOffset);
- AcpiOsPrintf (" Resource Source: %s\n",
- Address64Data->ResourceSource.StringPtr);
- }
+ AcpiRsOutInteger64 ("Address Length",
+ Resource->ExtAddress64.AddressLength);
- return;
+ AcpiRsOutInteger64 ("Type-Specific Attribute",
+ Resource->ExtAddress64.TypeSpecificAttributes);
}
/*******************************************************************************
*
- * FUNCTION: AcpiRsDumpExtendedIrq
+ * FUNCTION: AcpiRsDumpExtIrq
*
- * PARAMETERS: Data - pointer to the resource structure to dump.
+ * PARAMETERS: Resource - Pointer to an internal resource descriptor
*
* RETURN: None
*
- * DESCRIPTION: Prints out the various members of the Data structure type.
+ * DESCRIPTION: Dump the field names and values of the resource descriptor
*
******************************************************************************/
-static void
-AcpiRsDumpExtendedIrq (
- ACPI_RESOURCE_DATA *Data)
+void
+AcpiRsDumpExtIrq (
+ ACPI_RESOURCE_DATA *Resource)
{
- ACPI_RESOURCE_EXT_IRQ *ExtIrqData = (ACPI_RESOURCE_EXT_IRQ *) Data;
- UINT8 Index = 0;
-
-
ACPI_FUNCTION_ENTRY ();
AcpiOsPrintf ("Extended IRQ Resource\n");
- AcpiOsPrintf (" Resource %s\n",
- ACPI_CONSUMER == ExtIrqData->ProducerConsumer ?
+ AcpiRsOutString ("Resource",
+ ACPI_CONSUMER == Resource->ExtendedIrq.ProducerConsumer ?
"Consumer" : "Producer");
- AcpiOsPrintf (" %s\n",
- ACPI_LEVEL_SENSITIVE == ExtIrqData->EdgeLevel ?
+ AcpiRsOutString ("Triggering",
+ ACPI_LEVEL_SENSITIVE == Resource->ExtendedIrq.Triggering ?
"Level" : "Edge");
- AcpiOsPrintf (" Active %s\n",
- ACPI_ACTIVE_LOW == ExtIrqData->ActiveHighLow ?
- "low" : "high");
+ AcpiRsOutString ("Active",
+ ACPI_ACTIVE_LOW == Resource->ExtendedIrq.Polarity ?
+ "Low" : "High");
- AcpiOsPrintf (" %s\n",
- ACPI_SHARED == ExtIrqData->SharedExclusive ?
+ AcpiRsOutString ("Sharing",
+ ACPI_SHARED == Resource->ExtendedIrq.Sharable ?
"Shared" : "Exclusive");
- AcpiOsPrintf (" Interrupts : %X ( ", ExtIrqData->NumberOfInterrupts);
-
- for (Index = 0; Index < ExtIrqData->NumberOfInterrupts; Index++)
- {
- AcpiOsPrintf ("%X ", ExtIrqData->Interrupts[Index]);
- }
-
- AcpiOsPrintf (")\n");
+ AcpiRsDumpResourceSource (&Resource->ExtendedIrq.ResourceSource);
- if(0xFF != ExtIrqData->ResourceSource.Index)
- {
- AcpiOsPrintf (" Resource Source Index: %X",
- ExtIrqData->ResourceSource.Index);
-
- AcpiOsPrintf (" Resource Source: %s",
- ExtIrqData->ResourceSource.StringPtr);
- }
+ AcpiRsOutInteger8 ("Interrupts",
+ (UINT8) Resource->ExtendedIrq.InterruptCount);
- return;
+ AcpiRsDumpDwordList (Resource->ExtendedIrq.InterruptCount,
+ Resource->ExtendedIrq.Interrupts);
}
/*******************************************************************************
*
- * FUNCTION: AcpiRsDumpResourceList
+ * FUNCTION: AcpiRsDumpGenericReg
*
- * PARAMETERS: Resource - pointer to the resource structure to dump.
+ * PARAMETERS: Resource - Pointer to an internal resource descriptor
*
* RETURN: None
*
- * DESCRIPTION: Dispatches the structure to the correct dump routine.
+ * DESCRIPTION: Dump the field names and values of the resource descriptor
*
******************************************************************************/
void
-AcpiRsDumpResourceList (
- ACPI_RESOURCE *Resource)
+AcpiRsDumpGenericReg (
+ ACPI_RESOURCE_DATA *Resource)
{
- UINT8 Count = 0;
- BOOLEAN Done = FALSE;
-
-
ACPI_FUNCTION_ENTRY ();
- if (AcpiDbgLevel & ACPI_LV_RESOURCES && _COMPONENT & AcpiDbgLayer)
- {
- while (!Done)
- {
- AcpiOsPrintf ("Resource structure %X.\n", Count++);
-
- switch (Resource->Id)
- {
- case ACPI_RSTYPE_IRQ:
- AcpiRsDumpIrq (&Resource->Data);
- break;
-
- case ACPI_RSTYPE_DMA:
- AcpiRsDumpDma (&Resource->Data);
- break;
+ AcpiOsPrintf ("Generic Register Resource\n");
- case ACPI_RSTYPE_START_DPF:
- AcpiRsDumpStartDependFns (&Resource->Data);
- break;
+ AcpiRsOutInteger8 ("Space ID",
+ (UINT8) Resource->GenericReg.SpaceId);
- case ACPI_RSTYPE_END_DPF:
- AcpiOsPrintf ("EndDependentFunctions Resource\n");
- /* AcpiRsDumpEndDependentFunctions (Resource->Data);*/
- break;
+ AcpiRsOutInteger8 ("Bit Width",
+ (UINT8) Resource->GenericReg.BitWidth);
- case ACPI_RSTYPE_IO:
- AcpiRsDumpIo (&Resource->Data);
- break;
+ AcpiRsOutInteger8 ("Bit Offset",
+ (UINT8) Resource->GenericReg.BitOffset);
- case ACPI_RSTYPE_FIXED_IO:
- AcpiRsDumpFixedIo (&Resource->Data);
- break;
+ AcpiRsOutInteger8 ("Access Size",
+ (UINT8) Resource->GenericReg.AccessSize);
- case ACPI_RSTYPE_VENDOR:
- AcpiRsDumpVendorSpecific (&Resource->Data);
- break;
-
- case ACPI_RSTYPE_END_TAG:
- /*RsDumpEndTag (Resource->Data);*/
- AcpiOsPrintf ("EndTag Resource\n");
- Done = TRUE;
- break;
-
- case ACPI_RSTYPE_MEM24:
- AcpiRsDumpMemory24 (&Resource->Data);
- break;
+ AcpiRsOutInteger64 ("Address",
+ Resource->GenericReg.Address);
+}
- case ACPI_RSTYPE_MEM32:
- AcpiRsDumpMemory32 (&Resource->Data);
- break;
- case ACPI_RSTYPE_FIXED_MEM32:
- AcpiRsDumpFixedMemory32 (&Resource->Data);
- break;
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiRsDumpEndDpf
+ *
+ * PARAMETERS: Resource - Pointer to an internal resource descriptor
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Print type, no data.
+ *
+ ******************************************************************************/
- case ACPI_RSTYPE_ADDRESS16:
- AcpiRsDumpAddress16 (&Resource->Data);
- break;
+void
+AcpiRsDumpEndDpf (
+ ACPI_RESOURCE_DATA *Resource)
+{
+ ACPI_FUNCTION_ENTRY ();
- case ACPI_RSTYPE_ADDRESS32:
- AcpiRsDumpAddress32 (&Resource->Data);
- break;
- case ACPI_RSTYPE_ADDRESS64:
- AcpiRsDumpAddress64 (&Resource->Data);
- break;
+ AcpiOsPrintf ("EndDependentFunctions Resource\n");
+}
- case ACPI_RSTYPE_EXT_IRQ:
- AcpiRsDumpExtendedIrq (&Resource->Data);
- break;
- default:
- AcpiOsPrintf ("Invalid resource type\n");
- break;
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiRsDumpEndTag
+ *
+ * PARAMETERS: Resource - Pointer to an internal resource descriptor
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Print type, no data.
+ *
+ ******************************************************************************/
- }
+void
+AcpiRsDumpEndTag (
+ ACPI_RESOURCE_DATA *Resource)
+{
+ ACPI_FUNCTION_ENTRY ();
- Resource = ACPI_PTR_ADD (ACPI_RESOURCE, Resource, Resource->Length);
- }
- }
- return;
+ AcpiOsPrintf ("EndTag Resource\n");
}
+
/*******************************************************************************
*
* FUNCTION: AcpiRsDumpIrqList
*
- * PARAMETERS: RouteTable - pointer to the routing table to dump.
+ * PARAMETERS: RouteTable - Pointer to the routing table to dump.
*
* RETURN: None
*
- * DESCRIPTION: Dispatches the structures to the correct dump routine.
+ * DESCRIPTION: Print IRQ routing table
*
******************************************************************************/
@@ -1232,40 +1231,36 @@ AcpiRsDumpIrqList (
{
UINT8 *Buffer = RouteTable;
UINT8 Count = 0;
- BOOLEAN Done = FALSE;
ACPI_PCI_ROUTING_TABLE *PrtElement;
ACPI_FUNCTION_ENTRY ();
- if (AcpiDbgLevel & ACPI_LV_RESOURCES && _COMPONENT & AcpiDbgLayer)
+ if (!(AcpiDbgLevel & ACPI_LV_RESOURCES) || !( _COMPONENT & AcpiDbgLayer))
{
- PrtElement = ACPI_CAST_PTR (ACPI_PCI_ROUTING_TABLE, Buffer);
+ return;
+ }
- while (!Done)
- {
- AcpiOsPrintf ("PCI IRQ Routing Table structure %X.\n", Count++);
+ PrtElement = ACPI_CAST_PTR (ACPI_PCI_ROUTING_TABLE, Buffer);
- AcpiOsPrintf (" Address: %8.8X%8.8X\n",
- ACPI_FORMAT_UINT64 (PrtElement->Address));
+ /* Dump all table elements, Exit on null length element */
- AcpiOsPrintf (" Pin: %X\n", PrtElement->Pin);
+ while (PrtElement->Length)
+ {
+ AcpiOsPrintf ("\n[%02X] PCI IRQ Routing Table Package\n", Count);
- AcpiOsPrintf (" Source: %s\n", PrtElement->Source);
+ AcpiRsOutInteger64 ("Address",
+ PrtElement->Address);
- AcpiOsPrintf (" SourceIndex: %X\n", PrtElement->SourceIndex);
+ AcpiRsOutInteger32 ("Pin", PrtElement->Pin);
+ AcpiRsOutString ("Source", PrtElement->Source);
+ AcpiRsOutInteger32 ("Source Index", PrtElement->SourceIndex);
- Buffer += PrtElement->Length;
- PrtElement = ACPI_CAST_PTR (ACPI_PCI_ROUTING_TABLE, Buffer);
- if (0 == PrtElement->Length)
- {
- Done = TRUE;
- }
- }
+ Buffer += PrtElement->Length;
+ PrtElement = ACPI_CAST_PTR (ACPI_PCI_ROUTING_TABLE, Buffer);
+ Count++;
}
-
- return;
}
#endif
diff --git a/usr/src/uts/i86pc/io/acpica/resources/rsinfo.c b/usr/src/uts/i86pc/io/acpica/resources/rsinfo.c
new file mode 100644
index 0000000000..fef5e3ae27
--- /dev/null
+++ b/usr/src/uts/i86pc/io/acpica/resources/rsinfo.c
@@ -0,0 +1,299 @@
+/*******************************************************************************
+ *
+ * Module Name: rsinfo - Dispatch and Info tables
+ * $Revision: 1.3 $
+ *
+ ******************************************************************************/
+
+/******************************************************************************
+ *
+ * 1. Copyright Notice
+ *
+ * Some or all of this work - Copyright (c) 1999 - 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * 2. License
+ *
+ * 2.1. This is your license from Intel Corp. under its intellectual property
+ * rights. You may have additional license terms from the party that provided
+ * you this software, covering your right to use that party's intellectual
+ * property rights.
+ *
+ * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
+ * copy of the source code appearing in this file ("Covered Code") an
+ * irrevocable, perpetual, worldwide license under Intel's copyrights in the
+ * base code distributed originally by Intel ("Original Intel Code") to copy,
+ * make derivatives, distribute, use and display any portion of the Covered
+ * Code in any form, with the right to sublicense such rights; and
+ *
+ * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
+ * license (with the right to sublicense), under only those claims of Intel
+ * patents that are infringed by the Original Intel Code, to make, use, sell,
+ * offer to sell, and import the Covered Code and derivative works thereof
+ * solely to the minimum extent necessary to exercise the above copyright
+ * license, and in no event shall the patent license extend to any additions
+ * to or modifications of the Original Intel Code. No other license or right
+ * is granted directly or by implication, estoppel or otherwise;
+ *
+ * The above copyright and patent license is granted only if the following
+ * conditions are met:
+ *
+ * 3. Conditions
+ *
+ * 3.1. Redistribution of Source with Rights to Further Distribute Source.
+ * Redistribution of source code of any substantial portion of the Covered
+ * Code or modification with rights to further distribute source must include
+ * the above Copyright Notice, the above License, this list of Conditions,
+ * and the following Disclaimer and Export Compliance provision. In addition,
+ * Licensee must cause all Covered Code to which Licensee contributes to
+ * contain a file documenting the changes Licensee made to create that Covered
+ * Code and the date of any change. Licensee must include in that file the
+ * documentation of any changes made by any predecessor Licensee. Licensee
+ * must include a prominent statement that the modification is derived,
+ * directly or indirectly, from Original Intel Code.
+ *
+ * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
+ * Redistribution of source code of any substantial portion of the Covered
+ * Code or modification without rights to further distribute source must
+ * include the following Disclaimer and Export Compliance provision in the
+ * documentation and/or other materials provided with distribution. In
+ * addition, Licensee may not authorize further sublicense of source of any
+ * portion of the Covered Code, and must include terms to the effect that the
+ * license from Licensee to its licensee is limited to the intellectual
+ * property embodied in the software Licensee provides to its licensee, and
+ * not to intellectual property embodied in modifications its licensee may
+ * make.
+ *
+ * 3.3. Redistribution of Executable. Redistribution in executable form of any
+ * substantial portion of the Covered Code or modification must reproduce the
+ * above Copyright Notice, and the following Disclaimer and Export Compliance
+ * provision in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3.4. Intel retains all right, title, and interest in and to the Original
+ * Intel Code.
+ *
+ * 3.5. Neither the name Intel nor any other trademark owned or controlled by
+ * Intel shall be used in advertising or otherwise to promote the sale, use or
+ * other dealings in products derived from or relating to the Covered Code
+ * without prior written authorization from Intel.
+ *
+ * 4. Disclaimer and Export Compliance
+ *
+ * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
+ * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
+ * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
+ * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
+ * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
+ * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
+ * PARTICULAR PURPOSE.
+ *
+ * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
+ * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
+ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
+ * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
+ * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
+ * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
+ * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
+ * LIMITED REMEDY.
+ *
+ * 4.3. Licensee shall not export, either directly or indirectly, any of this
+ * software or system incorporating such software without first obtaining any
+ * required license or other approval from the U. S. Department of Commerce or
+ * any other agency or department of the United States Government. In the
+ * event Licensee exports any such software from the United States or
+ * re-exports any such software from a foreign destination, Licensee shall
+ * ensure that the distribution and export/re-export of the software is in
+ * compliance with all laws, regulations, orders, or other restrictions of the
+ * U.S. Export Administration Regulations. Licensee agrees that neither it nor
+ * any of its subsidiaries will export/re-export any technical data, process,
+ * software, or service, directly or indirectly, to any country for which the
+ * United States government or any agency thereof requires an export license,
+ * other governmental approval, or letter of assurance, without first obtaining
+ * such license, approval or letter.
+ *
+ *****************************************************************************/
+
+#define __RSINFO_C__
+
+#include "acpi.h"
+#include "acresrc.h"
+
+#define _COMPONENT ACPI_RESOURCES
+ ACPI_MODULE_NAME ("rsinfo")
+
+/*
+ * Resource dispatch and information tables. Any new resource types (either
+ * Large or Small) must be reflected in each of these tables, so they are here
+ * in one place.
+ *
+ * The tables for Large descriptors are indexed by bits 6:0 of the AML
+ * descriptor type byte. The tables for Small descriptors are indexed by
+ * bits 6:3 of the descriptor byte. The tables for internal resource
+ * descriptors are indexed by the ACPI_RESOURCE_TYPE field.
+ */
+
+
+/* Dispatch table for resource-to-AML (Set Resource) conversion functions */
+
+ACPI_SET_RESOURCE_HANDLER AcpiGbl_SetResourceDispatch [] =
+{
+ AcpiRsSetIrq, /* 0x00, ACPI_RESOURCE_TYPE_IRQ */
+ AcpiRsSetDma, /* 0x01, ACPI_RESOURCE_TYPE_DMA */
+ AcpiRsSetStartDpf, /* 0x02, ACPI_RESOURCE_TYPE_START_DEPENDENT */
+ AcpiRsSetEndDpf, /* 0x03, ACPI_RESOURCE_TYPE_END_DEPENDENT */
+ AcpiRsSetIo, /* 0x04, ACPI_RESOURCE_TYPE_IO */
+ AcpiRsSetFixedIo, /* 0x05, ACPI_RESOURCE_TYPE_FIXED_IO */
+ AcpiRsSetVendor, /* 0x06, ACPI_RESOURCE_TYPE_VENDOR */
+ AcpiRsSetEndTag, /* 0x07, ACPI_RESOURCE_TYPE_END_TAG */
+ AcpiRsSetMemory24, /* 0x08, ACPI_RESOURCE_TYPE_MEMORY24 */
+ AcpiRsSetMemory32, /* 0x09, ACPI_RESOURCE_TYPE_MEMORY32 */
+ AcpiRsSetFixedMemory32, /* 0x0A, ACPI_RESOURCE_TYPE_FIXED_MEMORY32 */
+ AcpiRsSetAddress16, /* 0x0B, ACPI_RESOURCE_TYPE_ADDRESS16 */
+ AcpiRsSetAddress32, /* 0x0C, ACPI_RESOURCE_TYPE_ADDRESS32 */
+ AcpiRsSetAddress64, /* 0x0D, ACPI_RESOURCE_TYPE_ADDRESS64 */
+ AcpiRsSetExtAddress64, /* 0x0E, ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 */
+ AcpiRsSetExtIrq, /* 0x0F, ACPI_RESOURCE_TYPE_EXTENDED_IRQ */
+ AcpiRsSetGenericReg /* 0x10, ACPI_RESOURCE_TYPE_GENERIC_REGISTER */
+};
+
+
+/* Dispatch tables for AML-to-resource (Get Resource) conversion functions */
+
+ACPI_GET_RESOURCE_HANDLER AcpiGbl_SmGetResourceDispatch [] =
+{
+ NULL, /* 0x00, Reserved */
+ NULL, /* 0x01, Reserved */
+ NULL, /* 0x02, Reserved */
+ NULL, /* 0x03, Reserved */
+ AcpiRsGetIrq, /* 0x04, ACPI_RESOURCE_NAME_IRQ */
+ AcpiRsGetDma, /* 0x05, ACPI_RESOURCE_NAME_DMA */
+ AcpiRsGetStartDpf, /* 0x06, ACPI_RESOURCE_NAME_START_DEPENDENT */
+ AcpiRsGetEndDpf, /* 0x07, ACPI_RESOURCE_NAME_END_DEPENDENT */
+ AcpiRsGetIo, /* 0x08, ACPI_RESOURCE_NAME_IO */
+ AcpiRsGetFixedIo, /* 0x09, ACPI_RESOURCE_NAME_FIXED_IO */
+ NULL, /* 0x0A, Reserved */
+ NULL, /* 0x0B, Reserved */
+ NULL, /* 0x0C, Reserved */
+ NULL, /* 0x0D, Reserved */
+ AcpiRsGetVendor, /* 0x0E, ACPI_RESOURCE_NAME_VENDOR_SMALL */
+ AcpiRsGetEndTag /* 0x0F, ACPI_RESOURCE_NAME_END_TAG */
+};
+
+ACPI_GET_RESOURCE_HANDLER AcpiGbl_LgGetResourceDispatch[] =
+{
+ NULL, /* 0x00, Reserved */
+ AcpiRsGetMemory24, /* 0x01, ACPI_RESOURCE_NAME_MEMORY24 */
+ AcpiRsGetGenericReg, /* 0x02, ACPI_RESOURCE_NAME_GENERIC_REGISTER */
+ NULL, /* 0x03, Reserved */
+ AcpiRsGetVendor, /* 0x04, ACPI_RESOURCE_NAME_VENDOR_LARGE */
+ AcpiRsGetMemory32, /* 0x05, ACPI_RESOURCE_NAME_MEMORY32 */
+ AcpiRsGetFixedMemory32, /* 0x06, ACPI_RESOURCE_NAME_FIXED_MEMORY32 */
+ AcpiRsGetAddress32, /* 0x07, ACPI_RESOURCE_NAME_ADDRESS32 */
+ AcpiRsGetAddress16, /* 0x08, ACPI_RESOURCE_NAME_ADDRESS16 */
+ AcpiRsGetExtIrq, /* 0x09, ACPI_RESOURCE_NAME_EXTENDED_IRQ */
+ AcpiRsGetAddress64, /* 0x0A, ACPI_RESOURCE_NAME_ADDRESS64 */
+ AcpiRsGetExtAddress64 /* 0x0B, ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64 */
+};
+
+
+#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
+
+/* Dispatch table for resource dump functions */
+
+ACPI_DUMP_RESOURCE_HANDLER AcpiGbl_DumpResourceDispatch [] =
+{
+ AcpiRsDumpIrq, /* ACPI_RESOURCE_TYPE_IRQ */
+ AcpiRsDumpDma, /* ACPI_RESOURCE_TYPE_DMA */
+ AcpiRsDumpStartDpf, /* ACPI_RESOURCE_TYPE_START_DEPENDENT */
+ AcpiRsDumpEndDpf, /* ACPI_RESOURCE_TYPE_END_DEPENDENT */
+ AcpiRsDumpIo, /* ACPI_RESOURCE_TYPE_IO */
+ AcpiRsDumpFixedIo, /* ACPI_RESOURCE_TYPE_FIXED_IO */
+ AcpiRsDumpVendor, /* ACPI_RESOURCE_TYPE_VENDOR */
+ AcpiRsDumpEndTag, /* ACPI_RESOURCE_TYPE_END_TAG */
+ AcpiRsDumpMemory24, /* ACPI_RESOURCE_TYPE_MEMORY24 */
+ AcpiRsDumpMemory32, /* ACPI_RESOURCE_TYPE_MEMORY32 */
+ AcpiRsDumpFixedMemory32, /* ACPI_RESOURCE_TYPE_FIXED_MEMORY32 */
+ AcpiRsDumpAddress16, /* ACPI_RESOURCE_TYPE_ADDRESS16 */
+ AcpiRsDumpAddress32, /* ACPI_RESOURCE_TYPE_ADDRESS32 */
+ AcpiRsDumpAddress64, /* ACPI_RESOURCE_TYPE_ADDRESS64 */
+ AcpiRsDumpExtAddress64, /* ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 */
+ AcpiRsDumpExtIrq, /* ACPI_RESOURCE_TYPE_EXTENDED_IRQ */
+ AcpiRsDumpGenericReg /* ACPI_RESOURCE_TYPE_GENERIC_REGISTER */
+};
+#endif
+
+
+/*
+ * Base sizes for external AML resource descriptors, indexed by internal type.
+ * Includes size of the descriptor header (1 byte for small descriptors,
+ * 3 bytes for large descriptors)
+ */
+UINT8 AcpiGbl_AmlResourceSizes [] =
+{
+ sizeof (AML_RESOURCE_IRQ), /* ACPI_RESOURCE_TYPE_IRQ (optional Byte 3 always created) */
+ sizeof (AML_RESOURCE_DMA), /* ACPI_RESOURCE_TYPE_DMA */
+ sizeof (AML_RESOURCE_START_DEPENDENT), /* ACPI_RESOURCE_TYPE_START_DEPENDENT (optional Byte 1 always created) */
+ sizeof (AML_RESOURCE_END_DEPENDENT), /* ACPI_RESOURCE_TYPE_END_DEPENDENT */
+ sizeof (AML_RESOURCE_IO), /* ACPI_RESOURCE_TYPE_IO */
+ sizeof (AML_RESOURCE_FIXED_IO), /* ACPI_RESOURCE_TYPE_FIXED_IO */
+ sizeof (AML_RESOURCE_VENDOR_SMALL), /* ACPI_RESOURCE_TYPE_VENDOR */
+ sizeof (AML_RESOURCE_END_TAG), /* ACPI_RESOURCE_TYPE_END_TAG */
+ sizeof (AML_RESOURCE_MEMORY24), /* ACPI_RESOURCE_TYPE_MEMORY24 */
+ sizeof (AML_RESOURCE_MEMORY32), /* ACPI_RESOURCE_TYPE_MEMORY32 */
+ sizeof (AML_RESOURCE_FIXED_MEMORY32), /* ACPI_RESOURCE_TYPE_FIXED_MEMORY32 */
+ sizeof (AML_RESOURCE_ADDRESS16), /* ACPI_RESOURCE_TYPE_ADDRESS16 */
+ sizeof (AML_RESOURCE_ADDRESS32), /* ACPI_RESOURCE_TYPE_ADDRESS32 */
+ sizeof (AML_RESOURCE_ADDRESS64), /* ACPI_RESOURCE_TYPE_ADDRESS64 */
+ sizeof (AML_RESOURCE_EXTENDED_ADDRESS64),/*ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 */
+ sizeof (AML_RESOURCE_EXTENDED_IRQ), /* ACPI_RESOURCE_TYPE_EXTENDED_IRQ */
+ sizeof (AML_RESOURCE_GENERIC_REGISTER) /* ACPI_RESOURCE_TYPE_GENERIC_REGISTER */
+};
+
+
+/* Macros used in the tables below */
+
+#define ACPI_RLARGE(r) sizeof (r) - sizeof (AML_RESOURCE_LARGE_HEADER)
+#define ACPI_RSMALL(r) sizeof (r) - sizeof (AML_RESOURCE_SMALL_HEADER)
+
+/*
+ * Base sizes of resource descriptors, both the AML stream resource length
+ * (minus size of header and length fields),and the size of the internal
+ * struct representation.
+ */
+ACPI_RESOURCE_INFO AcpiGbl_SmResourceInfo [] =
+{
+ {0, 0, 0},
+ {0, 0, 0},
+ {0, 0, 0},
+ {0, 0, 0},
+ {2, ACPI_RSMALL (AML_RESOURCE_IRQ), ACPI_SIZEOF_RESOURCE (ACPI_RESOURCE_IRQ)},
+ {0, ACPI_RSMALL (AML_RESOURCE_DMA), ACPI_SIZEOF_RESOURCE (ACPI_RESOURCE_DMA)},
+ {2, ACPI_RSMALL (AML_RESOURCE_START_DEPENDENT), ACPI_SIZEOF_RESOURCE (ACPI_RESOURCE_START_DEPENDENT)},
+ {0, ACPI_RSMALL (AML_RESOURCE_END_DEPENDENT), ACPI_RESOURCE_LENGTH},
+ {0, ACPI_RSMALL (AML_RESOURCE_IO), ACPI_SIZEOF_RESOURCE (ACPI_RESOURCE_IO)},
+ {0, ACPI_RSMALL (AML_RESOURCE_FIXED_IO), ACPI_SIZEOF_RESOURCE (ACPI_RESOURCE_FIXED_IO)},
+ {0, 0, 0},
+ {0, 0, 0},
+ {0, 0, 0},
+ {0, 0, 0},
+ {1, ACPI_RSMALL (AML_RESOURCE_VENDOR_SMALL), ACPI_SIZEOF_RESOURCE (ACPI_RESOURCE_VENDOR)},
+ {0, ACPI_RSMALL (AML_RESOURCE_END_TAG), ACPI_RESOURCE_LENGTH}
+};
+
+ACPI_RESOURCE_INFO AcpiGbl_LgResourceInfo [] =
+{
+ {0, 0, 0},
+ {0, ACPI_RLARGE (AML_RESOURCE_MEMORY24), ACPI_SIZEOF_RESOURCE (ACPI_RESOURCE_MEMORY24)},
+ {0, ACPI_RLARGE (AML_RESOURCE_GENERIC_REGISTER), ACPI_SIZEOF_RESOURCE (ACPI_RESOURCE_GENERIC_REGISTER)},
+ {0, 0, 0},
+ {1, ACPI_RLARGE (AML_RESOURCE_VENDOR_LARGE), ACPI_SIZEOF_RESOURCE (ACPI_RESOURCE_VENDOR)},
+ {0, ACPI_RLARGE (AML_RESOURCE_MEMORY32), ACPI_SIZEOF_RESOURCE (ACPI_RESOURCE_MEMORY32)},
+ {0, ACPI_RLARGE (AML_RESOURCE_FIXED_MEMORY32), ACPI_SIZEOF_RESOURCE (ACPI_RESOURCE_FIXED_MEMORY32)},
+ {1, ACPI_RLARGE (AML_RESOURCE_ADDRESS32), ACPI_SIZEOF_RESOURCE (ACPI_RESOURCE_ADDRESS32)},
+ {1, ACPI_RLARGE (AML_RESOURCE_ADDRESS16), ACPI_SIZEOF_RESOURCE (ACPI_RESOURCE_ADDRESS16)},
+ {1, ACPI_RLARGE (AML_RESOURCE_EXTENDED_IRQ), ACPI_SIZEOF_RESOURCE (ACPI_RESOURCE_EXTENDED_IRQ)},
+ {1, ACPI_RLARGE (AML_RESOURCE_ADDRESS64), ACPI_SIZEOF_RESOURCE (ACPI_RESOURCE_ADDRESS64)},
+ {0, ACPI_RLARGE (AML_RESOURCE_EXTENDED_ADDRESS64), ACPI_SIZEOF_RESOURCE (ACPI_RESOURCE_EXTENDED_ADDRESS64)}
+};
+
diff --git a/usr/src/uts/i86pc/io/acpica/resources/rsio.c b/usr/src/uts/i86pc/io/acpica/resources/rsio.c
index 83a497c182..e79e5cf827 100644
--- a/usr/src/uts/i86pc/io/acpica/resources/rsio.c
+++ b/usr/src/uts/i86pc/io/acpica/resources/rsio.c
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: rsio - IO and DMA resource descriptors
- * $Revision: 28 $
+ * $Revision: 1.32 $
*
******************************************************************************/
@@ -125,467 +125,299 @@
/*******************************************************************************
*
- * FUNCTION: AcpiRsIoResource
+ * FUNCTION: AcpiRsGetIo
*
- * PARAMETERS: ByteStreamBuffer - Pointer to the resource input byte
- * stream
- * BytesConsumed - Pointer to where the number of bytes
- * consumed the ByteStreamBuffer is
- * returned
- * OutputBuffer - Pointer to the return data buffer
- * StructureSize - Pointer to where the number of bytes
- * in the return data struct is returned
+ * PARAMETERS: Aml - Pointer to the AML resource descriptor
+ * AmlResourceLength - Length of the resource from the AML header
+ * Resource - Where the internal resource is returned
*
* RETURN: Status
*
- * DESCRIPTION: Take the resource byte stream and fill out the appropriate
- * structure pointed to by the OutputBuffer. Return the
- * number of bytes consumed from the byte stream.
+ * DESCRIPTION: Convert a raw AML resource descriptor to the corresponding
+ * internal resource descriptor, simplifying bitflags and handling
+ * alignment and endian issues if necessary.
*
******************************************************************************/
ACPI_STATUS
-AcpiRsIoResource (
- UINT8 *ByteStreamBuffer,
- ACPI_SIZE *BytesConsumed,
- UINT8 **OutputBuffer,
- ACPI_SIZE *StructureSize)
+AcpiRsGetIo (
+ AML_RESOURCE *Aml,
+ UINT16 AmlResourceLength,
+ ACPI_RESOURCE *Resource)
{
- UINT8 *Buffer = ByteStreamBuffer;
- ACPI_RESOURCE *OutputStruct = (void *) *OutputBuffer;
- UINT16 Temp16 = 0;
- UINT8 Temp8 = 0;
- ACPI_SIZE StructSize = ACPI_SIZEOF_RESOURCE (
- ACPI_RESOURCE_IO);
+ ACPI_FUNCTION_TRACE ("RsGetIo");
- ACPI_FUNCTION_TRACE ("RsIoResource");
+ /* Get the Decode flag */
+ Resource->Data.Io.IoDecode = Aml->Io.Information & 0x01;
- /* The number of bytes consumed are Constant */
+ /*
+ * Get the following contiguous fields from the AML descriptor:
+ * Minimum Base Address
+ * Maximum Base Address
+ * Address Alignment
+ * Length
+ */
+ ACPI_MOVE_16_TO_32 (&Resource->Data.Io.Minimum,
+ &Aml->Io.Minimum);
+ ACPI_MOVE_16_TO_32 (&Resource->Data.Io.Maximum,
+ &Aml->Io.Maximum);
+ Resource->Data.Io.Alignment = Aml->Io.Alignment;
+ Resource->Data.Io.AddressLength = Aml->Io.AddressLength;
- *BytesConsumed = 8;
+ /* Complete the resource header */
- OutputStruct->Id = ACPI_RSTYPE_IO;
-
- /* Check Decode */
-
- Buffer += 1;
- Temp8 = *Buffer;
-
- OutputStruct->Data.Io.IoDecode = Temp8 & 0x01;
-
- /* Check MinBase Address */
-
- Buffer += 1;
- ACPI_MOVE_16_TO_16 (&Temp16, Buffer);
-
- OutputStruct->Data.Io.MinBaseAddress = Temp16;
-
- /* Check MaxBase Address */
-
- Buffer += 2;
- ACPI_MOVE_16_TO_16 (&Temp16, Buffer);
-
- OutputStruct->Data.Io.MaxBaseAddress = Temp16;
-
- /* Check Base alignment */
-
- Buffer += 2;
- Temp8 = *Buffer;
-
- OutputStruct->Data.Io.Alignment = Temp8;
-
- /* Check RangeLength */
-
- Buffer += 1;
- Temp8 = *Buffer;
-
- OutputStruct->Data.Io.RangeLength = Temp8;
-
- /* Set the Length parameter */
-
- OutputStruct->Length = (UINT32) StructSize;
-
- /* Return the final size of the structure */
-
- *StructureSize = StructSize;
+ Resource->Type = ACPI_RESOURCE_TYPE_IO;
+ Resource->Length = ACPI_SIZEOF_RESOURCE (ACPI_RESOURCE_IO);
return_ACPI_STATUS (AE_OK);
}
/*******************************************************************************
*
- * FUNCTION: AcpiRsFixedIoResource
+ * FUNCTION: AcpiRsSetIo
*
- * PARAMETERS: ByteStreamBuffer - Pointer to the resource input byte
- * stream
- * BytesConsumed - Pointer to where the number of bytes
- * consumed the ByteStreamBuffer is
- * returned
- * OutputBuffer - Pointer to the return data buffer
- * StructureSize - Pointer to where the number of bytes
- * in the return data struct is returned
+ * PARAMETERS: Resource - Pointer to the resource descriptor
+ * Aml - Where the AML descriptor is returned
*
* RETURN: Status
*
- * DESCRIPTION: Take the resource byte stream and fill out the appropriate
- * structure pointed to by the OutputBuffer. Return the
- * number of bytes consumed from the byte stream.
+ * DESCRIPTION: Convert an internal resource descriptor to the corresponding
+ * external AML resource descriptor.
*
******************************************************************************/
ACPI_STATUS
-AcpiRsFixedIoResource (
- UINT8 *ByteStreamBuffer,
- ACPI_SIZE *BytesConsumed,
- UINT8 **OutputBuffer,
- ACPI_SIZE *StructureSize)
+AcpiRsSetIo (
+ ACPI_RESOURCE *Resource,
+ AML_RESOURCE *Aml)
{
- UINT8 *Buffer = ByteStreamBuffer;
- ACPI_RESOURCE *OutputStruct = (void *) *OutputBuffer;
- UINT16 Temp16 = 0;
- UINT8 Temp8 = 0;
- ACPI_SIZE StructSize = ACPI_SIZEOF_RESOURCE (
- ACPI_RESOURCE_FIXED_IO);
+ ACPI_FUNCTION_TRACE ("RsSetIo");
- ACPI_FUNCTION_TRACE ("RsFixedIoResource");
+ /* I/O Information Byte */
+ Aml->Io.Information = (UINT8) (Resource->Data.Io.IoDecode & 0x01);
- /* The number of bytes consumed are Constant */
+ /*
+ * Set the following contiguous fields in the AML descriptor:
+ * Minimum Base Address
+ * Maximum Base Address
+ * Address Alignment
+ * Length
+ */
+ ACPI_MOVE_32_TO_16 (&Aml->Io.Minimum, &Resource->Data.Io.Minimum);
+ ACPI_MOVE_32_TO_16 (&Aml->Io.Maximum, &Resource->Data.Io.Maximum);
+ Aml->Io.Alignment = (UINT8) Resource->Data.Io.Alignment;
+ Aml->Io.AddressLength = (UINT8) Resource->Data.Io.AddressLength;
- *BytesConsumed = 4;
+ /* Complete the AML descriptor header */
- OutputStruct->Id = ACPI_RSTYPE_FIXED_IO;
-
- /* Check Range Base Address */
-
- Buffer += 1;
- ACPI_MOVE_16_TO_16 (&Temp16, Buffer);
-
- OutputStruct->Data.FixedIo.BaseAddress = Temp16;
-
- /* Check RangeLength */
-
- Buffer += 2;
- Temp8 = *Buffer;
-
- OutputStruct->Data.FixedIo.RangeLength = Temp8;
-
- /* Set the Length parameter */
-
- OutputStruct->Length = (UINT32) StructSize;
-
- /* Return the final size of the structure */
-
- *StructureSize = StructSize;
+ AcpiRsSetResourceHeader (ACPI_RESOURCE_NAME_IO, sizeof (AML_RESOURCE_IO), Aml);
return_ACPI_STATUS (AE_OK);
}
/*******************************************************************************
*
- * FUNCTION: AcpiRsIoStream
+ * FUNCTION: AcpiRsGetFixedIo
*
- * PARAMETERS: LinkedList - Pointer to the resource linked list
- * OutputBuffer - Pointer to the user's return buffer
- * BytesConsumed - Pointer to where the number of bytes
- * used in the OutputBuffer is returned
+ * PARAMETERS: Aml - Pointer to the AML resource descriptor
+ * AmlResourceLength - Length of the resource from the AML header
+ * Resource - Where the internal resource is returned
*
* RETURN: Status
*
- * DESCRIPTION: Take the linked list resource structure and fills in the
- * the appropriate bytes in a byte stream
+ * DESCRIPTION: Convert a raw AML resource descriptor to the corresponding
+ * internal resource descriptor, simplifying bitflags and handling
+ * alignment and endian issues if necessary.
*
******************************************************************************/
ACPI_STATUS
-AcpiRsIoStream (
- ACPI_RESOURCE *LinkedList,
- UINT8 **OutputBuffer,
- ACPI_SIZE *BytesConsumed)
+AcpiRsGetFixedIo (
+ AML_RESOURCE *Aml,
+ UINT16 AmlResourceLength,
+ ACPI_RESOURCE *Resource)
{
- UINT8 *Buffer = *OutputBuffer;
- UINT16 Temp16 = 0;
- UINT8 Temp8 = 0;
-
-
- ACPI_FUNCTION_TRACE ("RsIoStream");
-
-
- /* The descriptor field is static */
-
- *Buffer = 0x47;
- Buffer += 1;
-
- /* Io Information Byte */
-
- Temp8 = (UINT8) (LinkedList->Data.Io.IoDecode & 0x01);
-
- *Buffer = Temp8;
- Buffer += 1;
-
- /* Set the Range minimum base address */
+ ACPI_FUNCTION_TRACE ("RsGetFixedIo");
- Temp16 = (UINT16) LinkedList->Data.Io.MinBaseAddress;
- ACPI_MOVE_16_TO_16 (Buffer, &Temp16);
- Buffer += 2;
+ /*
+ * Get the following contiguous fields from the AML descriptor:
+ * Base Address
+ * Length
+ */
+ ACPI_MOVE_16_TO_32 (&Resource->Data.FixedIo.Address,
+ &Aml->FixedIo.Address);
+ Resource->Data.FixedIo.AddressLength = Aml->FixedIo.AddressLength;
- /* Set the Range maximum base address */
+ /* Complete the resource header */
- Temp16 = (UINT16) LinkedList->Data.Io.MaxBaseAddress;
-
- ACPI_MOVE_16_TO_16 (Buffer, &Temp16);
- Buffer += 2;
-
- /* Set the base alignment */
-
- Temp8 = (UINT8) LinkedList->Data.Io.Alignment;
-
- *Buffer = Temp8;
- Buffer += 1;
-
- /* Set the range length */
-
- Temp8 = (UINT8) LinkedList->Data.Io.RangeLength;
-
- *Buffer = Temp8;
- Buffer += 1;
-
- /* Return the number of bytes consumed in this operation */
-
- *BytesConsumed = ACPI_PTR_DIFF (Buffer, *OutputBuffer);
+ Resource->Type = ACPI_RESOURCE_TYPE_FIXED_IO;
+ Resource->Length = ACPI_SIZEOF_RESOURCE (ACPI_RESOURCE_FIXED_IO);
return_ACPI_STATUS (AE_OK);
}
/*******************************************************************************
*
- * FUNCTION: AcpiRsFixedIoStream
+ * FUNCTION: AcpiRsSetFixedIo
*
- * PARAMETERS: LinkedList - Pointer to the resource linked list
- * OutputBuffer - Pointer to the user's return buffer
- * BytesConsumed - Pointer to where the number of bytes
- * used in the OutputBuffer is returned
+ * PARAMETERS: Resource - Pointer to the resource descriptor
+ * Aml - Where the AML descriptor is returned
*
* RETURN: Status
*
- * DESCRIPTION: Take the linked list resource structure and fills in the
- * the appropriate bytes in a byte stream
+ * DESCRIPTION: Convert an internal resource descriptor to the corresponding
+ * external AML resource descriptor.
*
******************************************************************************/
ACPI_STATUS
-AcpiRsFixedIoStream (
- ACPI_RESOURCE *LinkedList,
- UINT8 **OutputBuffer,
- ACPI_SIZE *BytesConsumed)
+AcpiRsSetFixedIo (
+ ACPI_RESOURCE *Resource,
+ AML_RESOURCE *Aml)
{
- UINT8 *Buffer = *OutputBuffer;
- UINT16 Temp16 = 0;
- UINT8 Temp8 = 0;
-
-
- ACPI_FUNCTION_TRACE ("RsFixedIoStream");
-
-
- /* The descriptor field is static */
-
- *Buffer = 0x4B;
-
- Buffer += 1;
-
- /* Set the Range base address */
-
- Temp16 = (UINT16) LinkedList->Data.FixedIo.BaseAddress;
-
- ACPI_MOVE_16_TO_16 (Buffer, &Temp16);
- Buffer += 2;
-
- /* Set the range length */
+ ACPI_FUNCTION_TRACE ("RsSetFixedIo");
- Temp8 = (UINT8) LinkedList->Data.FixedIo.RangeLength;
- *Buffer = Temp8;
- Buffer += 1;
+ /*
+ * Set the following contiguous fields in the AML descriptor:
+ * Base Address
+ * Length
+ */
+ ACPI_MOVE_32_TO_16 (&Aml->FixedIo.Address,
+ &Resource->Data.FixedIo.Address);
+ Aml->FixedIo.AddressLength = (UINT8) Resource->Data.FixedIo.AddressLength;
- /* Return the number of bytes consumed in this operation */
+ /* Complete the AML descriptor header */
- *BytesConsumed = ACPI_PTR_DIFF (Buffer, *OutputBuffer);
+ AcpiRsSetResourceHeader (ACPI_RESOURCE_NAME_FIXED_IO,
+ sizeof (AML_RESOURCE_FIXED_IO), Aml);
return_ACPI_STATUS (AE_OK);
}
/*******************************************************************************
*
- * FUNCTION: AcpiRsDmaResource
+ * FUNCTION: AcpiRsGetDma
*
- * PARAMETERS: ByteStreamBuffer - Pointer to the resource input byte
- * stream
- * BytesConsumed - Pointer to where the number of bytes
- * consumed the ByteStreamBuffer is
- * returned
- * OutputBuffer - Pointer to the return data buffer
- * StructureSize - Pointer to where the number of bytes
- * in the return data struct is returned
+ * PARAMETERS: Aml - Pointer to the AML resource descriptor
+ * AmlResourceLength - Length of the resource from the AML header
+ * Resource - Where the internal resource is returned
*
* RETURN: Status
*
- * DESCRIPTION: Take the resource byte stream and fill out the appropriate
- * structure pointed to by the OutputBuffer. Return the
- * number of bytes consumed from the byte stream.
+ * DESCRIPTION: Convert a raw AML resource descriptor to the corresponding
+ * internal resource descriptor, simplifying bitflags and handling
+ * alignment and endian issues if necessary.
*
******************************************************************************/
ACPI_STATUS
-AcpiRsDmaResource (
- UINT8 *ByteStreamBuffer,
- ACPI_SIZE *BytesConsumed,
- UINT8 **OutputBuffer,
- ACPI_SIZE *StructureSize)
+AcpiRsGetDma (
+ AML_RESOURCE *Aml,
+ UINT16 AmlResourceLength,
+ ACPI_RESOURCE *Resource)
{
- UINT8 *Buffer = ByteStreamBuffer;
- ACPI_RESOURCE *OutputStruct = (void *) *OutputBuffer;
- UINT8 Temp8 = 0;
- UINT8 Index;
- UINT8 i;
- ACPI_SIZE StructSize = ACPI_SIZEOF_RESOURCE (
- ACPI_RESOURCE_DMA);
-
-
- ACPI_FUNCTION_TRACE ("RsDmaResource");
-
-
- /* The number of bytes consumed are Constant */
+ UINT32 ChannelCount = 0;
+ UINT32 i;
+ UINT8 Temp8;
- *BytesConsumed = 3;
- OutputStruct->Id = ACPI_RSTYPE_DMA;
- /* Point to the 8-bits of Byte 1 */
+ ACPI_FUNCTION_TRACE ("RsGetDma");
- Buffer += 1;
- Temp8 = *Buffer;
/* Decode the DMA channel bits */
- for (i = 0, Index = 0; Index < 8; Index++)
+ for (i = 0; i < 8; i++)
{
- if ((Temp8 >> Index) & 0x01)
+ if ((Aml->Dma.DmaChannelMask >> i) & 0x01)
{
- OutputStruct->Data.Dma.Channels[i] = Index;
- i++;
+ Resource->Data.Dma.Channels[ChannelCount] = i;
+ ChannelCount++;
}
}
- /* Zero DMA channels is valid */
+ Resource->Length = 0;
+ Resource->Data.Dma.ChannelCount = ChannelCount;
- OutputStruct->Data.Dma.NumberOfChannels = i;
- if (i > 0)
+ /*
+ * Calculate the structure size based upon the number of channels
+ * Note: Zero DMA channels is valid
+ */
+ if (ChannelCount > 0)
{
- /* Calculate the structure size based upon the number of interrupts */
-
- StructSize += ((ACPI_SIZE) i - 1) * 4;
+ Resource->Length = (UINT32) (ChannelCount - 1) * 4;
}
- /* Point to Byte 2 */
-
- Buffer += 1;
- Temp8 = *Buffer;
-
- /* Check for transfer preference (Bits[1:0]) */
+ /* Get the flags: transfer preference, bus mastering, channel speed */
- OutputStruct->Data.Dma.Transfer = Temp8 & 0x03;
+ Temp8 = Aml->Dma.Flags;
+ Resource->Data.Dma.Transfer = Temp8 & 0x03;
+ Resource->Data.Dma.BusMaster = (Temp8 >> 2) & 0x01;
+ Resource->Data.Dma.Type = (Temp8 >> 5) & 0x03;
- if (0x03 == OutputStruct->Data.Dma.Transfer)
+ if (Resource->Data.Dma.Transfer == 0x03)
{
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"Invalid DMA.Transfer preference (3)\n"));
return_ACPI_STATUS (AE_BAD_DATA);
}
- /* Get bus master preference (Bit[2]) */
-
- OutputStruct->Data.Dma.BusMaster = (Temp8 >> 2) & 0x01;
-
- /* Get channel speed support (Bits[6:5]) */
+ /* Complete the resource header */
- OutputStruct->Data.Dma.Type = (Temp8 >> 5) & 0x03;
-
- /* Set the Length parameter */
-
- OutputStruct->Length = (UINT32) StructSize;
-
- /* Return the final size of the structure */
-
- *StructureSize = StructSize;
+ Resource->Type = ACPI_RESOURCE_TYPE_DMA;
+ Resource->Length += ACPI_SIZEOF_RESOURCE (ACPI_RESOURCE_DMA);
return_ACPI_STATUS (AE_OK);
}
/*******************************************************************************
*
- * FUNCTION: AcpiRsDmaStream
+ * FUNCTION: AcpiRsSetDma
*
- * PARAMETERS: LinkedList - Pointer to the resource linked list
- * OutputBuffer - Pointer to the user's return buffer
- * BytesConsumed - Pointer to where the number of bytes
- * used in the OutputBuffer is returned
+ * PARAMETERS: Resource - Pointer to the resource descriptor
+ * Aml - Where the AML descriptor is returned
*
* RETURN: Status
*
- * DESCRIPTION: Take the linked list resource structure and fills in the
- * the appropriate bytes in a byte stream
+ * DESCRIPTION: Convert an internal resource descriptor to the corresponding
+ * external AML resource descriptor.
*
******************************************************************************/
ACPI_STATUS
-AcpiRsDmaStream (
- ACPI_RESOURCE *LinkedList,
- UINT8 **OutputBuffer,
- ACPI_SIZE *BytesConsumed)
+AcpiRsSetDma (
+ ACPI_RESOURCE *Resource,
+ AML_RESOURCE *Aml)
{
- UINT8 *Buffer = *OutputBuffer;
- UINT16 Temp16 = 0;
- UINT8 Temp8 = 0;
- UINT8 Index;
-
-
- ACPI_FUNCTION_TRACE ("RsDmaStream");
+ UINT8 i;
- /* The descriptor field is static */
+ ACPI_FUNCTION_TRACE ("RsSetDma");
- *Buffer = 0x2A;
- Buffer += 1;
- Temp8 = 0;
- /* Loop through all of the Channels and set the mask bits */
+ /* Convert channel list to 8-bit DMA channel bitmask */
- for (Index = 0;
- Index < LinkedList->Data.Dma.NumberOfChannels;
- Index++)
+ Aml->Dma.DmaChannelMask = 0;
+ for (i = 0; i < Resource->Data.Dma.ChannelCount; i++)
{
- Temp16 = (UINT16) LinkedList->Data.Dma.Channels[Index];
- Temp8 |= 0x1 << Temp16;
+ Aml->Dma.DmaChannelMask |= (1 << Resource->Data.Dma.Channels[i]);
}
- *Buffer = Temp8;
- Buffer += 1;
-
- /* Set the DMA Info */
-
- Temp8 = (UINT8) ((LinkedList->Data.Dma.Type & 0x03) << 5);
- Temp8 |= ((LinkedList->Data.Dma.BusMaster & 0x01) << 2);
- Temp8 |= (LinkedList->Data.Dma.Transfer & 0x03);
+ /* Set the DMA Flag bits */
- *Buffer = Temp8;
- Buffer += 1;
+ Aml->Dma.Flags = (UINT8)
+ (((Resource->Data.Dma.Type & 0x03) << 5) |
+ ((Resource->Data.Dma.BusMaster & 0x01) << 2) |
+ (Resource->Data.Dma.Transfer & 0x03));
- /* Return the number of bytes consumed in this operation */
+ /* Complete the AML descriptor header */
- *BytesConsumed = ACPI_PTR_DIFF (Buffer, *OutputBuffer);
+ AcpiRsSetResourceHeader (ACPI_RESOURCE_NAME_DMA, sizeof (AML_RESOURCE_DMA), Aml);
return_ACPI_STATUS (AE_OK);
}
diff --git a/usr/src/uts/i86pc/io/acpica/resources/rsirq.c b/usr/src/uts/i86pc/io/acpica/resources/rsirq.c
index e5a3c98b17..23f458998e 100644
--- a/usr/src/uts/i86pc/io/acpica/resources/rsirq.c
+++ b/usr/src/uts/i86pc/io/acpica/resources/rsirq.c
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: rsirq - IRQ resource descriptors
- * $Revision: 42 $
+ * $Revision: 1.47 $
*
******************************************************************************/
@@ -125,100 +125,77 @@
/*******************************************************************************
*
- * FUNCTION: AcpiRsIrqResource
+ * FUNCTION: AcpiRsGetIrq
*
- * PARAMETERS: ByteStreamBuffer - Pointer to the resource input byte
- * stream
- * BytesConsumed - Pointer to where the number of bytes
- * consumed the ByteStreamBuffer is
- * returned
- * OutputBuffer - Pointer to the return data buffer
- * StructureSize - Pointer to where the number of bytes
- * in the return data struct is returned
+ * PARAMETERS: Aml - Pointer to the AML resource descriptor
+ * AmlResourceLength - Length of the resource from the AML header
+ * Resource - Where the internal resource is returned
*
* RETURN: Status
*
- * DESCRIPTION: Take the resource byte stream and fill out the appropriate
- * structure pointed to by the OutputBuffer. Return the
- * number of bytes consumed from the byte stream.
+ * DESCRIPTION: Convert a raw AML resource descriptor to the corresponding
+ * internal resource descriptor, simplifying bitflags and handling
+ * alignment and endian issues if necessary.
*
******************************************************************************/
ACPI_STATUS
-AcpiRsIrqResource (
- UINT8 *ByteStreamBuffer,
- ACPI_SIZE *BytesConsumed,
- UINT8 **OutputBuffer,
- ACPI_SIZE *StructureSize)
+AcpiRsGetIrq (
+ AML_RESOURCE *Aml,
+ UINT16 AmlResourceLength,
+ ACPI_RESOURCE *Resource)
{
- UINT8 *Buffer = ByteStreamBuffer;
- ACPI_RESOURCE *OutputStruct = (void *) *OutputBuffer;
UINT16 Temp16 = 0;
- UINT8 Temp8 = 0;
- UINT8 Index;
- UINT8 i;
- ACPI_SIZE StructSize = ACPI_SIZEOF_RESOURCE (
- ACPI_RESOURCE_IRQ);
-
-
- ACPI_FUNCTION_TRACE ("RsIrqResource");
+ UINT32 InterruptCount = 0;
+ UINT32 i;
+ UINT32 ResourceLength;
- /*
- * The number of bytes consumed are contained in the descriptor
- * (Bits:0-1)
- */
- Temp8 = *Buffer;
- *BytesConsumed = (Temp8 & 0x03) + 1;
- OutputStruct->Id = ACPI_RSTYPE_IRQ;
+ ACPI_FUNCTION_TRACE ("RsGetIrq");
- /* Point to the 16-bits of Bytes 1 and 2 */
- Buffer += 1;
- ACPI_MOVE_16_TO_16 (&Temp16, Buffer);
+ /* Get the IRQ mask (bytes 1:2) */
- OutputStruct->Data.Irq.NumberOfInterrupts = 0;
+ ACPI_MOVE_16_TO_16 (&Temp16, &Aml->Irq.IrqMask);
- /* Decode the IRQ bits */
+ /* Decode the IRQ bits (up to 16 possible) */
- for (i = 0, Index = 0; Index < 16; Index++)
+ for (i = 0; i < 16; i++)
{
- if ((Temp16 >> Index) & 0x01)
+ if ((Temp16 >> i) & 0x01)
{
- OutputStruct->Data.Irq.Interrupts[i] = Index;
- i++;
+ Resource->Data.Irq.Interrupts[InterruptCount] = i;
+ InterruptCount++;
}
}
/* Zero interrupts is valid */
- OutputStruct->Data.Irq.NumberOfInterrupts = i;
- if (i > 0)
+ ResourceLength = 0;
+ Resource->Data.Irq.InterruptCount = InterruptCount;
+ if (InterruptCount > 0)
{
/* Calculate the structure size based upon the number of interrupts */
- StructSize += ((ACPI_SIZE) i - 1) * 4;
+ ResourceLength = (UINT32) (InterruptCount - 1) * 4;
}
- /* Point to Byte 3 if it is used */
+ /* Get Flags (Byte 3) if it is used */
- if (4 == *BytesConsumed)
+ if (AmlResourceLength == 3)
{
- Buffer += 2;
- Temp8 = *Buffer;
-
/* Check for HE, LL interrupts */
- switch (Temp8 & 0x09)
+ switch (Aml->Irq.Flags & 0x09)
{
case 0x01: /* HE */
- OutputStruct->Data.Irq.EdgeLevel = ACPI_EDGE_SENSITIVE;
- OutputStruct->Data.Irq.ActiveHighLow = ACPI_ACTIVE_HIGH;
+ Resource->Data.Irq.Triggering = ACPI_EDGE_SENSITIVE;
+ Resource->Data.Irq.Polarity = ACPI_ACTIVE_HIGH;
break;
case 0x08: /* LL */
- OutputStruct->Data.Irq.EdgeLevel = ACPI_LEVEL_SENSITIVE;
- OutputStruct->Data.Irq.ActiveHighLow = ACPI_ACTIVE_LOW;
+ Resource->Data.Irq.Triggering = ACPI_LEVEL_SENSITIVE;
+ Resource->Data.Irq.Polarity = ACPI_ACTIVE_LOW;
break;
default:
@@ -229,192 +206,148 @@ AcpiRsIrqResource (
*/
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"Invalid interrupt polarity/trigger in resource list, %X\n",
- Temp8));
+ Aml->Irq.Flags));
return_ACPI_STATUS (AE_BAD_DATA);
}
- /* Check for sharable */
+ /* Get Sharing flag */
- OutputStruct->Data.Irq.SharedExclusive = (Temp8 >> 3) & 0x01;
+ Resource->Data.Irq.Sharable = (Aml->Irq.Flags >> 3) & 0x01;
}
else
{
/*
- * Assume Edge Sensitive, Active High, Non-Sharable
- * per ACPI Specification
+ * Default configuration: assume Edge Sensitive, Active High,
+ * Non-Sharable as per the ACPI Specification
*/
- OutputStruct->Data.Irq.EdgeLevel = ACPI_EDGE_SENSITIVE;
- OutputStruct->Data.Irq.ActiveHighLow = ACPI_ACTIVE_HIGH;
- OutputStruct->Data.Irq.SharedExclusive = ACPI_EXCLUSIVE;
+ Resource->Data.Irq.Triggering = ACPI_EDGE_SENSITIVE;
+ Resource->Data.Irq.Polarity = ACPI_ACTIVE_HIGH;
+ Resource->Data.Irq.Sharable = ACPI_EXCLUSIVE;
}
- /* Set the Length parameter */
+ /* Complete the resource header */
- OutputStruct->Length = (UINT32) StructSize;
-
- /* Return the final size of the structure */
-
- *StructureSize = StructSize;
+ Resource->Type = ACPI_RESOURCE_TYPE_IRQ;
+ Resource->Length = ResourceLength + ACPI_SIZEOF_RESOURCE (ACPI_RESOURCE_IRQ);
return_ACPI_STATUS (AE_OK);
}
/*******************************************************************************
*
- * FUNCTION: AcpiRsIrqStream
+ * FUNCTION: AcpiRsSetIrq
*
- * PARAMETERS: LinkedList - Pointer to the resource linked list
- * OutputBuffer - Pointer to the user's return buffer
- * BytesConsumed - Pointer to where the number of bytes
- * used in the OutputBuffer is returned
+ * PARAMETERS: Resource - Pointer to the resource descriptor
+ * Aml - Where the AML descriptor is returned
*
* RETURN: Status
*
- * DESCRIPTION: Take the linked list resource structure and fills in the
- * the appropriate bytes in a byte stream
+ * DESCRIPTION: Convert an internal resource descriptor to the corresponding
+ * external AML resource descriptor.
*
******************************************************************************/
ACPI_STATUS
-AcpiRsIrqStream (
- ACPI_RESOURCE *LinkedList,
- UINT8 **OutputBuffer,
- ACPI_SIZE *BytesConsumed)
+AcpiRsSetIrq (
+ ACPI_RESOURCE *Resource,
+ AML_RESOURCE *Aml)
{
- UINT8 *Buffer = *OutputBuffer;
- UINT16 Temp16 = 0;
- UINT8 Temp8 = 0;
- UINT8 Index;
- BOOLEAN IRQInfoByteNeeded;
+ ACPI_SIZE DescriptorLength;
+ UINT16 IrqMask;
+ UINT8 i;
+
+
+ ACPI_FUNCTION_TRACE ("RsSetIrq");
- ACPI_FUNCTION_TRACE ("RsIrqStream");
+ /* Convert interrupt list to 16-bit IRQ bitmask */
+ IrqMask = 0;
+ for (i = 0; i < Resource->Data.Irq.InterruptCount; i++)
+ {
+ IrqMask |= (1 << Resource->Data.Irq.Interrupts[i]);
+ }
+
+ /* Set the interrupt mask */
+
+ ACPI_MOVE_16_TO_16 (&Aml->Irq.IrqMask, &IrqMask);
/*
* The descriptor field is set based upon whether a third byte is
* needed to contain the IRQ Information.
*/
- if (ACPI_EDGE_SENSITIVE == LinkedList->Data.Irq.EdgeLevel &&
- ACPI_ACTIVE_HIGH == LinkedList->Data.Irq.ActiveHighLow &&
- ACPI_EXCLUSIVE == LinkedList->Data.Irq.SharedExclusive)
+ if ((Resource->Data.Irq.Triggering == ACPI_EDGE_SENSITIVE) &&
+ (Resource->Data.Irq.Polarity == ACPI_ACTIVE_HIGH) &&
+ (Resource->Data.Irq.Sharable == ACPI_EXCLUSIVE))
{
- *Buffer = 0x22;
- IRQInfoByteNeeded = FALSE;
+ /* IrqNoFlags() descriptor can be used */
+
+ DescriptorLength = sizeof (AML_RESOURCE_IRQ_NOFLAGS);
}
else
{
- *Buffer = 0x23;
- IRQInfoByteNeeded = TRUE;
- }
-
- Buffer += 1;
- Temp16 = 0;
-
- /* Loop through all of the interrupts and set the mask bits */
-
- for(Index = 0;
- Index < LinkedList->Data.Irq.NumberOfInterrupts;
- Index++)
- {
- Temp8 = (UINT8) LinkedList->Data.Irq.Interrupts[Index];
- Temp16 |= 0x1 << Temp8;
- }
+ /* Irq() descriptor must be used */
- ACPI_MOVE_16_TO_16 (Buffer, &Temp16);
- Buffer += 2;
+ DescriptorLength = sizeof (AML_RESOURCE_IRQ);
- /* Set the IRQ Info byte if needed. */
+ /* Set the IRQ Info byte */
- if (IRQInfoByteNeeded)
- {
- Temp8 = 0;
- Temp8 = (UINT8) ((LinkedList->Data.Irq.SharedExclusive &
- 0x01) << 4);
+ Aml->Irq.Flags = (UINT8)
+ ((Resource->Data.Irq.Sharable & 0x01) << 4);
- if (ACPI_LEVEL_SENSITIVE == LinkedList->Data.Irq.EdgeLevel &&
- ACPI_ACTIVE_LOW == LinkedList->Data.Irq.ActiveHighLow)
+ if (ACPI_LEVEL_SENSITIVE == Resource->Data.Irq.Triggering &&
+ ACPI_ACTIVE_LOW == Resource->Data.Irq.Polarity)
{
- Temp8 |= 0x08;
+ Aml->Irq.Flags |= 0x08;
}
else
{
- Temp8 |= 0x01;
+ Aml->Irq.Flags |= 0x01;
}
-
- *Buffer = Temp8;
- Buffer += 1;
}
- /* Return the number of bytes consumed in this operation */
+ /* Complete the AML descriptor header */
- *BytesConsumed = ACPI_PTR_DIFF (Buffer, *OutputBuffer);
+ AcpiRsSetResourceHeader (ACPI_RESOURCE_NAME_IRQ, DescriptorLength, Aml);
return_ACPI_STATUS (AE_OK);
}
/*******************************************************************************
*
- * FUNCTION: AcpiRsExtendedIrqResource
+ * FUNCTION: AcpiRsGetExtIrq
*
- * PARAMETERS: ByteStreamBuffer - Pointer to the resource input byte
- * stream
- * BytesConsumed - Pointer to where the number of bytes
- * consumed the ByteStreamBuffer is
- * returned
- * OutputBuffer - Pointer to the return data buffer
- * StructureSize - Pointer to where the number of bytes
- * in the return data struct is returned
+ * PARAMETERS: Aml - Pointer to the AML resource descriptor
+ * AmlResourceLength - Length of the resource from the AML header
+ * Resource - Where the internal resource is returned
*
* RETURN: Status
*
- * DESCRIPTION: Take the resource byte stream and fill out the appropriate
- * structure pointed to by the OutputBuffer. Return the
- * number of bytes consumed from the byte stream.
+ * DESCRIPTION: Convert a raw AML resource descriptor to the corresponding
+ * internal resource descriptor, simplifying bitflags and handling
+ * alignment and endian issues if necessary.
*
******************************************************************************/
ACPI_STATUS
-AcpiRsExtendedIrqResource (
- UINT8 *ByteStreamBuffer,
- ACPI_SIZE *BytesConsumed,
- UINT8 **OutputBuffer,
- ACPI_SIZE *StructureSize)
+AcpiRsGetExtIrq (
+ AML_RESOURCE *Aml,
+ UINT16 AmlResourceLength,
+ ACPI_RESOURCE *Resource)
{
- UINT8 *Buffer = ByteStreamBuffer;
- ACPI_RESOURCE *OutputStruct = (void *) *OutputBuffer;
- UINT16 Temp16 = 0;
- UINT8 Temp8 = 0;
- UINT8 *TempPtr;
- UINT8 Index;
- ACPI_SIZE StructSize = ACPI_SIZEOF_RESOURCE (
- ACPI_RESOURCE_EXT_IRQ);
-
-
- ACPI_FUNCTION_TRACE ("RsExtendedIrqResource");
-
-
- /* Point past the Descriptor to get the number of bytes consumed */
+ char *OutResourceString;
+ UINT8 Temp8;
- Buffer += 1;
- ACPI_MOVE_16_TO_16 (&Temp16, Buffer);
- /* Validate minimum descriptor length */
+ ACPI_FUNCTION_TRACE ("RsGetExtIrq");
- if (Temp16 < 6)
- {
- return_ACPI_STATUS (AE_AML_BAD_RESOURCE_LENGTH);
- }
- *BytesConsumed = Temp16 + 3;
- OutputStruct->Id = ACPI_RSTYPE_EXT_IRQ;
+ /* Get the flag bits */
- /* Point to the Byte3 */
-
- Buffer += 2;
- Temp8 = *Buffer;
-
- OutputStruct->Data.ExtendedIrq.ProducerConsumer = Temp8 & 0x01;
+ Temp8 = Aml->ExtendedIrq.Flags;
+ Resource->Data.ExtendedIrq.ProducerConsumer = Temp8 & 0x01;
+ Resource->Data.ExtendedIrq.Polarity = (Temp8 >> 2) & 0x01;
+ Resource->Data.ExtendedIrq.Sharable = (Temp8 >> 3) & 0x01;
/*
* Check for Interrupt Mode
@@ -424,173 +357,81 @@ AcpiRsExtendedIrqResource (
*
* - Edge/Level are defined opposite in the table vs the headers
*/
- OutputStruct->Data.ExtendedIrq.EdgeLevel =
+ Resource->Data.ExtendedIrq.Triggering =
(Temp8 & 0x2) ? ACPI_EDGE_SENSITIVE : ACPI_LEVEL_SENSITIVE;
- /* Check Interrupt Polarity */
-
- OutputStruct->Data.ExtendedIrq.ActiveHighLow = (Temp8 >> 2) & 0x1;
-
- /* Check for sharable */
-
- OutputStruct->Data.ExtendedIrq.SharedExclusive = (Temp8 >> 3) & 0x01;
-
- /* Point to Byte4 (IRQ Table length) */
-
- Buffer += 1;
- Temp8 = *Buffer;
-
- /* Must have at least one IRQ */
+ /* Get the IRQ Table length (Byte4) */
+ Temp8 = Aml->ExtendedIrq.TableLength;
+ Resource->Data.ExtendedIrq.InterruptCount = Temp8;
if (Temp8 < 1)
{
+ /* Must have at least one IRQ */
+
return_ACPI_STATUS (AE_AML_BAD_RESOURCE_LENGTH);
}
- OutputStruct->Data.ExtendedIrq.NumberOfInterrupts = Temp8;
-
/*
* Add any additional structure size to properly calculate
* the next pointer at the end of this function
*/
- StructSize += (Temp8 - 1) * 4;
-
- /* Point to Byte5 (First IRQ Number) */
+ Resource->Length = (Temp8 - 1) * 4;
+ OutResourceString = ACPI_CAST_PTR (char,
+ (&Resource->Data.ExtendedIrq.Interrupts[0] + Temp8));
- Buffer += 1;
+ /* Get every IRQ in the table, each is 32 bits */
- /* Cycle through every IRQ in the table */
+ AcpiRsMoveData (Resource->Data.ExtendedIrq.Interrupts,
+ Aml->ExtendedIrq.InterruptNumber,
+ (UINT16) Temp8, ACPI_MOVE_TYPE_32_TO_32);
- for (Index = 0; Index < Temp8; Index++)
- {
- ACPI_MOVE_32_TO_32 (
- &OutputStruct->Data.ExtendedIrq.Interrupts[Index], Buffer);
+ /* Get the optional ResourceSource (index and string) */
- /* Point to the next IRQ */
+ Resource->Length +=
+ AcpiRsGetResourceSource (AmlResourceLength,
+ (ACPI_SIZE) Resource->Length + sizeof (AML_RESOURCE_EXTENDED_IRQ),
+ &Resource->Data.ExtendedIrq.ResourceSource,
+ Aml, OutResourceString);
- Buffer += 4;
- }
+ /* Complete the resource header */
- /*
- * This will leave us pointing to the Resource Source Index
- * If it is present, then save it off and calculate the
- * pointer to where the null terminated string goes:
- * Each Interrupt takes 32-bits + the 5 bytes of the
- * stream that are default.
- *
- * Note: Some resource descriptors will have an additional null, so
- * we add 1 to the length.
- */
- if (*BytesConsumed >
- ((ACPI_SIZE) OutputStruct->Data.ExtendedIrq.NumberOfInterrupts * 4) +
- (5 + 1))
- {
- /* Dereference the Index */
-
- Temp8 = *Buffer;
- OutputStruct->Data.ExtendedIrq.ResourceSource.Index = (UINT32) Temp8;
-
- /* Point to the String */
-
- Buffer += 1;
-
- /* Point the String pointer to the end of this structure. */
-
- OutputStruct->Data.ExtendedIrq.ResourceSource.StringPtr =
- (char *)((char *) OutputStruct + StructSize);
-
- TempPtr = (UINT8 *)
- OutputStruct->Data.ExtendedIrq.ResourceSource.StringPtr;
-
- /* Copy the string into the buffer */
-
- Index = 0;
- while (0x00 != *Buffer)
- {
- *TempPtr = *Buffer;
-
- TempPtr += 1;
- Buffer += 1;
- Index += 1;
- }
-
- /* Add the terminating null */
-
- *TempPtr = 0x00;
- OutputStruct->Data.ExtendedIrq.ResourceSource.StringLength = Index + 1;
-
- /*
- * In order for the StructSize to fall on a 32-bit boundary,
- * calculate the length of the string and expand the
- * StructSize to the next 32-bit boundary.
- */
- Temp8 = (UINT8) (Index + 1);
- StructSize += ACPI_ROUND_UP_TO_32BITS (Temp8);
- }
- else
- {
- OutputStruct->Data.ExtendedIrq.ResourceSource.Index = 0x00;
- OutputStruct->Data.ExtendedIrq.ResourceSource.StringLength = 0;
- OutputStruct->Data.ExtendedIrq.ResourceSource.StringPtr = NULL;
- }
-
- /* Set the Length parameter */
-
- OutputStruct->Length = (UINT32) StructSize;
-
- /* Return the final size of the structure */
-
- *StructureSize = StructSize;
+ Resource->Type = ACPI_RESOURCE_TYPE_EXTENDED_IRQ;
+ Resource->Length += ACPI_SIZEOF_RESOURCE (ACPI_RESOURCE_EXTENDED_IRQ);
return_ACPI_STATUS (AE_OK);
}
/*******************************************************************************
*
- * FUNCTION: AcpiRsExtendedIrqStream
+ * FUNCTION: AcpiRsSetExtIrq
*
- * PARAMETERS: LinkedList - Pointer to the resource linked list
- * OutputBuffer - Pointer to the user's return buffer
- * BytesConsumed - Pointer to where the number of bytes
- * used in the OutputBuffer is returned
+ * PARAMETERS: Resource - Pointer to the resource descriptor
+ * Aml - Where the AML descriptor is returned
*
* RETURN: Status
*
- * DESCRIPTION: Take the linked list resource structure and fills in the
- * the appropriate bytes in a byte stream
+ * DESCRIPTION: Convert an internal resource descriptor to the corresponding
+ * external AML resource descriptor.
*
******************************************************************************/
ACPI_STATUS
-AcpiRsExtendedIrqStream (
- ACPI_RESOURCE *LinkedList,
- UINT8 **OutputBuffer,
- ACPI_SIZE *BytesConsumed)
+AcpiRsSetExtIrq (
+ ACPI_RESOURCE *Resource,
+ AML_RESOURCE *Aml)
{
- UINT8 *Buffer = *OutputBuffer;
- UINT16 *LengthField;
- UINT8 Temp8 = 0;
- UINT8 Index;
- char *TempPointer = NULL;
-
-
- ACPI_FUNCTION_TRACE ("RsExtendedIrqStream");
-
-
- /* The descriptor field is static */
+ ACPI_SIZE DescriptorLength;
- *Buffer = 0x89;
- Buffer += 1;
- /* Set a pointer to the Length field - to be filled in later */
+ ACPI_FUNCTION_TRACE ("RsSetExtIrq");
- LengthField = ACPI_CAST_PTR (UINT16, Buffer);
- Buffer += 2;
/* Set the Interrupt vector flags */
- Temp8 = (UINT8)(LinkedList->Data.ExtendedIrq.ProducerConsumer & 0x01);
- Temp8 |= ((LinkedList->Data.ExtendedIrq.SharedExclusive & 0x01) << 3);
+ Aml->ExtendedIrq.Flags = (UINT8)
+ ((Resource->Data.ExtendedIrq.ProducerConsumer & 0x01) |
+ ((Resource->Data.ExtendedIrq.Sharable & 0x01) << 3) |
+ ((Resource->Data.ExtendedIrq.Polarity & 0x1) << 2));
/*
* Set the Interrupt Mode
@@ -601,64 +442,35 @@ AcpiRsExtendedIrqStream (
*
* - Edge/Level are defined opposite in the table vs the headers
*/
- if (ACPI_EDGE_SENSITIVE == LinkedList->Data.ExtendedIrq.EdgeLevel)
+ if (Resource->Data.ExtendedIrq.Triggering == ACPI_EDGE_SENSITIVE)
{
- Temp8 |= 0x2;
+ Aml->ExtendedIrq.Flags |= 0x02;
}
- /* Set the Interrupt Polarity */
-
- Temp8 |= ((LinkedList->Data.ExtendedIrq.ActiveHighLow & 0x1) << 2);
-
- *Buffer = Temp8;
- Buffer += 1;
-
/* Set the Interrupt table length */
- Temp8 = (UINT8) LinkedList->Data.ExtendedIrq.NumberOfInterrupts;
+ Aml->ExtendedIrq.TableLength = (UINT8)
+ Resource->Data.ExtendedIrq.InterruptCount;
- *Buffer = Temp8;
- Buffer += 1;
+ DescriptorLength = (sizeof (AML_RESOURCE_EXTENDED_IRQ) - 4) +
+ ((ACPI_SIZE) Resource->Data.ExtendedIrq.InterruptCount * sizeof (UINT32));
- for (Index = 0; Index < LinkedList->Data.ExtendedIrq.NumberOfInterrupts;
- Index++)
- {
- ACPI_MOVE_32_TO_32 (Buffer,
- &LinkedList->Data.ExtendedIrq.Interrupts[Index]);
- Buffer += 4;
- }
+ /* Set each interrupt value */
- /* Resource Source Index and Resource Source are optional */
+ AcpiRsMoveData (Aml->ExtendedIrq.InterruptNumber,
+ Resource->Data.ExtendedIrq.Interrupts,
+ (UINT16) Resource->Data.ExtendedIrq.InterruptCount,
+ ACPI_MOVE_TYPE_32_TO_32);
- if (0 != LinkedList->Data.ExtendedIrq.ResourceSource.StringLength)
- {
- *Buffer = (UINT8) LinkedList->Data.ExtendedIrq.ResourceSource.Index;
- Buffer += 1;
-
- TempPointer = (char *) Buffer;
-
- /* Copy the string */
-
- ACPI_STRCPY (TempPointer,
- LinkedList->Data.ExtendedIrq.ResourceSource.StringPtr);
-
- /*
- * Buffer needs to be set to the length of the sting + one for the
- * terminating null
- */
- Buffer += (ACPI_SIZE) (ACPI_STRLEN (
- LinkedList->Data.ExtendedIrq.ResourceSource.StringPtr) + 1);
- }
+ /* Resource Source Index and Resource Source are optional */
- /* Return the number of bytes consumed in this operation */
+ DescriptorLength = AcpiRsSetResourceSource (Aml, DescriptorLength,
+ &Resource->Data.ExtendedIrq.ResourceSource);
- *BytesConsumed = ACPI_PTR_DIFF (Buffer, *OutputBuffer);
+ /* Complete the AML descriptor header */
- /*
- * Set the length field to the number of bytes consumed
- * minus the header size (3 bytes)
- */
- *LengthField = (UINT16) (*BytesConsumed - 3);
+ AcpiRsSetResourceHeader (ACPI_RESOURCE_NAME_EXTENDED_IRQ,
+ DescriptorLength, Aml);
return_ACPI_STATUS (AE_OK);
}
diff --git a/usr/src/uts/i86pc/io/acpica/resources/rslist.c b/usr/src/uts/i86pc/io/acpica/resources/rslist.c
index f39a9169f8..2fcb9afd8a 100644
--- a/usr/src/uts/i86pc/io/acpica/resources/rslist.c
+++ b/usr/src/uts/i86pc/io/acpica/resources/rslist.c
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: rslist - Linked list utilities
- * $Revision: 39 $
+ * $Revision: 1.45 $
*
******************************************************************************/
@@ -123,62 +123,142 @@
ACPI_MODULE_NAME ("rslist")
+/* Local prototypes */
+
+static ACPI_GET_RESOURCE_HANDLER
+AcpiRsGetResourceHandler (
+ UINT8 ResourceType);
+
+static ACPI_STATUS
+AcpiRsValidateResourceLength (
+ AML_RESOURCE *Aml);
+
+
/*******************************************************************************
*
- * FUNCTION: AcpiRsGetResourceType
+ * FUNCTION: AcpiRsValidateResourceLength
*
- * PARAMETERS: ResourceStartByte - Byte 0 of a resource descriptor
+ * PARAMETERS: Aml - Pointer to the AML resource descriptor
*
- * RETURN: The Resource Type with no extraneous bits
+ * RETURN: Status - AE_OK if the resource length appears valid
*
- * DESCRIPTION: Extract the Resource Type/Name from the first byte of
- * a resource descriptor.
+ * DESCRIPTION: Validate the ResourceLength. Fixed-length descriptors must
+ * have the exact length; variable-length descriptors must be
+ * at least as long as the minimum. Certain Small descriptors
+ * can vary in size by at most one byte.
*
******************************************************************************/
-UINT8
-AcpiRsGetResourceType (
- UINT8 ResourceStartByte)
+static ACPI_STATUS
+AcpiRsValidateResourceLength (
+ AML_RESOURCE *Aml)
{
+ ACPI_RESOURCE_INFO *ResourceInfo;
+ UINT16 MinimumAmlResourceLength;
+ UINT16 ResourceLength;
+
ACPI_FUNCTION_ENTRY ();
- /* Determine if this is a small or large resource */
+ /* Get the size and type info about this resource descriptor */
+
+ ResourceInfo = AcpiRsGetResourceInfo (Aml->SmallHeader.DescriptorType);
+ if (!ResourceInfo)
+ {
+ return (AE_AML_INVALID_RESOURCE_TYPE);
+ }
- switch (ResourceStartByte & ACPI_RDESC_TYPE_MASK)
+ ResourceLength = AcpiRsGetResourceLength (Aml);
+ MinimumAmlResourceLength = ResourceInfo->MinimumAmlResourceLength;
+
+ /* Validate based upon the type of resource, fixed length or variable */
+
+ if (ResourceInfo->LengthType == ACPI_FIXED_LENGTH)
+ {
+ /* Fixed length resource, length must match exactly */
+
+ if (ResourceLength != MinimumAmlResourceLength)
+ {
+ return (AE_AML_BAD_RESOURCE_LENGTH);
+ }
+ }
+ else if (ResourceInfo->LengthType == ACPI_VARIABLE_LENGTH)
+ {
+ /* Variable length resource, must be at least the minimum */
+
+ if (ResourceLength < MinimumAmlResourceLength)
+ {
+ return (AE_AML_BAD_RESOURCE_LENGTH);
+ }
+ }
+ else
{
- case ACPI_RDESC_TYPE_SMALL:
+ /* Small variable length resource, allowed to be (Min) or (Min-1) */
- /* Small Resource Type -- Only bits 6:3 are valid */
+ if ((ResourceLength > MinimumAmlResourceLength) ||
+ (ResourceLength < (MinimumAmlResourceLength - 1)))
+ {
+ return (AE_AML_BAD_RESOURCE_LENGTH);
+ }
+ }
- return ((UINT8) (ResourceStartByte & ACPI_RDESC_SMALL_MASK));
+ return (AE_OK);
+}
- case ACPI_RDESC_TYPE_LARGE:
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiRsGetResourceHandler
+ *
+ * PARAMETERS: ResourceType - Byte 0 of a resource descriptor
+ *
+ * RETURN: Pointer to the resource conversion handler
+ *
+ * DESCRIPTION: Extract the Resource Type/Name from the first byte of
+ * a resource descriptor.
+ *
+ ******************************************************************************/
+
+static ACPI_GET_RESOURCE_HANDLER
+AcpiRsGetResourceHandler (
+ UINT8 ResourceType)
+{
+ ACPI_FUNCTION_ENTRY ();
- /* Large Resource Type -- All bits are valid */
- return (ResourceStartByte);
+ /* Determine if this is a small or large resource */
+ if (ResourceType & ACPI_RESOURCE_NAME_LARGE)
+ {
+ /* Large Resource Type -- bits 6:0 contain the name */
- default:
- /* Invalid type */
- break;
+ if (ResourceType > ACPI_RESOURCE_NAME_LARGE_MAX)
+ {
+ return (NULL);
+ }
+
+ return (AcpiGbl_LgGetResourceDispatch [
+ (ResourceType & ACPI_RESOURCE_NAME_LARGE_MASK)]);
}
+ else
+ {
+ /* Small Resource Type -- bits 6:3 contain the name */
- return (0xFF);
+ return (AcpiGbl_SmGetResourceDispatch [
+ ((ResourceType & ACPI_RESOURCE_NAME_SMALL_MASK) >> 3)]);
+ }
}
/*******************************************************************************
*
- * FUNCTION: AcpiRsByteStreamToList
+ * FUNCTION: AcpiRsConvertAmlToResources
*
- * PARAMETERS: ByteStreamBuffer - Pointer to the resource byte stream
- * ByteStreamBufferLength - Length of ByteStreamBuffer
- * OutputBuffer - Pointer to the buffer that will
- * contain the output structures
+ * PARAMETERS: AmlBuffer - Pointer to the resource byte stream
+ * AmlBufferLength - Length of AmlBuffer
+ * OutputBuffer - Pointer to the buffer that will
+ * contain the output structures
*
* RETURN: Status
*
@@ -188,230 +268,105 @@ AcpiRsGetResourceType (
******************************************************************************/
ACPI_STATUS
-AcpiRsByteStreamToList (
- UINT8 *ByteStreamBuffer,
- UINT32 ByteStreamBufferLength,
+AcpiRsConvertAmlToResources (
+ UINT8 *AmlBuffer,
+ UINT32 AmlBufferLength,
UINT8 *OutputBuffer)
{
+ UINT8 *Buffer = OutputBuffer;
ACPI_STATUS Status;
ACPI_SIZE BytesParsed = 0;
- UINT8 ResourceType = 0;
- ACPI_SIZE BytesConsumed = 0;
- UINT8 *Buffer = OutputBuffer;
- ACPI_SIZE StructureSize = 0;
- BOOLEAN EndTagProcessed = FALSE;
ACPI_RESOURCE *Resource;
+ UINT16 ResourceLength;
+ UINT32 DescriptorLength;
+ ACPI_GET_RESOURCE_HANDLER Handler;
- ACPI_FUNCTION_TRACE ("RsByteStreamToList");
+ ACPI_FUNCTION_TRACE ("RsConvertAmlToResources");
- while (BytesParsed < ByteStreamBufferLength &&
- !EndTagProcessed)
+
+ /* Loop until end-of-buffer or an EndTag is found */
+
+ while (BytesParsed < AmlBufferLength)
{
- /* The next byte in the stream is the resource type */
+ /* Get the handler associated with this Descriptor Type */
- ResourceType = AcpiRsGetResourceType (*ByteStreamBuffer);
+ Handler = AcpiRsGetResourceHandler (*AmlBuffer);
+ if (!Handler)
+ {
+ /* No handler indicates invalid resource type */
+
+ return_ACPI_STATUS (AE_AML_INVALID_RESOURCE_TYPE);
+ }
- switch (ResourceType)
+ ResourceLength = AcpiRsGetResourceLength (
+ ACPI_CAST_PTR (AML_RESOURCE, AmlBuffer));
+
+ DescriptorLength = AcpiRsGetDescriptorLength (
+ ACPI_CAST_PTR (AML_RESOURCE, AmlBuffer));
+
+ /*
+ * Perform limited validation of the resource length, based upon
+ * what we know about the resource type
+ */
+ Status = AcpiRsValidateResourceLength (
+ ACPI_CAST_PTR (AML_RESOURCE, AmlBuffer));
+ if (ACPI_FAILURE (Status))
{
- case ACPI_RDESC_TYPE_MEMORY_24:
- /*
- * 24-Bit Memory Resource
- */
- Status = AcpiRsMemory24Resource (ByteStreamBuffer,
- &BytesConsumed, &Buffer, &StructureSize);
- break;
-
-
- case ACPI_RDESC_TYPE_LARGE_VENDOR:
- /*
- * Vendor Defined Resource
- */
- Status = AcpiRsVendorResource (ByteStreamBuffer,
- &BytesConsumed, &Buffer, &StructureSize);
- break;
-
-
- case ACPI_RDESC_TYPE_MEMORY_32:
- /*
- * 32-Bit Memory Range Resource
- */
- Status = AcpiRsMemory32RangeResource (ByteStreamBuffer,
- &BytesConsumed, &Buffer, &StructureSize);
- break;
-
-
- case ACPI_RDESC_TYPE_FIXED_MEMORY_32:
- /*
- * 32-Bit Fixed Memory Resource
- */
- Status = AcpiRsFixedMemory32Resource (ByteStreamBuffer,
- &BytesConsumed, &Buffer, &StructureSize);
- break;
-
-
- case ACPI_RDESC_TYPE_QWORD_ADDRESS_SPACE:
- case ACPI_RDESC_TYPE_EXTENDED_ADDRESS_SPACE:
- /*
- * 64-Bit Address Resource
- */
- Status = AcpiRsAddress64Resource (ByteStreamBuffer,
- &BytesConsumed, &Buffer, &StructureSize);
- break;
-
-
- case ACPI_RDESC_TYPE_DWORD_ADDRESS_SPACE:
- /*
- * 32-Bit Address Resource
- */
- Status = AcpiRsAddress32Resource (ByteStreamBuffer,
- &BytesConsumed, &Buffer, &StructureSize);
- break;
-
-
- case ACPI_RDESC_TYPE_WORD_ADDRESS_SPACE:
- /*
- * 16-Bit Address Resource
- */
- Status = AcpiRsAddress16Resource (ByteStreamBuffer,
- &BytesConsumed, &Buffer, &StructureSize);
- break;
-
-
- case ACPI_RDESC_TYPE_EXTENDED_XRUPT:
- /*
- * Extended IRQ
- */
- Status = AcpiRsExtendedIrqResource (ByteStreamBuffer,
- &BytesConsumed, &Buffer, &StructureSize);
- break;
-
-
- case ACPI_RDESC_TYPE_IRQ_FORMAT:
- /*
- * IRQ Resource
- */
- Status = AcpiRsIrqResource (ByteStreamBuffer,
- &BytesConsumed, &Buffer, &StructureSize);
- break;
-
-
- case ACPI_RDESC_TYPE_DMA_FORMAT:
- /*
- * DMA Resource
- */
- Status = AcpiRsDmaResource (ByteStreamBuffer,
- &BytesConsumed, &Buffer, &StructureSize);
- break;
-
-
- case ACPI_RDESC_TYPE_START_DEPENDENT:
- /*
- * Start Dependent Functions Resource
- */
- Status = AcpiRsStartDependFnsResource (ByteStreamBuffer,
- &BytesConsumed, &Buffer, &StructureSize);
- break;
-
-
- case ACPI_RDESC_TYPE_END_DEPENDENT:
- /*
- * End Dependent Functions Resource
- */
- Status = AcpiRsEndDependFnsResource (ByteStreamBuffer,
- &BytesConsumed, &Buffer, &StructureSize);
- break;
-
-
- case ACPI_RDESC_TYPE_IO_PORT:
- /*
- * IO Port Resource
- */
- Status = AcpiRsIoResource (ByteStreamBuffer,
- &BytesConsumed, &Buffer, &StructureSize);
- break;
-
-
- case ACPI_RDESC_TYPE_FIXED_IO_PORT:
- /*
- * Fixed IO Port Resource
- */
- Status = AcpiRsFixedIoResource (ByteStreamBuffer,
- &BytesConsumed, &Buffer, &StructureSize);
- break;
-
-
- case ACPI_RDESC_TYPE_SMALL_VENDOR:
- /*
- * Vendor Specific Resource
- */
- Status = AcpiRsVendorResource (ByteStreamBuffer,
- &BytesConsumed, &Buffer, &StructureSize);
- break;
-
-
- case ACPI_RDESC_TYPE_END_TAG:
- /*
- * End Tag
- */
- EndTagProcessed = TRUE;
- Status = AcpiRsEndTagResource (ByteStreamBuffer,
- &BytesConsumed, &Buffer, &StructureSize);
- break;
-
-
- default:
- /*
- * Invalid/Unknown resource type
- */
- Status = AE_AML_INVALID_RESOURCE_TYPE;
- break;
+ return_ACPI_STATUS (Status);
}
+ /* Convert a byte stream resource to local resource struct */
+
+ Status = Handler (ACPI_CAST_PTR (AML_RESOURCE, AmlBuffer),
+ ResourceLength, ACPI_CAST_PTR (ACPI_RESOURCE, Buffer));
if (ACPI_FAILURE (Status))
{
+ ACPI_REPORT_ERROR ((
+ "Could not convert AML resource (type %X) to resource, %s\n",
+ *AmlBuffer, AcpiFormatException (Status)));
return_ACPI_STATUS (Status);
}
- /* Update the return value and counter */
+ /* Set the aligned length of the new resource descriptor */
- BytesParsed += BytesConsumed;
+ Resource = ACPI_CAST_PTR (ACPI_RESOURCE, Buffer);
+ Resource->Length = (UINT32) ACPI_ALIGN_RESOURCE_SIZE (Resource->Length);
- /* Set the byte stream to point to the next resource */
+ /* Normal exit on completion of an EndTag resource descriptor */
- ByteStreamBuffer += BytesConsumed;
+ if (AcpiRsGetResourceType (*AmlBuffer) == ACPI_RESOURCE_NAME_END_TAG)
+ {
+ return_ACPI_STATUS (AE_OK);
+ }
- /* Set the Buffer to the next structure */
+ /* Update counter and point to the next input resource */
- Resource = ACPI_CAST_PTR (ACPI_RESOURCE, Buffer);
- Resource->Length = (UINT32) ACPI_ALIGN_RESOURCE_SIZE (Resource->Length);
- Buffer += ACPI_ALIGN_RESOURCE_SIZE (StructureSize);
- }
+ BytesParsed += DescriptorLength;
+ AmlBuffer += DescriptorLength;
- /* Check the reason for exiting the while loop */
+ /* Point to the next structure in the output buffer */
- if (!EndTagProcessed)
- {
- return_ACPI_STATUS (AE_AML_NO_RESOURCE_END_TAG);
+ Buffer += Resource->Length;
}
- return_ACPI_STATUS (AE_OK);
+ /* Completed buffer, but did not find an EndTag resource descriptor */
+
+ return_ACPI_STATUS (AE_AML_NO_RESOURCE_END_TAG);
}
/*******************************************************************************
*
- * FUNCTION: AcpiRsListToByteStream
+ * FUNCTION: AcpiRsConvertResourcesToAml
*
- * PARAMETERS: LinkedList - Pointer to the resource linked list
- * ByteSteamSizeNeeded - Calculated size of the byte stream
- * needed from calling
- * AcpiRsGetByteStreamLength()
- * The size of the OutputBuffer is
- * guaranteed to be >=
- * ByteStreamSizeNeeded
- * OutputBuffer - Pointer to the buffer that will
- * contain the byte stream
+ * PARAMETERS: Resource - Pointer to the resource linked list
+ * AmlSizeNeeded - Calculated size of the byte stream
+ * needed from calling AcpiRsGetAmlLength()
+ * The size of the OutputBuffer is
+ * guaranteed to be >= AmlSizeNeeded
+ * OutputBuffer - Pointer to the buffer that will
+ * contain the byte stream
*
* RETURN: Status
*
@@ -421,168 +376,70 @@ AcpiRsByteStreamToList (
******************************************************************************/
ACPI_STATUS
-AcpiRsListToByteStream (
- ACPI_RESOURCE *LinkedList,
- ACPI_SIZE ByteStreamSizeNeeded,
+AcpiRsConvertResourcesToAml (
+ ACPI_RESOURCE *Resource,
+ ACPI_SIZE AmlSizeNeeded,
UINT8 *OutputBuffer)
{
+ UINT8 *AmlBuffer = OutputBuffer;
ACPI_STATUS Status;
- UINT8 *Buffer = OutputBuffer;
- ACPI_SIZE BytesConsumed = 0;
- BOOLEAN Done = FALSE;
- ACPI_FUNCTION_TRACE ("RsListToByteStream");
+ ACPI_FUNCTION_TRACE ("RsConvertResourcesToAml");
- while (!Done)
+ /* Convert each resource descriptor in the list */
+
+ while (1)
{
- switch (LinkedList->Id)
+ /* Validate Resource Descriptor Type before dispatch */
+
+ if (Resource->Type > ACPI_RESOURCE_TYPE_MAX)
{
- case ACPI_RSTYPE_IRQ:
- /*
- * IRQ Resource
- */
- Status = AcpiRsIrqStream (LinkedList, &Buffer, &BytesConsumed);
- break;
-
- case ACPI_RSTYPE_DMA:
- /*
- * DMA Resource
- */
- Status = AcpiRsDmaStream (LinkedList, &Buffer, &BytesConsumed);
- break;
-
- case ACPI_RSTYPE_START_DPF:
- /*
- * Start Dependent Functions Resource
- */
- Status = AcpiRsStartDependFnsStream (LinkedList,
- &Buffer, &BytesConsumed);
- break;
-
- case ACPI_RSTYPE_END_DPF:
- /*
- * End Dependent Functions Resource
- */
- Status = AcpiRsEndDependFnsStream (LinkedList,
- &Buffer, &BytesConsumed);
- break;
-
- case ACPI_RSTYPE_IO:
- /*
- * IO Port Resource
- */
- Status = AcpiRsIoStream (LinkedList, &Buffer, &BytesConsumed);
- break;
-
- case ACPI_RSTYPE_FIXED_IO:
- /*
- * Fixed IO Port Resource
- */
- Status = AcpiRsFixedIoStream (LinkedList, &Buffer, &BytesConsumed);
- break;
-
- case ACPI_RSTYPE_VENDOR:
- /*
- * Vendor Defined Resource
- */
- Status = AcpiRsVendorStream (LinkedList, &Buffer, &BytesConsumed);
- break;
-
- case ACPI_RSTYPE_END_TAG:
- /*
- * End Tag
- */
- Status = AcpiRsEndTagStream (LinkedList, &Buffer, &BytesConsumed);
-
- /* An End Tag indicates the end of the Resource Template */
-
- Done = TRUE;
- break;
-
- case ACPI_RSTYPE_MEM24:
- /*
- * 24-Bit Memory Resource
- */
- Status = AcpiRsMemory24Stream (LinkedList, &Buffer, &BytesConsumed);
- break;
-
- case ACPI_RSTYPE_MEM32:
- /*
- * 32-Bit Memory Range Resource
- */
- Status = AcpiRsMemory32RangeStream (LinkedList, &Buffer,
- &BytesConsumed);
- break;
-
- case ACPI_RSTYPE_FIXED_MEM32:
- /*
- * 32-Bit Fixed Memory Resource
- */
- Status = AcpiRsFixedMemory32Stream (LinkedList, &Buffer,
- &BytesConsumed);
- break;
-
- case ACPI_RSTYPE_ADDRESS16:
- /*
- * 16-Bit Address Descriptor Resource
- */
- Status = AcpiRsAddress16Stream (LinkedList, &Buffer,
- &BytesConsumed);
- break;
-
- case ACPI_RSTYPE_ADDRESS32:
- /*
- * 32-Bit Address Descriptor Resource
- */
- Status = AcpiRsAddress32Stream (LinkedList, &Buffer,
- &BytesConsumed);
- break;
-
- case ACPI_RSTYPE_ADDRESS64:
- /*
- * 64-Bit Address Descriptor Resource
- */
- Status = AcpiRsAddress64Stream (LinkedList, &Buffer,
- &BytesConsumed);
- break;
-
- case ACPI_RSTYPE_EXT_IRQ:
- /*
- * Extended IRQ Resource
- */
- Status = AcpiRsExtendedIrqStream (LinkedList, &Buffer,
- &BytesConsumed);
- break;
-
- default:
- /*
- * If we get here, everything is out of sync,
- * so exit with an error
- */
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"Invalid descriptor type (%X) in resource list\n",
- LinkedList->Id));
- Status = AE_BAD_DATA;
- break;
+ Resource->Type));
+ return_ACPI_STATUS (AE_BAD_DATA);
+ }
+
+ /* Perform the conversion per resource type */
+
+ Status = AcpiGbl_SetResourceDispatch[Resource->Type] (Resource,
+ ACPI_CAST_PTR (AML_RESOURCE, AmlBuffer));
+ if (ACPI_FAILURE (Status))
+ {
+ ACPI_REPORT_ERROR (("Could not convert resource (type %X) to AML, %s\n",
+ Resource->Type, AcpiFormatException (Status)));
+ return_ACPI_STATUS (Status);
}
+ /* Perform final sanity check on the new AML resource descriptor */
+
+ Status = AcpiRsValidateResourceLength (
+ ACPI_CAST_PTR (AML_RESOURCE, AmlBuffer));
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
- /* Set the Buffer to point to the open byte */
+ /* Check for end-of-list, normal exit */
+
+ if (Resource->Type == ACPI_RESOURCE_TYPE_END_TAG)
+ {
+ /* An End Tag indicates the end of the input Resource Template */
+
+ return_ACPI_STATUS (AE_OK);
+ }
+
+ /* Extract the total length of the new descriptor */
+ /* Set the AmlBuffer to point to the next (output) resource descriptor */
- Buffer += BytesConsumed;
+ AmlBuffer += AcpiRsGetDescriptorLength (
+ ACPI_CAST_PTR (AML_RESOURCE, AmlBuffer));
- /* Point to the next object */
+ /* Point to the next input resource descriptor */
- LinkedList = ACPI_PTR_ADD (ACPI_RESOURCE,
- LinkedList, LinkedList->Length);
+ Resource = ACPI_PTR_ADD (ACPI_RESOURCE, Resource, Resource->Length);
}
-
- return_ACPI_STATUS (AE_OK);
}
diff --git a/usr/src/uts/i86pc/io/acpica/resources/rsmemory.c b/usr/src/uts/i86pc/io/acpica/resources/rsmemory.c
index 587faeda96..3f78a20f49 100644
--- a/usr/src/uts/i86pc/io/acpica/resources/rsmemory.c
+++ b/usr/src/uts/i86pc/io/acpica/resources/rsmemory.c
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: rsmem24 - Memory resource descriptors
- * $Revision: 28 $
+ * $Revision: 1.31 $
*
******************************************************************************/
@@ -125,476 +125,279 @@
/*******************************************************************************
*
- * FUNCTION: AcpiRsMemory24Resource
+ * FUNCTION: AcpiRsGetMemory24
*
- * PARAMETERS: ByteStreamBuffer - Pointer to the resource input byte
- * stream
- * BytesConsumed - Pointer to where the number of bytes
- * consumed the ByteStreamBuffer is
- * returned
- * OutputBuffer - Pointer to the return data buffer
- * StructureSize - Pointer to where the number of bytes
- * in the return data struct is returned
+ * PARAMETERS: Aml - Pointer to the AML resource descriptor
+ * AmlResourceLength - Length of the resource from the AML header
+ * Resource - Where the internal resource is returned
*
* RETURN: Status
*
- * DESCRIPTION: Take the resource byte stream and fill out the appropriate
- * structure pointed to by the OutputBuffer. Return the
- * number of bytes consumed from the byte stream.
+ * DESCRIPTION: Convert a raw AML resource descriptor to the corresponding
+ * internal resource descriptor, simplifying bitflags and handling
+ * alignment and endian issues if necessary.
*
******************************************************************************/
ACPI_STATUS
-AcpiRsMemory24Resource (
- UINT8 *ByteStreamBuffer,
- ACPI_SIZE *BytesConsumed,
- UINT8 **OutputBuffer,
- ACPI_SIZE *StructureSize)
+AcpiRsGetMemory24 (
+ AML_RESOURCE *Aml,
+ UINT16 AmlResourceLength,
+ ACPI_RESOURCE *Resource)
{
- UINT8 *Buffer = ByteStreamBuffer;
- ACPI_RESOURCE *OutputStruct = (void *) *OutputBuffer;
- UINT16 Temp16 = 0;
- UINT8 Temp8 = 0;
- ACPI_SIZE StructSize = ACPI_SIZEOF_RESOURCE (
- ACPI_RESOURCE_MEM24);
+ ACPI_FUNCTION_TRACE ("RsGetMemory24");
- ACPI_FUNCTION_TRACE ("RsMemory24Resource");
+ /* Get the Read/Write bit */
+ Resource->Data.Memory24.ReadWriteAttribute =
+ (Aml->Memory24.Information & 0x01);
- /* Point past the Descriptor to get the number of bytes consumed */
-
- Buffer += 1;
-
- ACPI_MOVE_16_TO_16 (&Temp16, Buffer);
- Buffer += 2;
- *BytesConsumed = (ACPI_SIZE) Temp16 + 3;
- OutputStruct->Id = ACPI_RSTYPE_MEM24;
-
- /* Check Byte 3 the Read/Write bit */
-
- Temp8 = *Buffer;
- Buffer += 1;
- OutputStruct->Data.Memory24.ReadWriteAttribute = Temp8 & 0x01;
-
- /* Get MinBaseAddress (Bytes 4-5) */
-
- ACPI_MOVE_16_TO_16 (&Temp16, Buffer);
- Buffer += 2;
- OutputStruct->Data.Memory24.MinBaseAddress = Temp16;
-
- /* Get MaxBaseAddress (Bytes 6-7) */
-
- ACPI_MOVE_16_TO_16 (&Temp16, Buffer);
- Buffer += 2;
- OutputStruct->Data.Memory24.MaxBaseAddress = Temp16;
-
- /* Get Alignment (Bytes 8-9) */
-
- ACPI_MOVE_16_TO_16 (&Temp16, Buffer);
- Buffer += 2;
- OutputStruct->Data.Memory24.Alignment = Temp16;
-
- /* Get RangeLength (Bytes 10-11) */
-
- ACPI_MOVE_16_TO_16 (&Temp16, Buffer);
- OutputStruct->Data.Memory24.RangeLength = Temp16;
-
- /* Set the Length parameter */
-
- OutputStruct->Length = (UINT32) StructSize;
+ /*
+ * Get the following contiguous fields from the AML descriptor:
+ * Minimum Base Address
+ * Maximum Base Address
+ * Address Base Alignment
+ * Range Length
+ */
+ AcpiRsMoveData (&Resource->Data.Memory24.Minimum,
+ &Aml->Memory24.Minimum, 4, ACPI_MOVE_TYPE_16_TO_32);
- /* Return the final size of the structure */
+ /* Complete the resource header */
- *StructureSize = StructSize;
+ Resource->Type = ACPI_RESOURCE_TYPE_MEMORY24;
+ Resource->Length = ACPI_SIZEOF_RESOURCE (ACPI_RESOURCE_MEMORY24);
return_ACPI_STATUS (AE_OK);
}
/*******************************************************************************
*
- * FUNCTION: AcpiRsMemory24Stream
+ * FUNCTION: AcpiRsSetMemory24
*
- * PARAMETERS: LinkedList - Pointer to the resource linked list
- * OutputBuffer - Pointer to the user's return buffer
- * BytesConsumed - Pointer to where the number of bytes
- * used in the OutputBuffer is returned
+ * PARAMETERS: Resource - Pointer to the resource descriptor
+ * Aml - Where the AML descriptor is returned
*
* RETURN: Status
*
- * DESCRIPTION: Take the linked list resource structure and fills in the
- * the appropriate bytes in a byte stream
+ * DESCRIPTION: Convert an internal resource descriptor to the corresponding
+ * external AML resource descriptor.
*
******************************************************************************/
ACPI_STATUS
-AcpiRsMemory24Stream (
- ACPI_RESOURCE *LinkedList,
- UINT8 **OutputBuffer,
- ACPI_SIZE *BytesConsumed)
+AcpiRsSetMemory24 (
+ ACPI_RESOURCE *Resource,
+ AML_RESOURCE *Aml)
{
- UINT8 *Buffer = *OutputBuffer;
- UINT16 Temp16 = 0;
- UINT8 Temp8 = 0;
-
-
- ACPI_FUNCTION_TRACE ("RsMemory24Stream");
+ ACPI_FUNCTION_TRACE ("RsSetMemory24");
- /* The descriptor field is static */
-
- *Buffer = 0x81;
- Buffer += 1;
-
- /* The length field is static */
-
- Temp16 = 0x09;
- ACPI_MOVE_16_TO_16 (Buffer, &Temp16);
- Buffer += 2;
-
/* Set the Information Byte */
- Temp8 = (UINT8) (LinkedList->Data.Memory24.ReadWriteAttribute & 0x01);
- *Buffer = Temp8;
- Buffer += 1;
-
- /* Set the Range minimum base address */
+ Aml->Memory24.Information = (UINT8)
+ (Resource->Data.Memory24.ReadWriteAttribute & 0x01);
- ACPI_MOVE_32_TO_16 (Buffer, &LinkedList->Data.Memory24.MinBaseAddress);
- Buffer += 2;
-
- /* Set the Range maximum base address */
-
- ACPI_MOVE_32_TO_16 (Buffer, &LinkedList->Data.Memory24.MaxBaseAddress);
- Buffer += 2;
-
- /* Set the base alignment */
-
- ACPI_MOVE_32_TO_16 (Buffer, &LinkedList->Data.Memory24.Alignment);
- Buffer += 2;
-
- /* Set the range length */
-
- ACPI_MOVE_32_TO_16 (Buffer, &LinkedList->Data.Memory24.RangeLength);
- Buffer += 2;
+ /*
+ * Set the following contiguous fields in the AML descriptor:
+ * Minimum Base Address
+ * Maximum Base Address
+ * Address Base Alignment
+ * Range Length
+ */
+ AcpiRsMoveData (&Aml->Memory24.Minimum,
+ &Resource->Data.Memory24.Minimum, 4, ACPI_MOVE_TYPE_32_TO_16);
- /* Return the number of bytes consumed in this operation */
+ /* Complete the AML descriptor header */
- *BytesConsumed = ACPI_PTR_DIFF (Buffer, *OutputBuffer);
+ AcpiRsSetResourceHeader (ACPI_RESOURCE_NAME_MEMORY24,
+ sizeof (AML_RESOURCE_MEMORY24), Aml);
return_ACPI_STATUS (AE_OK);
}
/*******************************************************************************
*
- * FUNCTION: AcpiRsMemory32RangeResource
+ * FUNCTION: AcpiRsGetMemory32
*
- * PARAMETERS: ByteStreamBuffer - Pointer to the resource input byte
- * stream
- * BytesConsumed - Pointer to where the number of bytes
- * consumed the ByteStreamBuffer is
- * returned
- * OutputBuffer - Pointer to the return data buffer
- * StructureSize - Pointer to where the number of bytes
- * in the return data struct is returned
+ * PARAMETERS: Aml - Pointer to the AML resource descriptor
+ * AmlResourceLength - Length of the resource from the AML header
+ * Resource - Where the internal resource is returned
*
* RETURN: Status
*
- * DESCRIPTION: Take the resource byte stream and fill out the appropriate
- * structure pointed to by the OutputBuffer. Return the
- * number of bytes consumed from the byte stream.
+ * DESCRIPTION: Convert a raw AML resource descriptor to the corresponding
+ * internal resource descriptor, simplifying bitflags and handling
+ * alignment and endian issues if necessary.
*
******************************************************************************/
ACPI_STATUS
-AcpiRsMemory32RangeResource (
- UINT8 *ByteStreamBuffer,
- ACPI_SIZE *BytesConsumed,
- UINT8 **OutputBuffer,
- ACPI_SIZE *StructureSize)
+AcpiRsGetMemory32 (
+ AML_RESOURCE *Aml,
+ UINT16 AmlResourceLength,
+ ACPI_RESOURCE *Resource)
{
- UINT8 *Buffer = ByteStreamBuffer;
- ACPI_RESOURCE *OutputStruct = (void *) *OutputBuffer;
- UINT16 Temp16 = 0;
- UINT8 Temp8 = 0;
- ACPI_SIZE StructSize = ACPI_SIZEOF_RESOURCE (
- ACPI_RESOURCE_MEM32);
-
-
- ACPI_FUNCTION_TRACE ("RsMemory32RangeResource");
-
-
- /* Point past the Descriptor to get the number of bytes consumed */
+ ACPI_FUNCTION_TRACE ("RsGetMemory32");
- Buffer += 1;
- ACPI_MOVE_16_TO_16 (&Temp16, Buffer);
- Buffer += 2;
- *BytesConsumed = (ACPI_SIZE) Temp16 + 3;
+ /* Get the Read/Write bit */
- OutputStruct->Id = ACPI_RSTYPE_MEM32;
+ Resource->Data.Memory32.ReadWriteAttribute =
+ (Aml->Memory32.Information & 0x01);
/*
- * Point to the place in the output buffer where the data portion will
- * begin.
- * 1. Set the RESOURCE_DATA * Data to point to its own address, then
- * 2. Set the pointer to the next address.
- *
- * NOTE: OutputStruct->Data is cast to UINT8, otherwise, this addition adds
- * 4 * sizeof(RESOURCE_DATA) instead of 4 * sizeof(UINT8)
+ * Get the following contiguous fields from the AML descriptor:
+ * Minimum Base Address
+ * Maximum Base Address
+ * Address Base Alignment
+ * Range Length
*/
+ AcpiRsMoveData (&Resource->Data.Memory32.Minimum,
+ &Aml->Memory32.Minimum, 4, ACPI_MOVE_TYPE_32_TO_32);
- /* Check Byte 3 the Read/Write bit */
-
- Temp8 = *Buffer;
- Buffer += 1;
-
- OutputStruct->Data.Memory32.ReadWriteAttribute = Temp8 & 0x01;
-
- /* Get MinBaseAddress (Bytes 4-7) */
-
- ACPI_MOVE_32_TO_32 (&OutputStruct->Data.Memory32.MinBaseAddress, Buffer);
- Buffer += 4;
-
- /* Get MaxBaseAddress (Bytes 8-11) */
-
- ACPI_MOVE_32_TO_32 (&OutputStruct->Data.Memory32.MaxBaseAddress, Buffer);
- Buffer += 4;
-
- /* Get Alignment (Bytes 12-15) */
-
- ACPI_MOVE_32_TO_32 (&OutputStruct->Data.Memory32.Alignment, Buffer);
- Buffer += 4;
-
- /* Get RangeLength (Bytes 16-19) */
-
- ACPI_MOVE_32_TO_32 (&OutputStruct->Data.Memory32.RangeLength, Buffer);
-
- /* Set the Length parameter */
+ /* Complete the resource header */
- OutputStruct->Length = (UINT32) StructSize;
-
- /* Return the final size of the structure */
-
- *StructureSize = StructSize;
+ Resource->Type = ACPI_RESOURCE_TYPE_MEMORY32;
+ Resource->Length = ACPI_SIZEOF_RESOURCE (ACPI_RESOURCE_MEMORY32);
return_ACPI_STATUS (AE_OK);
}
/*******************************************************************************
*
- * FUNCTION: AcpiRsFixedMemory32Resource
+ * FUNCTION: AcpiRsSetMemory32
*
- * PARAMETERS: ByteStreamBuffer - Pointer to the resource input byte
- * stream
- * BytesConsumed - Pointer to where the number of bytes
- * consumed the ByteStreamBuffer is
- * returned
- * OutputBuffer - Pointer to the return data buffer
- * StructureSize - Pointer to where the number of bytes
- * in the return data struct is returned
+ * PARAMETERS: Resource - Pointer to the resource descriptor
+ * Aml - Where the AML descriptor is returned
*
* RETURN: Status
*
- * DESCRIPTION: Take the resource byte stream and fill out the appropriate
- * structure pointed to by the OutputBuffer. Return the
- * number of bytes consumed from the byte stream.
+ * DESCRIPTION: Convert an internal resource descriptor to the corresponding
+ * external AML resource descriptor.
*
******************************************************************************/
ACPI_STATUS
-AcpiRsFixedMemory32Resource (
- UINT8 *ByteStreamBuffer,
- ACPI_SIZE *BytesConsumed,
- UINT8 **OutputBuffer,
- ACPI_SIZE *StructureSize)
+AcpiRsSetMemory32 (
+ ACPI_RESOURCE *Resource,
+ AML_RESOURCE *Aml)
{
- UINT8 *Buffer = ByteStreamBuffer;
- ACPI_RESOURCE *OutputStruct = (void *) *OutputBuffer;
- UINT16 Temp16 = 0;
- UINT8 Temp8 = 0;
- ACPI_SIZE StructSize = ACPI_SIZEOF_RESOURCE (
- ACPI_RESOURCE_FIXED_MEM32);
-
-
- ACPI_FUNCTION_TRACE ("RsFixedMemory32Resource");
-
-
- /* Point past the Descriptor to get the number of bytes consumed */
-
- Buffer += 1;
- ACPI_MOVE_16_TO_16 (&Temp16, Buffer);
-
- Buffer += 2;
- *BytesConsumed = (ACPI_SIZE) Temp16 + 3;
-
- OutputStruct->Id = ACPI_RSTYPE_FIXED_MEM32;
-
- /* Check Byte 3 the Read/Write bit */
-
- Temp8 = *Buffer;
- Buffer += 1;
- OutputStruct->Data.FixedMemory32.ReadWriteAttribute = Temp8 & 0x01;
-
- /* Get RangeBaseAddress (Bytes 4-7) */
+ ACPI_FUNCTION_TRACE ("RsSetMemory32");
- ACPI_MOVE_32_TO_32 (&OutputStruct->Data.FixedMemory32.RangeBaseAddress,
- Buffer);
- Buffer += 4;
- /* Get RangeLength (Bytes 8-11) */
-
- ACPI_MOVE_32_TO_32 (&OutputStruct->Data.FixedMemory32.RangeLength, Buffer);
+ /* Set the Information Byte */
- /* Set the Length parameter */
+ Aml->Memory32.Information = (UINT8)
+ (Resource->Data.Memory32.ReadWriteAttribute & 0x01);
- OutputStruct->Length = (UINT32) StructSize;
+ /*
+ * Set the following contiguous fields in the AML descriptor:
+ * Minimum Base Address
+ * Maximum Base Address
+ * Address Base Alignment
+ * Range Length
+ */
+ AcpiRsMoveData (&Aml->Memory32.Minimum,
+ &Resource->Data.Memory32.Minimum, 4, ACPI_MOVE_TYPE_32_TO_32);
- /* Return the final size of the structure */
+ /* Complete the AML descriptor header */
- *StructureSize = StructSize;
+ AcpiRsSetResourceHeader (ACPI_RESOURCE_NAME_MEMORY32,
+ sizeof (AML_RESOURCE_MEMORY32), Aml);
return_ACPI_STATUS (AE_OK);
}
/*******************************************************************************
*
- * FUNCTION: AcpiRsMemory32RangeStream
+ * FUNCTION: AcpiRsGetFixedMemory32
*
- * PARAMETERS: LinkedList - Pointer to the resource linked list
- * OutputBuffer - Pointer to the user's return buffer
- * BytesConsumed - Pointer to where the number of bytes
- * used in the OutputBuffer is returned
+ * PARAMETERS: Aml - Pointer to the AML resource descriptor
+ * AmlResourceLength - Length of the resource from the AML header
+ * Resource - Where the internal resource is returned
*
* RETURN: Status
*
- * DESCRIPTION: Take the linked list resource structure and fills in the
- * the appropriate bytes in a byte stream
+ * DESCRIPTION: Convert a raw AML resource descriptor to the corresponding
+ * internal resource descriptor, simplifying bitflags and handling
+ * alignment and endian issues if necessary.
*
******************************************************************************/
ACPI_STATUS
-AcpiRsMemory32RangeStream (
- ACPI_RESOURCE *LinkedList,
- UINT8 **OutputBuffer,
- ACPI_SIZE *BytesConsumed)
+AcpiRsGetFixedMemory32 (
+ AML_RESOURCE *Aml,
+ UINT16 AmlResourceLength,
+ ACPI_RESOURCE *Resource)
{
- UINT8 *Buffer = *OutputBuffer;
- UINT16 Temp16 = 0;
- UINT8 Temp8 = 0;
-
-
- ACPI_FUNCTION_TRACE ("RsMemory32RangeStream");
+ ACPI_FUNCTION_TRACE ("RsGetFixedMemory32");
- /* The descriptor field is static */
+ /* Get the Read/Write bit */
- *Buffer = 0x85;
- Buffer += 1;
-
- /* The length field is static */
-
- Temp16 = 0x11;
-
- ACPI_MOVE_16_TO_16 (Buffer, &Temp16);
- Buffer += 2;
-
- /* Set the Information Byte */
+ Resource->Data.FixedMemory32.ReadWriteAttribute =
+ (Aml->FixedMemory32.Information & 0x01);
- Temp8 = (UINT8) (LinkedList->Data.Memory32.ReadWriteAttribute & 0x01);
- *Buffer = Temp8;
- Buffer += 1;
-
- /* Set the Range minimum base address */
-
- ACPI_MOVE_32_TO_32 (Buffer, &LinkedList->Data.Memory32.MinBaseAddress);
- Buffer += 4;
-
- /* Set the Range maximum base address */
-
- ACPI_MOVE_32_TO_32 (Buffer, &LinkedList->Data.Memory32.MaxBaseAddress);
- Buffer += 4;
-
- /* Set the base alignment */
-
- ACPI_MOVE_32_TO_32 (Buffer, &LinkedList->Data.Memory32.Alignment);
- Buffer += 4;
-
- /* Set the range length */
-
- ACPI_MOVE_32_TO_32 (Buffer, &LinkedList->Data.Memory32.RangeLength);
- Buffer += 4;
+ /*
+ * Get the following contiguous fields from the AML descriptor:
+ * Base Address
+ * Range Length
+ */
+ ACPI_MOVE_32_TO_32 (&Resource->Data.FixedMemory32.Address,
+ &Aml->FixedMemory32.Address);
+ ACPI_MOVE_32_TO_32 (&Resource->Data.FixedMemory32.AddressLength,
+ &Aml->FixedMemory32.AddressLength);
- /* Return the number of bytes consumed in this operation */
+ /* Complete the resource header */
- *BytesConsumed = ACPI_PTR_DIFF (Buffer, *OutputBuffer);
+ Resource->Type = ACPI_RESOURCE_TYPE_FIXED_MEMORY32;
+ Resource->Length = ACPI_SIZEOF_RESOURCE (ACPI_RESOURCE_FIXED_MEMORY32);
return_ACPI_STATUS (AE_OK);
}
/*******************************************************************************
*
- * FUNCTION: AcpiRsFixedMemory32Stream
+ * FUNCTION: AcpiRsSetFixedMemory32
*
- * PARAMETERS: LinkedList - Pointer to the resource linked list
- * OutputBuffer - Pointer to the user's return buffer
- * BytesConsumed - Pointer to where the number of bytes
- * used in the OutputBuffer is returned
+ * PARAMETERS: Resource - Pointer to the resource descriptor
+ * Aml - Where the AML descriptor is returned
*
* RETURN: Status
*
- * DESCRIPTION: Take the linked list resource structure and fills in the
- * the appropriate bytes in a byte stream
+ * DESCRIPTION: Convert an internal resource descriptor to the corresponding
+ * external AML resource descriptor.
*
******************************************************************************/
ACPI_STATUS
-AcpiRsFixedMemory32Stream (
- ACPI_RESOURCE *LinkedList,
- UINT8 **OutputBuffer,
- ACPI_SIZE *BytesConsumed)
+AcpiRsSetFixedMemory32 (
+ ACPI_RESOURCE *Resource,
+ AML_RESOURCE *Aml)
{
- UINT8 *Buffer = *OutputBuffer;
- UINT16 Temp16 = 0;
- UINT8 Temp8 = 0;
-
+ ACPI_FUNCTION_TRACE ("RsSetFixedMemory32");
- ACPI_FUNCTION_TRACE ("RsFixedMemory32Stream");
-
-
- /* The descriptor field is static */
-
- *Buffer = 0x86;
- Buffer += 1;
-
- /* The length field is static */
-
- Temp16 = 0x09;
-
- ACPI_MOVE_16_TO_16 (Buffer, &Temp16);
- Buffer += 2;
/* Set the Information Byte */
- Temp8 = (UINT8) (LinkedList->Data.FixedMemory32.ReadWriteAttribute & 0x01);
- *Buffer = Temp8;
- Buffer += 1;
+ Aml->FixedMemory32.Information = (UINT8)
+ (Resource->Data.FixedMemory32.ReadWriteAttribute & 0x01);
- /* Set the Range base address */
-
- ACPI_MOVE_32_TO_32 (Buffer,
- &LinkedList->Data.FixedMemory32.RangeBaseAddress);
- Buffer += 4;
-
- /* Set the range length */
-
- ACPI_MOVE_32_TO_32 (Buffer,
- &LinkedList->Data.FixedMemory32.RangeLength);
- Buffer += 4;
+ /*
+ * Set the following contiguous fields in the AML descriptor:
+ * Base Address
+ * Range Length
+ */
+ ACPI_MOVE_32_TO_32 (&Aml->FixedMemory32.Address,
+ &Resource->Data.FixedMemory32.Address);
+ ACPI_MOVE_32_TO_32 (&Aml->FixedMemory32.AddressLength,
+ &Resource->Data.FixedMemory32.AddressLength);
- /* Return the number of bytes consumed in this operation */
+ /* Complete the AML descriptor header */
- *BytesConsumed = ACPI_PTR_DIFF (Buffer, *OutputBuffer);
+ AcpiRsSetResourceHeader (ACPI_RESOURCE_NAME_FIXED_MEMORY32,
+ sizeof (AML_RESOURCE_FIXED_MEMORY32), Aml);
return_ACPI_STATUS (AE_OK);
}
diff --git a/usr/src/uts/i86pc/io/acpica/resources/rsmisc.c b/usr/src/uts/i86pc/io/acpica/resources/rsmisc.c
index ed4c1126e2..6859d7fbca 100644
--- a/usr/src/uts/i86pc/io/acpica/resources/rsmisc.c
+++ b/usr/src/uts/i86pc/io/acpica/resources/rsmisc.c
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: rsmisc - Miscellaneous resource descriptors
- * $Revision: 29 $
+ * $Revision: 1.34 $
*
******************************************************************************/
@@ -125,531 +125,466 @@
/*******************************************************************************
*
- * FUNCTION: AcpiRsEndTagResource
+ * FUNCTION: AcpiRsGetGenericReg
*
- * PARAMETERS: ByteStreamBuffer - Pointer to the resource input byte
- * stream
- * BytesConsumed - Pointer to where the number of bytes
- * consumed the ByteStreamBuffer is
- * returned
- * OutputBuffer - Pointer to the return data buffer
- * StructureSize - Pointer to where the number of bytes
- * in the return data struct is returned
+ * PARAMETERS: Aml - Pointer to the AML resource descriptor
+ * AmlResourceLength - Length of the resource from the AML header
+ * Resource - Where the internal resource is returned
*
* RETURN: Status
*
- * DESCRIPTION: Take the resource byte stream and fill out the appropriate
- * structure pointed to by the OutputBuffer. Return the
- * number of bytes consumed from the byte stream.
+ * DESCRIPTION: Convert a raw AML resource descriptor to the corresponding
+ * internal resource descriptor, simplifying bitflags and handling
+ * alignment and endian issues if necessary.
*
******************************************************************************/
ACPI_STATUS
-AcpiRsEndTagResource (
- UINT8 *ByteStreamBuffer,
- ACPI_SIZE *BytesConsumed,
- UINT8 **OutputBuffer,
- ACPI_SIZE *StructureSize)
+AcpiRsGetGenericReg (
+ AML_RESOURCE *Aml,
+ UINT16 AmlResourceLength,
+ ACPI_RESOURCE *Resource)
{
- ACPI_RESOURCE *OutputStruct = (void *) *OutputBuffer;
- ACPI_SIZE StructSize = ACPI_RESOURCE_LENGTH;
+ ACPI_FUNCTION_TRACE ("RsGetGenericReg");
- ACPI_FUNCTION_TRACE ("RsEndTagResource");
-
-
- /* The number of bytes consumed is static */
-
- *BytesConsumed = 2;
-
- /* Fill out the structure */
-
- OutputStruct->Id = ACPI_RSTYPE_END_TAG;
-
- /* Set the Length parameter */
-
- OutputStruct->Length = 0;
+ /*
+ * Get the following fields from the AML descriptor:
+ * Address Space ID
+ * Register Bit Width
+ * Register Bit Offset
+ * Access Size
+ * Register Address
+ */
+ Resource->Data.GenericReg.SpaceId = Aml->GenericReg.AddressSpaceId;
+ Resource->Data.GenericReg.BitWidth = Aml->GenericReg.BitWidth;
+ Resource->Data.GenericReg.BitOffset = Aml->GenericReg.BitOffset;
+ Resource->Data.GenericReg.AccessSize = Aml->GenericReg.AccessSize;
+ ACPI_MOVE_64_TO_64 (&Resource->Data.GenericReg.Address,
+ &Aml->GenericReg.Address);
- /* Return the final size of the structure */
+ /* Complete the resource header */
- *StructureSize = StructSize;
+ Resource->Type = ACPI_RESOURCE_TYPE_GENERIC_REGISTER;
+ Resource->Length = ACPI_SIZEOF_RESOURCE (ACPI_RESOURCE_GENERIC_REGISTER);
return_ACPI_STATUS (AE_OK);
}
/*******************************************************************************
*
- * FUNCTION: AcpiRsEndTagStream
+ * FUNCTION: AcpiRsSetGenericReg
*
- * PARAMETERS: LinkedList - Pointer to the resource linked list
- * OutputBuffer - Pointer to the user's return buffer
- * BytesConsumed - Pointer to where the number of bytes
- * used in the OutputBuffer is returned
+ * PARAMETERS: Resource - Pointer to the resource descriptor
+ * Aml - Where the AML descriptor is returned
*
* RETURN: Status
*
- * DESCRIPTION: Take the linked list resource structure and fills in the
- * the appropriate bytes in a byte stream
+ * DESCRIPTION: Convert an internal resource descriptor to the corresponding
+ * external AML resource descriptor.
*
******************************************************************************/
ACPI_STATUS
-AcpiRsEndTagStream (
- ACPI_RESOURCE *LinkedList,
- UINT8 **OutputBuffer,
- ACPI_SIZE *BytesConsumed)
+AcpiRsSetGenericReg (
+ ACPI_RESOURCE *Resource,
+ AML_RESOURCE *Aml)
{
- UINT8 *Buffer = *OutputBuffer;
- UINT8 Temp8 = 0;
-
-
- ACPI_FUNCTION_TRACE ("RsEndTagStream");
-
-
- /* The descriptor field is static */
+ ACPI_FUNCTION_TRACE ("RsSetGenericReg");
- *Buffer = 0x79;
- Buffer += 1;
/*
- * Set the Checksum - zero means that the resource data is treated as if
- * the checksum operation succeeded (ACPI Spec 1.0b Section 6.4.2.8)
+ * Set the following fields in the AML descriptor:
+ * Address Space ID
+ * Register Bit Width
+ * Register Bit Offset
+ * Access Size
+ * Register Address
*/
- Temp8 = 0;
+ Aml->GenericReg.AddressSpaceId = (UINT8) Resource->Data.GenericReg.SpaceId;
+ Aml->GenericReg.BitWidth = (UINT8) Resource->Data.GenericReg.BitWidth;
+ Aml->GenericReg.BitOffset = (UINT8) Resource->Data.GenericReg.BitOffset;
+ Aml->GenericReg.AccessSize = (UINT8) Resource->Data.GenericReg.AccessSize;
+ ACPI_MOVE_64_TO_64 (&Aml->GenericReg.Address,
+ &Resource->Data.GenericReg.Address);
- *Buffer = Temp8;
- Buffer += 1;
+ /* Complete the AML descriptor header */
- /* Return the number of bytes consumed in this operation */
-
- *BytesConsumed = ACPI_PTR_DIFF (Buffer, *OutputBuffer);
+ AcpiRsSetResourceHeader (ACPI_RESOURCE_NAME_GENERIC_REGISTER,
+ sizeof (AML_RESOURCE_GENERIC_REGISTER), Aml);
return_ACPI_STATUS (AE_OK);
}
/*******************************************************************************
*
- * FUNCTION: AcpiRsVendorResource
+ * FUNCTION: AcpiRsGetVendor
*
- * PARAMETERS: ByteStreamBuffer - Pointer to the resource input byte
- * stream
- * BytesConsumed - Pointer to where the number of bytes
- * consumed the ByteStreamBuffer is
- * returned
- * OutputBuffer - Pointer to the return data buffer
- * StructureSize - Pointer to where the number of bytes
- * in the return data struct is returned
+ * PARAMETERS: Aml - Pointer to the AML resource descriptor
+ * AmlResourceLength - Length of the resource from the AML header
+ * Resource - Where the internal resource is returned
*
* RETURN: Status
*
- * DESCRIPTION: Take the resource byte stream and fill out the appropriate
- * structure pointed to by the OutputBuffer. Return the
- * number of bytes consumed from the byte stream.
+ * DESCRIPTION: Convert a raw AML resource descriptor to the corresponding
+ * internal resource descriptor, simplifying bitflags and handling
+ * alignment and endian issues if necessary.
*
******************************************************************************/
ACPI_STATUS
-AcpiRsVendorResource (
- UINT8 *ByteStreamBuffer,
- ACPI_SIZE *BytesConsumed,
- UINT8 **OutputBuffer,
- ACPI_SIZE *StructureSize)
+AcpiRsGetVendor (
+ AML_RESOURCE *Aml,
+ UINT16 AmlResourceLength,
+ ACPI_RESOURCE *Resource)
{
- UINT8 *Buffer = ByteStreamBuffer;
- ACPI_RESOURCE *OutputStruct = (void *) *OutputBuffer;
- UINT16 Temp16 = 0;
- UINT8 Temp8 = 0;
- UINT8 Index;
- ACPI_SIZE StructSize = ACPI_SIZEOF_RESOURCE (
- ACPI_RESOURCE_VENDOR);
-
+ UINT8 *AmlByteData;
- ACPI_FUNCTION_TRACE ("RsVendorResource");
+ ACPI_FUNCTION_TRACE ("RsGetVendor");
- /* Dereference the Descriptor to find if this is a large or small item. */
- Temp8 = *Buffer;
+ /* Determine if this is a large or small vendor specific item */
- if (Temp8 & 0x80)
+ if (Aml->LargeHeader.DescriptorType & ACPI_RESOURCE_NAME_LARGE)
{
- /* Large Item, point to the length field */
-
- Buffer += 1;
-
- /* Dereference */
-
- ACPI_MOVE_16_TO_16 (&Temp16, Buffer);
+ /* Large item, Point to the first vendor byte */
- /* Calculate bytes consumed */
-
- *BytesConsumed = (ACPI_SIZE) Temp16 + 3;
-
- /* Point to the first vendor byte */
-
- Buffer += 2;
+ AmlByteData = ((UINT8 *) Aml) + sizeof (AML_RESOURCE_LARGE_HEADER);
}
else
{
- /* Small Item, dereference the size */
-
- Temp16 = (UINT8)(*Buffer & 0x07);
-
- /* Calculate bytes consumed */
-
- *BytesConsumed = (ACPI_SIZE) Temp16 + 1;
+ /* Small item, Point to the first vendor byte */
- /* Point to the first vendor byte */
-
- Buffer += 1;
+ AmlByteData = ((UINT8 *) Aml) + sizeof (AML_RESOURCE_SMALL_HEADER);
}
- OutputStruct->Id = ACPI_RSTYPE_VENDOR;
- OutputStruct->Data.VendorSpecific.Length = Temp16;
+ /* Copy the vendor-specific bytes */
- for (Index = 0; Index < Temp16; Index++)
- {
- OutputStruct->Data.VendorSpecific.Reserved[Index] = *Buffer;
- Buffer += 1;
- }
+ ACPI_MEMCPY (Resource->Data.Vendor.ByteData,
+ AmlByteData, AmlResourceLength);
+ Resource->Data.Vendor.ByteLength = AmlResourceLength;
/*
* In order for the StructSize to fall on a 32-bit boundary,
* calculate the length of the vendor string and expand the
* StructSize to the next 32-bit boundary.
*/
- StructSize += ACPI_ROUND_UP_TO_32BITS (Temp16);
-
- /* Set the Length parameter */
-
- OutputStruct->Length = (UINT32) StructSize;
-
- /* Return the final size of the structure */
-
- *StructureSize = StructSize;
+ Resource->Type = ACPI_RESOURCE_TYPE_VENDOR;
+ Resource->Length = ACPI_SIZEOF_RESOURCE (ACPI_RESOURCE_VENDOR) +
+ ACPI_ROUND_UP_TO_32BITS (AmlResourceLength);
return_ACPI_STATUS (AE_OK);
}
/*******************************************************************************
*
- * FUNCTION: AcpiRsVendorStream
+ * FUNCTION: AcpiRsSetVendor
*
- * PARAMETERS: LinkedList - Pointer to the resource linked list
- * OutputBuffer - Pointer to the user's return buffer
- * BytesConsumed - Pointer to where the number of bytes
- * used in the OutputBuffer is returned
+ * PARAMETERS: Resource - Pointer to the resource descriptor
+ * Aml - Where the AML descriptor is returned
*
* RETURN: Status
*
- * DESCRIPTION: Take the linked list resource structure and fills in the
- * the appropriate bytes in a byte stream
+ * DESCRIPTION: Convert an internal resource descriptor to the corresponding
+ * external AML resource descriptor.
*
******************************************************************************/
ACPI_STATUS
-AcpiRsVendorStream (
- ACPI_RESOURCE *LinkedList,
- UINT8 **OutputBuffer,
- ACPI_SIZE *BytesConsumed)
+AcpiRsSetVendor (
+ ACPI_RESOURCE *Resource,
+ AML_RESOURCE *Aml)
{
- UINT8 *Buffer = *OutputBuffer;
- UINT16 Temp16 = 0;
- UINT8 Temp8 = 0;
- UINT8 Index;
+ UINT32 ResourceLength;
+ UINT8 *Source;
+ UINT8 *Destination;
- ACPI_FUNCTION_TRACE ("RsVendorStream");
+ ACPI_FUNCTION_TRACE ("RsSetVendor");
- /* Dereference the length to find if this is a large or small item. */
+ ResourceLength = Resource->Data.Vendor.ByteLength;
+ Source = ACPI_CAST_PTR (UINT8, Resource->Data.Vendor.ByteData);
- if(LinkedList->Data.VendorSpecific.Length > 7)
+ /* Length determines if this is a large or small resource */
+
+ if (ResourceLength > 7)
{
- /* Large Item, Set the descriptor field and length bytes */
+ /* Large item, get pointer to the data part of the descriptor */
- *Buffer = 0x84;
- Buffer += 1;
+ Destination = ((UINT8 *) Aml) + sizeof (AML_RESOURCE_LARGE_HEADER);
- Temp16 = (UINT16) LinkedList->Data.VendorSpecific.Length;
+ /* Complete the AML descriptor header */
- ACPI_MOVE_16_TO_16 (Buffer, &Temp16);
- Buffer += 2;
+ AcpiRsSetResourceHeader (ACPI_RESOURCE_NAME_VENDOR_LARGE,
+ (UINT32) (ResourceLength + sizeof (AML_RESOURCE_LARGE_HEADER)), Aml);
}
else
{
- /* Small Item, Set the descriptor field */
-
- Temp8 = 0x70;
- Temp8 |= (UINT8) LinkedList->Data.VendorSpecific.Length;
-
- *Buffer = Temp8;
- Buffer += 1;
- }
+ /* Small item, get pointer to the data part of the descriptor */
- /* Loop through all of the Vendor Specific fields */
+ Destination = ((UINT8 *) Aml) + sizeof (AML_RESOURCE_SMALL_HEADER);
- for (Index = 0; Index < LinkedList->Data.VendorSpecific.Length; Index++)
- {
- Temp8 = LinkedList->Data.VendorSpecific.Reserved[Index];
+ /* Complete the AML descriptor header */
- *Buffer = Temp8;
- Buffer += 1;
+ AcpiRsSetResourceHeader (ACPI_RESOURCE_NAME_VENDOR_SMALL,
+ (UINT32) (ResourceLength + sizeof (AML_RESOURCE_SMALL_HEADER)), Aml);
}
- /* Return the number of bytes consumed in this operation */
+ /* Copy the vendor-specific bytes */
- *BytesConsumed = ACPI_PTR_DIFF (Buffer, *OutputBuffer);
+ ACPI_MEMCPY (Destination, Source, ResourceLength);
return_ACPI_STATUS (AE_OK);
}
/*******************************************************************************
*
- * FUNCTION: AcpiRsStartDependFnsResource
+ * FUNCTION: AcpiRsGetStartDpf
*
- * PARAMETERS: ByteStreamBuffer - Pointer to the resource input byte
- * stream
- * BytesConsumed - Pointer to where the number of bytes
- * consumed the ByteStreamBuffer is
- * returned
- * OutputBuffer - Pointer to the return data buffer
- * StructureSize - Pointer to where the number of bytes
- * in the return data struct is returned
+ * PARAMETERS: Aml - Pointer to the AML resource descriptor
+ * AmlResourceLength - Length of the resource from the AML header
+ * Resource - Where the internal resource is returned
*
* RETURN: Status
*
- * DESCRIPTION: Take the resource byte stream and fill out the appropriate
- * structure pointed to by the OutputBuffer. Return the
- * number of bytes consumed from the byte stream.
+ * DESCRIPTION: Convert a raw AML resource descriptor to the corresponding
+ * internal resource descriptor, simplifying bitflags and handling
+ * alignment and endian issues if necessary.
*
******************************************************************************/
ACPI_STATUS
-AcpiRsStartDependFnsResource (
- UINT8 *ByteStreamBuffer,
- ACPI_SIZE *BytesConsumed,
- UINT8 **OutputBuffer,
- ACPI_SIZE *StructureSize)
+AcpiRsGetStartDpf (
+ AML_RESOURCE *Aml,
+ UINT16 AmlResourceLength,
+ ACPI_RESOURCE *Resource)
{
- UINT8 *Buffer = ByteStreamBuffer;
- ACPI_RESOURCE *OutputStruct = (void *) *OutputBuffer;
- UINT8 Temp8 = 0;
- ACPI_SIZE StructSize = ACPI_SIZEOF_RESOURCE (
- ACPI_RESOURCE_START_DPF);
-
+ ACPI_FUNCTION_TRACE ("RsGetStartDpf");
- ACPI_FUNCTION_TRACE ("RsStartDependFnsResource");
+ /* Get the flags byte if present */
- /* The number of bytes consumed are found in the descriptor (Bits:0-1) */
-
- Temp8 = *Buffer;
-
- *BytesConsumed = (Temp8 & 0x01) + 1;
-
- OutputStruct->Id = ACPI_RSTYPE_START_DPF;
-
- /* Point to Byte 1 if it is used */
-
- if (2 == *BytesConsumed)
+ if (AmlResourceLength == 1)
{
- Buffer += 1;
- Temp8 = *Buffer;
-
- /* Check Compatibility priority */
+ /* Get the Compatibility priority */
- OutputStruct->Data.StartDpf.CompatibilityPriority = Temp8 & 0x03;
+ Resource->Data.StartDpf.CompatibilityPriority =
+ (Aml->StartDpf.Flags & 0x03);
- if (3 == OutputStruct->Data.StartDpf.CompatibilityPriority)
+ if (Resource->Data.StartDpf.CompatibilityPriority >= 3)
{
return_ACPI_STATUS (AE_AML_BAD_RESOURCE_VALUE);
}
- /* Check Performance/Robustness preference */
+ /* Get the Performance/Robustness preference */
- OutputStruct->Data.StartDpf.PerformanceRobustness = (Temp8 >> 2) & 0x03;
+ Resource->Data.StartDpf.PerformanceRobustness =
+ ((Aml->StartDpf.Flags >> 2) & 0x03);
- if (3 == OutputStruct->Data.StartDpf.PerformanceRobustness)
+ if (Resource->Data.StartDpf.PerformanceRobustness >= 3)
{
return_ACPI_STATUS (AE_AML_BAD_RESOURCE_VALUE);
}
}
else
{
- OutputStruct->Data.StartDpf.CompatibilityPriority =
+ /* StartDependentNoPri(), no flags byte, set defaults */
+
+ Resource->Data.StartDpf.CompatibilityPriority =
ACPI_ACCEPTABLE_CONFIGURATION;
- OutputStruct->Data.StartDpf.PerformanceRobustness =
+ Resource->Data.StartDpf.PerformanceRobustness =
ACPI_ACCEPTABLE_CONFIGURATION;
}
- /* Set the Length parameter */
-
- OutputStruct->Length = (UINT32) StructSize;
-
- /* Return the final size of the structure */
+ /* Complete the resource header */
- *StructureSize = StructSize;
+ Resource->Type = ACPI_RESOURCE_TYPE_START_DEPENDENT;
+ Resource->Length = ACPI_SIZEOF_RESOURCE (ACPI_RESOURCE_START_DEPENDENT);
return_ACPI_STATUS (AE_OK);
}
/*******************************************************************************
*
- * FUNCTION: AcpiRsEndDependFnsResource
+ * FUNCTION: AcpiRsSetStartDpf
*
- * PARAMETERS: ByteStreamBuffer - Pointer to the resource input byte
- * stream
- * BytesConsumed - Pointer to where the number of bytes
- * consumed the ByteStreamBuffer is
- * returned
- * OutputBuffer - Pointer to the return data buffer
- * StructureSize - Pointer to where the number of bytes
- * in the return data struct is returned
+ * PARAMETERS: Resource - Pointer to the resource descriptor
+ * Aml - Where the AML descriptor is returned
*
* RETURN: Status
*
- * DESCRIPTION: Take the resource byte stream and fill out the appropriate
- * structure pointed to by the OutputBuffer. Return the
- * number of bytes consumed from the byte stream.
+ * DESCRIPTION: Convert an internal resource descriptor to the corresponding
+ * external AML resource descriptor.
*
******************************************************************************/
ACPI_STATUS
-AcpiRsEndDependFnsResource (
- UINT8 *ByteStreamBuffer,
- ACPI_SIZE *BytesConsumed,
- UINT8 **OutputBuffer,
- ACPI_SIZE *StructureSize)
+AcpiRsSetStartDpf (
+ ACPI_RESOURCE *Resource,
+ AML_RESOURCE *Aml)
{
- ACPI_RESOURCE *OutputStruct = (void *) *OutputBuffer;
- ACPI_SIZE StructSize = ACPI_RESOURCE_LENGTH;
+ ACPI_FUNCTION_TRACE ("RsSetStartDpf");
- ACPI_FUNCTION_TRACE ("RsEndDependFnsResource");
-
+ /*
+ * The descriptor type field is set based upon whether a byte is needed
+ * to contain Priority data.
+ */
+ if (ACPI_ACCEPTABLE_CONFIGURATION ==
+ Resource->Data.StartDpf.CompatibilityPriority &&
+ ACPI_ACCEPTABLE_CONFIGURATION ==
+ Resource->Data.StartDpf.PerformanceRobustness)
+ {
+ AcpiRsSetResourceHeader (ACPI_RESOURCE_NAME_START_DEPENDENT,
+ sizeof (AML_RESOURCE_START_DEPENDENT_NOPRIO), Aml);
+ }
+ else
+ {
+ AcpiRsSetResourceHeader (ACPI_RESOURCE_NAME_START_DEPENDENT,
+ sizeof (AML_RESOURCE_START_DEPENDENT), Aml);
- /* The number of bytes consumed is static */
+ /* Set the Flags byte */
- *BytesConsumed = 1;
+ Aml->StartDpf.Flags = (UINT8)
+ (((Resource->Data.StartDpf.PerformanceRobustness & 0x03) << 2) |
+ (Resource->Data.StartDpf.CompatibilityPriority & 0x03));
+ }
+ return_ACPI_STATUS (AE_OK);
+}
- /* Fill out the structure */
- OutputStruct->Id = ACPI_RSTYPE_END_DPF;
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiRsGetEndDpf
+ *
+ * PARAMETERS: Aml - Pointer to the AML resource descriptor
+ * AmlResourceLength - Length of the resource from the AML header
+ * Resource - Where the internal resource is returned
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Convert a raw AML resource descriptor to the corresponding
+ * internal resource descriptor, simplifying bitflags and handling
+ * alignment and endian issues if necessary.
+ *
+ ******************************************************************************/
- /* Set the Length parameter */
+ACPI_STATUS
+AcpiRsGetEndDpf (
+ AML_RESOURCE *Aml,
+ UINT16 AmlResourceLength,
+ ACPI_RESOURCE *Resource)
+{
+ ACPI_FUNCTION_TRACE ("RsGetEndDpf");
- OutputStruct->Length = (UINT32) StructSize;
- /* Return the final size of the structure */
+ /* Complete the resource header */
- *StructureSize = StructSize;
+ Resource->Type = ACPI_RESOURCE_TYPE_END_DEPENDENT;
+ Resource->Length = (UINT32) ACPI_RESOURCE_LENGTH;
return_ACPI_STATUS (AE_OK);
}
/*******************************************************************************
*
- * FUNCTION: AcpiRsStartDependFnsStream
+ * FUNCTION: AcpiRsSetEndDpf
*
- * PARAMETERS: LinkedList - Pointer to the resource linked list
- * OutputBuffer - Pointer to the user's return buffer
- * BytesConsumed - UINT32 pointer that is filled with
- * the number of bytes of the
- * OutputBuffer used
+ * PARAMETERS: Resource - Pointer to the resource descriptor
+ * Aml - Where the AML descriptor is returned
*
* RETURN: Status
*
- * DESCRIPTION: Take the linked list resource structure and fills in the
- * the appropriate bytes in a byte stream
+ * DESCRIPTION: Convert an internal resource descriptor to the corresponding
+ * external AML resource descriptor.
*
******************************************************************************/
ACPI_STATUS
-AcpiRsStartDependFnsStream (
- ACPI_RESOURCE *LinkedList,
- UINT8 **OutputBuffer,
- ACPI_SIZE *BytesConsumed)
+AcpiRsSetEndDpf (
+ ACPI_RESOURCE *Resource,
+ AML_RESOURCE *Aml)
{
- UINT8 *Buffer = *OutputBuffer;
- UINT8 Temp8 = 0;
+ ACPI_FUNCTION_TRACE ("RsSetEndDpf");
- ACPI_FUNCTION_TRACE ("RsStartDependFnsStream");
+ /* Complete the AML descriptor header */
+ AcpiRsSetResourceHeader (ACPI_RESOURCE_NAME_END_DEPENDENT,
+ sizeof (AML_RESOURCE_END_DEPENDENT), Aml);
+ return_ACPI_STATUS (AE_OK);
+}
- /*
- * The descriptor field is set based upon whether a byte is needed
- * to contain Priority data.
- */
- if (ACPI_ACCEPTABLE_CONFIGURATION ==
- LinkedList->Data.StartDpf.CompatibilityPriority &&
- ACPI_ACCEPTABLE_CONFIGURATION ==
- LinkedList->Data.StartDpf.PerformanceRobustness)
- {
- *Buffer = 0x30;
- }
- else
- {
- *Buffer = 0x31;
- Buffer += 1;
- /* Set the Priority Byte Definition */
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiRsGetEndTag
+ *
+ * PARAMETERS: Aml - Pointer to the AML resource descriptor
+ * AmlResourceLength - Length of the resource from the AML header
+ * Resource - Where the internal resource is returned
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Convert a raw AML resource descriptor to the corresponding
+ * internal resource descriptor, simplifying bitflags and handling
+ * alignment and endian issues if necessary.
+ *
+ ******************************************************************************/
- Temp8 = 0;
- Temp8 = (UINT8) ((LinkedList->Data.StartDpf.PerformanceRobustness &
- 0x03) << 2);
- Temp8 |= (LinkedList->Data.StartDpf.CompatibilityPriority &
- 0x03);
- *Buffer = Temp8;
- }
+ACPI_STATUS
+AcpiRsGetEndTag (
+ AML_RESOURCE *Aml,
+ UINT16 AmlResourceLength,
+ ACPI_RESOURCE *Resource)
+{
+ ACPI_FUNCTION_TRACE ("RsGetEndTag");
- Buffer += 1;
- /* Return the number of bytes consumed in this operation */
+ /* Complete the resource header */
- *BytesConsumed = ACPI_PTR_DIFF (Buffer, *OutputBuffer);
+ Resource->Type = ACPI_RESOURCE_TYPE_END_TAG;
+ Resource->Length = ACPI_RESOURCE_LENGTH;
return_ACPI_STATUS (AE_OK);
}
/*******************************************************************************
*
- * FUNCTION: AcpiRsEndDependFnsStream
+ * FUNCTION: AcpiRsSetEndTag
*
- * PARAMETERS: LinkedList - Pointer to the resource linked list
- * OutputBuffer - Pointer to the user's return buffer
- * BytesConsumed - Pointer to where the number of bytes
- * used in the OutputBuffer is returned
+ * PARAMETERS: Resource - Pointer to the resource descriptor
+ * Aml - Where the AML descriptor is returned
*
* RETURN: Status
*
- * DESCRIPTION: Take the linked list resource structure and fills in the
- * the appropriate bytes in a byte stream
+ * DESCRIPTION: Convert an internal resource descriptor to the corresponding
+ * external AML resource descriptor.
*
******************************************************************************/
ACPI_STATUS
-AcpiRsEndDependFnsStream (
- ACPI_RESOURCE *LinkedList,
- UINT8 **OutputBuffer,
- ACPI_SIZE *BytesConsumed)
+AcpiRsSetEndTag (
+ ACPI_RESOURCE *Resource,
+ AML_RESOURCE *Aml)
{
- UINT8 *Buffer = *OutputBuffer;
-
-
- ACPI_FUNCTION_TRACE ("RsEndDependFnsStream");
+ ACPI_FUNCTION_TRACE ("RsSetEndTag");
- /* The descriptor field is static */
-
- *Buffer = 0x38;
- Buffer += 1;
+ /*
+ * Set the Checksum - zero means that the resource data is treated as if
+ * the checksum operation succeeded (ACPI Spec 1.0b Section 6.4.2.8)
+ */
+ Aml->EndTag.Checksum = 0;
- /* Return the number of bytes consumed in this operation */
+ /* Complete the AML descriptor header */
- *BytesConsumed = ACPI_PTR_DIFF (Buffer, *OutputBuffer);
+ AcpiRsSetResourceHeader (ACPI_RESOURCE_NAME_END_TAG,
+ sizeof (AML_RESOURCE_END_TAG), Aml);
return_ACPI_STATUS (AE_OK);
}
+
diff --git a/usr/src/uts/i86pc/io/acpica/resources/rsutils.c b/usr/src/uts/i86pc/io/acpica/resources/rsutils.c
index d566bc8ce7..17dd1f7740 100644
--- a/usr/src/uts/i86pc/io/acpica/resources/rsutils.c
+++ b/usr/src/uts/i86pc/io/acpica/resources/rsutils.c
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: rsutils - Utilities for the resource manager
- * $Revision: 45 $
+ * $Revision: 1.48 $
*
******************************************************************************/
@@ -128,6 +128,494 @@
/*******************************************************************************
*
+ * FUNCTION: AcpiRsMoveData
+ *
+ * PARAMETERS: Destination - Pointer to the destination descriptor
+ * Source - Pointer to the source descriptor
+ * ItemCount - How many items to move
+ * MoveType - Byte width
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Move multiple data items from one descriptor to another. Handles
+ * alignment issues and endian issues if necessary, as configured
+ * via the ACPI_MOVE_* macros. (This is why a memcpy is not used)
+ *
+ ******************************************************************************/
+
+void
+AcpiRsMoveData (
+ void *Destination,
+ void *Source,
+ UINT16 ItemCount,
+ UINT8 MoveType)
+{
+ ACPI_NATIVE_UINT i;
+
+
+ /* One move per item */
+
+ for (i = 0; i < ItemCount; i++)
+ {
+ switch (MoveType)
+ {
+ case ACPI_MOVE_TYPE_16_TO_32:
+ ACPI_MOVE_16_TO_32 (&((UINT32 *) Destination)[i],
+ &((UINT16 *) Source)[i]);
+ break;
+
+ case ACPI_MOVE_TYPE_32_TO_16:
+ ACPI_MOVE_32_TO_16 (&((UINT16 *) Destination)[i],
+ &((UINT32 *) Source)[i]);
+ break;
+
+ case ACPI_MOVE_TYPE_32_TO_32:
+ ACPI_MOVE_32_TO_32 (&((UINT32 *) Destination)[i],
+ &((UINT32 *) Source)[i]);
+ break;
+
+ case ACPI_MOVE_TYPE_64_TO_64:
+ ACPI_MOVE_64_TO_64 (&((UINT64 *) Destination)[i],
+ &((UINT64 *) Source)[i]);
+ break;
+
+ default:
+ return;
+ }
+ }
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiRsGetResourceInfo
+ *
+ * PARAMETERS: ResourceType - Byte 0 of a resource descriptor
+ *
+ * RETURN: Pointer to the resource conversion handler
+ *
+ * DESCRIPTION: Extract the Resource Type/Name from the first byte of
+ * a resource descriptor.
+ *
+ ******************************************************************************/
+
+ACPI_RESOURCE_INFO *
+AcpiRsGetResourceInfo (
+ UINT8 ResourceType)
+{
+ ACPI_RESOURCE_INFO *SizeInfo;
+
+
+ ACPI_FUNCTION_ENTRY ();
+
+
+ /* Determine if this is a small or large resource */
+
+ if (ResourceType & ACPI_RESOURCE_NAME_LARGE)
+ {
+ /* Large Resource Type -- bits 6:0 contain the name */
+
+ if (ResourceType > ACPI_RESOURCE_NAME_LARGE_MAX)
+ {
+ return (NULL);
+ }
+
+ SizeInfo = &AcpiGbl_LgResourceInfo [
+ (ResourceType & ACPI_RESOURCE_NAME_LARGE_MASK)];
+ }
+ else
+ {
+ /* Small Resource Type -- bits 6:3 contain the name */
+
+ SizeInfo = &AcpiGbl_SmResourceInfo [
+ ((ResourceType & ACPI_RESOURCE_NAME_SMALL_MASK) >> 3)];
+ }
+
+ /* Zero entry indicates an invalid resource type */
+
+ if (!SizeInfo->MinimumInternalStructLength)
+ {
+ return (NULL);
+ }
+
+ return (SizeInfo);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiRsGetResourceLength
+ *
+ * PARAMETERS: Aml - Pointer to the raw AML resource descriptor
+ *
+ * RETURN: Byte Length
+ *
+ * DESCRIPTION: Get the "Resource Length" of a raw AML descriptor. By
+ * definition, this does not include the size of the descriptor
+ * header or the length field itself.
+ *
+ ******************************************************************************/
+
+UINT16
+AcpiRsGetResourceLength (
+ AML_RESOURCE *Aml)
+{
+ UINT16 ResourceLength;
+
+
+ ACPI_FUNCTION_ENTRY ();
+
+
+ /* Determine if this is a small or large resource */
+
+ if (Aml->LargeHeader.DescriptorType & ACPI_RESOURCE_NAME_LARGE)
+ {
+ /* Large Resource type -- bytes 1-2 contain the 16-bit length */
+
+ ACPI_MOVE_16_TO_16 (&ResourceLength, &Aml->LargeHeader.ResourceLength);
+
+ }
+ else
+ {
+ /* Small Resource type -- bits 2:0 of byte 0 contain the length */
+
+ ResourceLength = (UINT16) (Aml->SmallHeader.DescriptorType &
+ ACPI_RESOURCE_NAME_SMALL_LENGTH_MASK);
+ }
+
+ return (ResourceLength);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiRsGetDescriptorLength
+ *
+ * PARAMETERS: Aml - Pointer to the raw AML resource descriptor
+ *
+ * RETURN: Byte length
+ *
+ * DESCRIPTION: Get the total byte length of a raw AML descriptor, including the
+ * length of the descriptor header and the length field itself.
+ * Used to walk descriptor lists.
+ *
+ ******************************************************************************/
+
+UINT32
+AcpiRsGetDescriptorLength (
+ AML_RESOURCE *Aml)
+{
+ UINT32 DescriptorLength;
+
+
+ ACPI_FUNCTION_ENTRY ();
+
+
+ /* Determine if this is a small or large resource */
+
+ if (Aml->LargeHeader.DescriptorType & ACPI_RESOURCE_NAME_LARGE)
+ {
+ /* Large Resource type -- bytes 1-2 contain the 16-bit length */
+
+ ACPI_MOVE_16_TO_32 (&DescriptorLength, &Aml->LargeHeader.ResourceLength);
+ DescriptorLength += sizeof (AML_RESOURCE_LARGE_HEADER);
+
+ }
+ else
+ {
+ /* Small Resource type -- bits 2:0 of byte 0 contain the length */
+
+ DescriptorLength = (UINT32) (Aml->SmallHeader.DescriptorType &
+ ACPI_RESOURCE_NAME_SMALL_LENGTH_MASK);
+ DescriptorLength += sizeof (AML_RESOURCE_SMALL_HEADER);
+ }
+
+ return (DescriptorLength);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiRsSetResourceHeader
+ *
+ * PARAMETERS: DescriptorType - Byte to be inserted as the type
+ * TotalLength - Length of the AML descriptor, including
+ * the header and length fields.
+ * Aml - Pointer to the raw AML descriptor
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Set the DescriptorType and ResourceLength fields of an AML
+ * resource descriptor, both Large and Small descriptors are
+ * supported automatically
+ *
+ ******************************************************************************/
+
+void
+AcpiRsSetResourceHeader (
+ UINT8 DescriptorType,
+ ACPI_SIZE TotalLength,
+ AML_RESOURCE *Aml)
+{
+ UINT16 ResourceLength;
+
+
+ ACPI_FUNCTION_ENTRY ();
+
+
+ /* Set the descriptor type */
+
+ Aml->SmallHeader.DescriptorType = DescriptorType;
+
+ /* Determine if this is a small or large resource */
+
+ if (Aml->SmallHeader.DescriptorType & ACPI_RESOURCE_NAME_LARGE)
+ {
+ /* Large Resource type -- bytes 1-2 contain the 16-bit length */
+
+ ResourceLength = (UINT16) (TotalLength - sizeof (AML_RESOURCE_LARGE_HEADER));
+
+ /* Insert length into the Large descriptor length field */
+
+ ACPI_MOVE_16_TO_16 (&Aml->LargeHeader.ResourceLength, &ResourceLength);
+ }
+ else
+ {
+ /* Small Resource type -- bits 2:0 of byte 0 contain the length */
+
+ ResourceLength = (UINT16) (TotalLength - sizeof (AML_RESOURCE_SMALL_HEADER));
+
+ /* Insert length into the descriptor type byte */
+
+ Aml->SmallHeader.DescriptorType |= (UINT8) ResourceLength;
+ }
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiRsGetResourceType
+ *
+ * PARAMETERS: ResourceType - Byte 0 of a resource descriptor
+ *
+ * RETURN: The Resource Type with no extraneous bits (except the
+ * Large/Small descriptor bit -- this is left alone)
+ *
+ * DESCRIPTION: Extract the Resource Type/Name from the first byte of
+ * a resource descriptor.
+ *
+ ******************************************************************************/
+
+UINT8
+AcpiRsGetResourceType (
+ UINT8 ResourceType)
+{
+ ACPI_FUNCTION_ENTRY ();
+
+
+ /* Determine if this is a small or large resource */
+
+ if (ResourceType & ACPI_RESOURCE_NAME_LARGE)
+ {
+ /* Large Resource Type -- bits 6:0 contain the name */
+
+ return (ResourceType);
+ }
+ else
+ {
+ /* Small Resource Type -- bits 6:3 contain the name */
+
+ return ((UINT8) (ResourceType & ACPI_RESOURCE_NAME_SMALL_MASK));
+ }
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiRsStrcpy
+ *
+ * PARAMETERS: Destination - Pointer to the destination string
+ * Source - Pointer to the source string
+ *
+ * RETURN: String length, including NULL terminator
+ *
+ * DESCRIPTION: Local string copy that returns the string length, saving a
+ * strcpy followed by a strlen.
+ *
+ ******************************************************************************/
+
+static UINT16
+AcpiRsStrcpy (
+ char *Destination,
+ char *Source)
+{
+ UINT16 i;
+
+
+ ACPI_FUNCTION_ENTRY ();
+
+
+ for (i = 0; Source[i]; i++)
+ {
+ Destination[i] = Source[i];
+ }
+
+ Destination[i] = 0;
+
+ /* Return string length including the NULL terminator */
+
+ return ((UINT16) (i + 1));
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiRsGetResourceSource
+ *
+ * PARAMETERS: ResourceLength - Length field of the descriptor
+ * MinimumLength - Minimum length of the descriptor (minus
+ * any optional fields)
+ * ResourceSource - Where the ResourceSource is returned
+ * Aml - Pointer to the raw AML descriptor
+ * StringPtr - (optional) where to store the actual
+ * ResourceSource string
+ *
+ * RETURN: Length of the string plus NULL terminator, rounded up to 32 bit
+ *
+ * DESCRIPTION: Copy the optional ResourceSource data from a raw AML descriptor
+ * to an internal resource descriptor
+ *
+ ******************************************************************************/
+
+UINT16
+AcpiRsGetResourceSource (
+ UINT16 ResourceLength,
+ ACPI_SIZE MinimumLength,
+ ACPI_RESOURCE_SOURCE *ResourceSource,
+ AML_RESOURCE *Aml,
+ char *StringPtr)
+{
+ ACPI_SIZE TotalLength;
+ UINT8 *AmlResourceSource;
+
+
+ ACPI_FUNCTION_ENTRY ();
+
+
+ TotalLength = ResourceLength + sizeof (AML_RESOURCE_LARGE_HEADER);
+ AmlResourceSource = ((UINT8 *) Aml) + MinimumLength;
+
+ /*
+ * ResourceSource is present if the length of the descriptor is longer than
+ * the minimum length.
+ *
+ * Note: Some resource descriptors will have an additional null, so
+ * we add 1 to the minimum length.
+ */
+ if (TotalLength > (MinimumLength + 1))
+ {
+ /* Get the ResourceSourceIndex */
+
+ ResourceSource->Index = AmlResourceSource[0];
+
+ ResourceSource->StringPtr = StringPtr;
+ if (!StringPtr)
+ {
+ /*
+ * String destination pointer is not specified; Set the String
+ * pointer to the end of the current ResourceSource structure.
+ */
+ ResourceSource->StringPtr = (char *)
+ ((UINT8 *) ResourceSource) + sizeof (ACPI_RESOURCE_SOURCE);
+ }
+
+ /* Copy the ResourceSource string to the destination */
+
+ ResourceSource->StringLength = AcpiRsStrcpy (ResourceSource->StringPtr,
+ (char *) &AmlResourceSource[1]);
+
+ /*
+ * In order for the StructSize to fall on a 32-bit boundary,
+ * calculate the length of the string and expand the
+ * StructSize to the next 32-bit boundary.
+ */
+ return ((UINT16) ACPI_ROUND_UP_TO_32BITS (ResourceSource->StringLength));
+ }
+ else
+ {
+ /* ResourceSource is not present */
+
+ ResourceSource->Index = 0;
+ ResourceSource->StringLength = 0;
+ ResourceSource->StringPtr = NULL;
+ return (0);
+ }
+}
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiRsSetResourceSource
+ *
+ * PARAMETERS: Aml - Pointer to the raw AML descriptor
+ * MinimumLength - Minimum length of the descriptor (minus
+ * any optional fields)
+ * ResourceSource - Internal ResourceSource
+
+ *
+ * RETURN: Total length of the AML descriptor
+ *
+ * DESCRIPTION: Convert an optoinal ResourceSource from internal format to a
+ * raw AML resource descriptor
+ *
+ ******************************************************************************/
+
+ACPI_SIZE
+AcpiRsSetResourceSource (
+ AML_RESOURCE *Aml,
+ ACPI_SIZE MinimumLength,
+ ACPI_RESOURCE_SOURCE *ResourceSource)
+{
+ UINT8 *AmlResourceSource;
+ ACPI_SIZE DescriptorLength;
+
+
+ ACPI_FUNCTION_ENTRY ();
+
+
+ DescriptorLength = MinimumLength;
+
+ /* Non-zero string length indicates presence of a ResourceSource */
+
+ if (ResourceSource->StringLength)
+ {
+ /* Point to the end of the AML descriptor */
+
+ AmlResourceSource = ((UINT8 *) Aml) + MinimumLength;
+
+ /* Copy the ResourceSourceIndex */
+
+ AmlResourceSource[0] = (UINT8) ResourceSource->Index;
+
+ /* Copy the ResourceSource string */
+
+ ACPI_STRCPY ((char *) &AmlResourceSource[1],
+ ResourceSource->StringPtr);
+
+ /*
+ * Add the length of the string (+ 1 for null terminator) to the
+ * final descriptor length
+ */
+ DescriptorLength += ((ACPI_SIZE) ResourceSource->StringLength + 1);
+ }
+
+ /* Return the new total length of the AML descriptor */
+
+ return (DescriptorLength);
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: AcpiRsGetPrtMethodData
*
* PARAMETERS: Handle - a handle to the containing object
@@ -386,7 +874,7 @@ AcpiRsSetSrsMethodData (
* Convert the linked list into a byte stream
*/
Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
- Status = AcpiRsCreateByteStream (InBuffer->Pointer, &Buffer);
+ Status = AcpiRsCreateAmlResources (InBuffer->Pointer, &Buffer);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
diff --git a/usr/src/uts/i86pc/io/acpica/resources/rsxface.c b/usr/src/uts/i86pc/io/acpica/resources/rsxface.c
index d38966951f..f3b3013e18 100644
--- a/usr/src/uts/i86pc/io/acpica/resources/rsxface.c
+++ b/usr/src/uts/i86pc/io/acpica/resources/rsxface.c
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: rsxface - Public interfaces to the resource manager
- * $Revision: 33 $
+ * $Revision: 1.36 $
*
******************************************************************************/
@@ -134,9 +134,9 @@
ACPI_COPY_FIELD(Out, In, MaxAddressFixed); \
ACPI_COPY_FIELD(Out, In, Attribute); \
ACPI_COPY_FIELD(Out, In, Granularity); \
- ACPI_COPY_FIELD(Out, In, MinAddressRange); \
- ACPI_COPY_FIELD(Out, In, MaxAddressRange); \
- ACPI_COPY_FIELD(Out, In, AddressTranslationOffset); \
+ ACPI_COPY_FIELD(Out, In, Minimum); \
+ ACPI_COPY_FIELD(Out, In, Maximum); \
+ ACPI_COPY_FIELD(Out, In, TranslationOffset); \
ACPI_COPY_FIELD(Out, In, AddressLength); \
ACPI_COPY_FIELD(Out, In, ResourceSource);
@@ -329,10 +329,10 @@ AcpiGetPossibleResources (
ACPI_STATUS
AcpiWalkResources (
- ACPI_HANDLE DeviceHandle,
- char *Path,
- ACPI_WALK_RESOURCE_CALLBACK UserFunction,
- void *Context)
+ ACPI_HANDLE DeviceHandle,
+ char *Path,
+ ACPI_WALK_RESOURCE_CALLBACK UserFunction,
+ void *Context)
{
ACPI_STATUS Status;
ACPI_BUFFER Buffer = {ACPI_ALLOCATE_BUFFER, NULL};
@@ -366,7 +366,7 @@ AcpiWalkResources (
for (;;)
{
- if (!Resource || Resource->Id == ACPI_RSTYPE_END_TAG)
+ if (!Resource || Resource->Type == ACPI_RESOURCE_TYPE_END_TAG)
{
break;
}
@@ -464,8 +464,8 @@ AcpiSetCurrentResources (
*
* FUNCTION: AcpiResourceToAddress64
*
- * PARAMETERS: resource - Pointer to a resource
- * out - Pointer to the users's return
+ * PARAMETERS: Resource - Pointer to a resource
+ * Out - Pointer to the users's return
* buffer (a struct
* acpi_resource_address64)
*
@@ -487,29 +487,27 @@ AcpiResourceToAddress64 (
ACPI_RESOURCE_ADDRESS32 *Address32;
- switch (Resource->Id) {
- case ACPI_RSTYPE_ADDRESS16:
+ switch (Resource->Type)
+ {
+ case ACPI_RESOURCE_TYPE_ADDRESS16:
Address16 = (ACPI_RESOURCE_ADDRESS16 *) &Resource->Data;
ACPI_COPY_ADDRESS (Out, Address16);
break;
-
- case ACPI_RSTYPE_ADDRESS32:
+ case ACPI_RESOURCE_TYPE_ADDRESS32:
Address32 = (ACPI_RESOURCE_ADDRESS32 *) &Resource->Data;
ACPI_COPY_ADDRESS (Out, Address32);
break;
-
- case ACPI_RSTYPE_ADDRESS64:
+ case ACPI_RESOURCE_TYPE_ADDRESS64:
/* Simple copy for 64 bit source */
ACPI_MEMCPY (Out, &Resource->Data, sizeof (ACPI_RESOURCE_ADDRESS64));
break;
-
default:
return (AE_BAD_PARAMETER);
}
diff --git a/usr/src/uts/i86pc/io/acpica/tables/tbconvrt.c b/usr/src/uts/i86pc/io/acpica/tables/tbconvrt.c
index 1e7b09e54b..3f1d99f8ac 100644
--- a/usr/src/uts/i86pc/io/acpica/tables/tbconvrt.c
+++ b/usr/src/uts/i86pc/io/acpica/tables/tbconvrt.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: tbconvrt - ACPI Table conversion utilities
- * $Revision: 64 $
+ * $Revision: 1.64 $
*
*****************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/tables/tbget.c b/usr/src/uts/i86pc/io/acpica/tables/tbget.c
index dacc7bc6e7..f774d16509 100644
--- a/usr/src/uts/i86pc/io/acpica/tables/tbget.c
+++ b/usr/src/uts/i86pc/io/acpica/tables/tbget.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: tbget - ACPI Table get* routines
- * $Revision: 94 $
+ * $Revision: 1.94 $
*
*****************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/tables/tbgetall.c b/usr/src/uts/i86pc/io/acpica/tables/tbgetall.c
index 8cf04217bf..fb33bb0336 100644
--- a/usr/src/uts/i86pc/io/acpica/tables/tbgetall.c
+++ b/usr/src/uts/i86pc/io/acpica/tables/tbgetall.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: tbgetall - Get all required ACPI tables
- * $Revision: 13 $
+ * $Revision: 1.13 $
*
*****************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/tables/tbinstal.c b/usr/src/uts/i86pc/io/acpica/tables/tbinstal.c
index 811389a5c7..cb773b7839 100644
--- a/usr/src/uts/i86pc/io/acpica/tables/tbinstal.c
+++ b/usr/src/uts/i86pc/io/acpica/tables/tbinstal.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: tbinstal - ACPI table installation and removal
- * $Revision: 79 $
+ * $Revision: 1.80 $
*
*****************************************************************************/
@@ -203,9 +203,7 @@ AcpiTbMatchSignature (
*
* RETURN: Status
*
- * DESCRIPTION: Load and validate all tables other than the RSDT. The RSDT must
- * already be loaded and validated.
- * Install the table into the global data structs.
+ * DESCRIPTION: Install the table into the global data structures.
*
******************************************************************************/
@@ -215,6 +213,7 @@ AcpiTbInstallTable (
{
ACPI_STATUS Status;
+
ACPI_FUNCTION_TRACE ("TbInstallTable");
@@ -223,23 +222,35 @@ AcpiTbInstallTable (
Status = AcpiUtAcquireMutex (ACPI_MTX_TABLES);
if (ACPI_FAILURE (Status))
{
- ACPI_REPORT_ERROR (("Could not acquire table mutex for [%4.4s], %s\n",
- TableInfo->Pointer->Signature, AcpiFormatException (Status)));
+ ACPI_REPORT_ERROR (("Could not acquire table mutex, %s\n",
+ AcpiFormatException (Status)));
return_ACPI_STATUS (Status);
}
+ /*
+ * Ignore a table that is already installed. For example, some BIOS
+ * ASL code will repeatedly attempt to load the same SSDT.
+ */
+ Status = AcpiTbIsTableInstalled (TableInfo);
+ if (ACPI_FAILURE (Status))
+ {
+ goto UnlockAndExit;
+ }
+
/* Install the table into the global data structure */
Status = AcpiTbInitTableDescriptor (TableInfo->Type, TableInfo);
if (ACPI_FAILURE (Status))
{
- ACPI_REPORT_ERROR (("Could not install ACPI table [%4.4s], %s\n",
+ ACPI_REPORT_ERROR (("Could not install table [%4.4s], %s\n",
TableInfo->Pointer->Signature, AcpiFormatException (Status)));
}
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "%s located at %p\n",
AcpiGbl_TableData[TableInfo->Type].Name, TableInfo->Pointer));
+
+UnlockAndExit:
(void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
return_ACPI_STATUS (Status);
}
diff --git a/usr/src/uts/i86pc/io/acpica/tables/tbrsdt.c b/usr/src/uts/i86pc/io/acpica/tables/tbrsdt.c
index 9468cd5c63..6cf3b26d72 100644
--- a/usr/src/uts/i86pc/io/acpica/tables/tbrsdt.c
+++ b/usr/src/uts/i86pc/io/acpica/tables/tbrsdt.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: tbrsdt - ACPI RSDT table utilities
- * $Revision: 19 $
+ * $Revision: 1.20 $
*
*****************************************************************************/
@@ -360,7 +360,7 @@ AcpiTbGetTableRsdt (
}
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
- "RSDP located at %p, points to RSDT physical=%8.8X%8.8X \n",
+ "RSDP located at %p, points to RSDT physical=%8.8X%8.8X\n",
AcpiGbl_RSDP,
ACPI_FORMAT_UINT64 (Address.Pointer.Value)));
diff --git a/usr/src/uts/i86pc/io/acpica/tables/tbutils.c b/usr/src/uts/i86pc/io/acpica/tables/tbutils.c
index bf989e7ed2..1634fe684a 100644
--- a/usr/src/uts/i86pc/io/acpica/tables/tbutils.c
+++ b/usr/src/uts/i86pc/io/acpica/tables/tbutils.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: tbutils - Table manipulation utilities
- * $Revision: 65 $
+ * $Revision: 1.70 $
*
*****************************************************************************/
@@ -135,6 +135,77 @@ AcpiTbHandleToObject (
/*******************************************************************************
*
+ * FUNCTION: AcpiTbIsTableInstalled
+ *
+ * PARAMETERS: NewTableDesc - Descriptor for new table being installed
+ *
+ * RETURN: Status - AE_ALREADY_EXISTS if the table is already installed
+ *
+ * DESCRIPTION: Determine if an ACPI table is already installed
+ *
+ * MUTEX: Table data structures should be locked
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiTbIsTableInstalled (
+ ACPI_TABLE_DESC *NewTableDesc)
+{
+ ACPI_TABLE_DESC *TableDesc;
+
+
+ ACPI_FUNCTION_TRACE ("TbIsTableInstalled");
+
+
+ /* Get the list descriptor and first table descriptor */
+
+ TableDesc = AcpiGbl_TableLists[NewTableDesc->Type].Next;
+
+ /* Examine all installed tables of this type */
+
+ while (TableDesc)
+ {
+ /*
+ * If the table lengths match, perform a full bytewise compare. This
+ * means that we will allow tables with duplicate OemTableId(s), as
+ * long as the tables are different in some way.
+ *
+ * Checking if the table has been loaded into the namespace means that
+ * we don't check for duplicate tables during the initial installation
+ * of tables within the RSDT/XSDT.
+ */
+ if ((TableDesc->LoadedIntoNamespace) &&
+ (TableDesc->Pointer->Length == NewTableDesc->Pointer->Length) &&
+ (!ACPI_MEMCMP (
+ (const char *) TableDesc->Pointer,
+ (const char *) NewTableDesc->Pointer,
+ (ACPI_SIZE) NewTableDesc->Pointer->Length)))
+ {
+ /* Match: this table is already installed */
+
+ ACPI_DEBUG_PRINT ((ACPI_DB_TABLES,
+ "Table [%4.4s] already installed: Rev %X OemTableId [%8.8s]\n",
+ NewTableDesc->Pointer->Signature,
+ NewTableDesc->Pointer->Revision,
+ NewTableDesc->Pointer->OemTableId));
+
+ NewTableDesc->OwnerId = TableDesc->OwnerId;
+ NewTableDesc->InstalledDesc = TableDesc;
+
+ return_ACPI_STATUS (AE_ALREADY_EXISTS);
+ }
+
+ /* Get next table on the list */
+
+ TableDesc = TableDesc->Next;
+ }
+
+ return_ACPI_STATUS (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: AcpiTbValidateTableHeader
*
* PARAMETERS: TableHeader - Logical pointer to the table
@@ -234,7 +305,7 @@ AcpiTbVerifyTableChecksum (
/* Compute the checksum on the table */
- Checksum = AcpiTbChecksum (TableHeader, TableHeader->Length);
+ Checksum = AcpiTbGenerateChecksum (TableHeader, TableHeader->Length);
/* Return the appropriate exception */
@@ -253,7 +324,7 @@ AcpiTbVerifyTableChecksum (
/*******************************************************************************
*
- * FUNCTION: AcpiTbChecksum
+ * FUNCTION: AcpiTbGenerateChecksum
*
* PARAMETERS: Buffer - Buffer to checksum
* Length - Size of the buffer
@@ -265,7 +336,7 @@ AcpiTbVerifyTableChecksum (
******************************************************************************/
UINT8
-AcpiTbChecksum (
+AcpiTbGenerateChecksum (
void *Buffer,
UINT32 Length)
{
diff --git a/usr/src/uts/i86pc/io/acpica/tables/tbxface.c b/usr/src/uts/i86pc/io/acpica/tables/tbxface.c
index 56216ac716..db7d57582b 100644
--- a/usr/src/uts/i86pc/io/acpica/tables/tbxface.c
+++ b/usr/src/uts/i86pc/io/acpica/tables/tbxface.c
@@ -2,7 +2,7 @@
*
* Module Name: tbxface - Public interfaces to the ACPI subsystem
* ACPI table oriented interfaces
- * $Revision: 68 $
+ * $Revision: 1.70 $
*
*****************************************************************************/
@@ -261,11 +261,26 @@ AcpiLoadTable (
return_ACPI_STATUS (Status);
}
+ /* Check signature for a valid table type */
+
+ Status = AcpiTbRecognizeTable (&TableInfo, ACPI_TABLE_ALL);
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+
/* Install the new table into the local data structures */
Status = AcpiTbInstallTable (&TableInfo);
if (ACPI_FAILURE (Status))
{
+ if (Status == AE_ALREADY_EXISTS)
+ {
+ /* Table already exists, no error */
+
+ Status = AE_OK;
+ }
+
/* Free table allocated by AcpiTbGetTableBody */
AcpiTbDeleteSingleTable (&TableInfo);
@@ -345,6 +360,7 @@ AcpiUnloadTable (
* simply a position within the hierarchy
*/
AcpiNsDeleteNamespaceByOwner (TableDesc->OwnerId);
+ AcpiUtReleaseOwnerId (&TableDesc->OwnerId);
TableDesc = TableDesc->Next;
}
diff --git a/usr/src/uts/i86pc/io/acpica/tables/tbxfroot.c b/usr/src/uts/i86pc/io/acpica/tables/tbxfroot.c
index c552507576..dddf314e95 100644
--- a/usr/src/uts/i86pc/io/acpica/tables/tbxfroot.c
+++ b/usr/src/uts/i86pc/io/acpica/tables/tbxfroot.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: tbxfroot - Find the root ACPI table (RSDT)
- * $Revision: 89 $
+ * $Revision: 1.91 $
*
*****************************************************************************/
@@ -167,7 +167,7 @@ AcpiTbValidateRsdp (
/* Check the standard checksum */
- if (AcpiTbChecksum (Rsdp, ACPI_RSDP_CHECKSUM_LENGTH) != 0)
+ if (AcpiTbGenerateChecksum (Rsdp, ACPI_RSDP_CHECKSUM_LENGTH) != 0)
{
return (AE_BAD_CHECKSUM);
}
@@ -175,7 +175,7 @@ AcpiTbValidateRsdp (
/* Check extended checksum if table version >= 2 */
if ((Rsdp->Revision >= 2) &&
- (AcpiTbChecksum (Rsdp, ACPI_RSDP_XCHECKSUM_LENGTH) != 0))
+ (AcpiTbGenerateChecksum (Rsdp, ACPI_RSDP_XCHECKSUM_LENGTH) != 0))
{
return (AE_BAD_CHECKSUM);
}
@@ -364,7 +364,7 @@ AcpiGetFirmwareTable (
AcpiTbGetRsdtAddress (&Address);
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
- "RSDP located at %p, RSDT physical=%8.8X%8.8X \n",
+ "RSDP located at %p, RSDT physical=%8.8X%8.8X\n",
AcpiGbl_RSDP,
ACPI_FORMAT_UINT64 (Address.Pointer.Value)));
diff --git a/usr/src/uts/i86pc/io/acpica/utilities/utalloc.c b/usr/src/uts/i86pc/io/acpica/utilities/utalloc.c
index 15e5e47022..789ffd3685 100644
--- a/usr/src/uts/i86pc/io/acpica/utilities/utalloc.c
+++ b/usr/src/uts/i86pc/io/acpica/utilities/utalloc.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: utalloc - local memory allocation routines
- * $Revision: 146 $
+ * $Revision: 1.148 $
*
*****************************************************************************/
@@ -148,7 +148,7 @@ static ACPI_STATUS
AcpiUtCreateList (
char *ListName,
UINT16 ObjectSize,
- ACPI_HANDLE *ReturnCache);
+ ACPI_MEMORY_LIST **ReturnCache);
#endif
@@ -415,7 +415,7 @@ AcpiUtAllocate (
if (!Size)
{
_ACPI_REPORT_ERROR (Module, Line, Component,
- ("UtAllocate: Attempt to allocate zero bytes\n"));
+ ("UtAllocate: Attempt to allocate zero bytes, allocating 1 byte\n"));
Size = 1;
}
@@ -467,8 +467,8 @@ AcpiUtCallocate (
if (!Size)
{
_ACPI_REPORT_ERROR (Module, Line, Component,
- ("UtCallocate: Attempt to allocate zero bytes\n"));
- return_PTR (NULL);
+ ("UtCallocate: Attempt to allocate zero bytes, allocating 1 byte\n"));
+ Size = 1;
}
Allocation = AcpiOsAllocate (Size);
@@ -518,7 +518,7 @@ static ACPI_STATUS
AcpiUtCreateList (
char *ListName,
UINT16 ObjectSize,
- ACPI_HANDLE *ReturnCache)
+ ACPI_MEMORY_LIST **ReturnCache)
{
ACPI_MEMORY_LIST *Cache;
diff --git a/usr/src/uts/i86pc/io/acpica/utilities/utcache.c b/usr/src/uts/i86pc/io/acpica/utilities/utcache.c
index 196772cb0d..16052d32d6 100644
--- a/usr/src/uts/i86pc/io/acpica/utilities/utcache.c
+++ b/usr/src/uts/i86pc/io/acpica/utilities/utcache.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: utcache - local cache allocation routines
- * $Revision: 2 $
+ * $Revision: 1.2 $
*
*****************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/utilities/utclib.c b/usr/src/uts/i86pc/io/acpica/utilities/utclib.c
index 62686ca5f3..4070e84164 100644
--- a/usr/src/uts/i86pc/io/acpica/utilities/utclib.c
+++ b/usr/src/uts/i86pc/io/acpica/utilities/utclib.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: cmclib - Local implementation of C library functions
- * $Revision: 58 $
+ * $Revision: 1.58 $
*
*****************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/utilities/utcopy.c b/usr/src/uts/i86pc/io/acpica/utilities/utcopy.c
index 7695ceb157..a69466956f 100644
--- a/usr/src/uts/i86pc/io/acpica/utilities/utcopy.c
+++ b/usr/src/uts/i86pc/io/acpica/utilities/utcopy.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: utcopy - Internal to external object translation utilities
- * $Revision: 121 $
+ * $Revision: 1.122 $
*
*****************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/utilities/utdebug.c b/usr/src/uts/i86pc/io/acpica/utilities/utdebug.c
index 2f69c16820..b25f06af07 100644
--- a/usr/src/uts/i86pc/io/acpica/utilities/utdebug.c
+++ b/usr/src/uts/i86pc/io/acpica/utilities/utdebug.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: utdebug - Debug print routines
- * $Revision: 118 $
+ * $Revision: 1.126 $
*
*****************************************************************************/
@@ -128,6 +128,12 @@ static UINT32 AcpiGbl_PrevThreadId = 0xFFFFFFFF;
static char *AcpiGbl_FnEntryStr = "----Entry";
static char *AcpiGbl_FnExitStr = "----Exit-";
+/* Local prototypes */
+
+static const char *
+AcpiUtTrimFunctionName (
+ const char *FunctionName);
+
/*******************************************************************************
*
@@ -145,7 +151,7 @@ void
AcpiUtInitStackPtrTrace (
void)
{
- UINT32 CurrentSp;
+ UINT32 CurrentSp;
AcpiGbl_EntryStackPointer = ACPI_PTR_DIFF (&CurrentSp, NULL);
@@ -168,7 +174,7 @@ void
AcpiUtTrackStackPtr (
void)
{
- ACPI_SIZE CurrentSp;
+ ACPI_SIZE CurrentSp;
CurrentSp = ACPI_PTR_DIFF (&CurrentSp, NULL);
@@ -187,6 +193,45 @@ AcpiUtTrackStackPtr (
/*******************************************************************************
*
+ * FUNCTION: AcpiUtTrimFunctionName
+ *
+ * PARAMETERS: FunctionName - Ascii string containing a procedure name
+ *
+ * RETURN: Updated pointer to the function name
+ *
+ * DESCRIPTION: Remove the "Acpi" prefix from the function name, if present.
+ * This allows compiler macros such as __FUNCTION__ to be used
+ * with no change to the debug output.
+ *
+ ******************************************************************************/
+
+static const char *
+AcpiUtTrimFunctionName (
+ const char *FunctionName)
+{
+
+ /* All Function names are longer than 4 chars, check is safe */
+
+ if (*(ACPI_CAST_PTR (UINT32, FunctionName)) == ACPI_PREFIX_MIXED)
+ {
+ /* This is the case where the original source has not been modified */
+
+ return (FunctionName + 4);
+ }
+
+ if (*(ACPI_CAST_PTR (UINT32, FunctionName)) == ACPI_PREFIX_LOWER)
+ {
+ /* This is the case where the source has been 'linuxized' */
+
+ return (FunctionName + 5);
+ }
+
+ return (FunctionName);
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: AcpiUtDebugPrint
*
* PARAMETERS: RequestedDebugLevel - Requested debug print level
@@ -208,7 +253,7 @@ void ACPI_INTERNAL_VAR_XFACE
AcpiUtDebugPrint (
UINT32 RequestedDebugLevel,
UINT32 LineNumber,
- char *FunctionName,
+ const char *FunctionName,
char *ModuleName,
UINT32 ComponentId,
char *Format,
@@ -256,7 +301,7 @@ AcpiUtDebugPrint (
}
AcpiOsPrintf ("[%02ld] %-22.22s: ",
- AcpiGbl_NestingLevel, FunctionName);
+ AcpiGbl_NestingLevel, AcpiUtTrimFunctionName (FunctionName));
va_start (args, Format);
AcpiOsVprintf (Format, args);
@@ -286,7 +331,7 @@ void ACPI_INTERNAL_VAR_XFACE
AcpiUtDebugPrintRaw (
UINT32 RequestedDebugLevel,
UINT32 LineNumber,
- char *FunctionName,
+ const char *FunctionName,
char *ModuleName,
UINT32 ComponentId,
char *Format,
@@ -325,7 +370,7 @@ AcpiUtDebugPrintRaw (
void
AcpiUtTrace (
UINT32 LineNumber,
- char *FunctionName,
+ const char *FunctionName,
char *ModuleName,
UINT32 ComponentId)
{
@@ -333,7 +378,7 @@ AcpiUtTrace (
AcpiGbl_NestingLevel++;
AcpiUtTrackStackPtr ();
- AcpiUtDebugPrint (ACPI_LV_FUNCTIONS,
+ AcpiUtDebugPrint (ACPI_LV_FUNCTIONS,
LineNumber, FunctionName, ModuleName, ComponentId,
"%s\n", AcpiGbl_FnEntryStr);
}
@@ -359,7 +404,7 @@ AcpiUtTrace (
void
AcpiUtTracePtr (
UINT32 LineNumber,
- char *FunctionName,
+ const char *FunctionName,
char *ModuleName,
UINT32 ComponentId,
void *Pointer)
@@ -393,7 +438,7 @@ AcpiUtTracePtr (
void
AcpiUtTraceStr (
UINT32 LineNumber,
- char *FunctionName,
+ const char *FunctionName,
char *ModuleName,
UINT32 ComponentId,
char *String)
@@ -428,7 +473,7 @@ AcpiUtTraceStr (
void
AcpiUtTraceU32 (
UINT32 LineNumber,
- char *FunctionName,
+ const char *FunctionName,
char *ModuleName,
UINT32 ComponentId,
UINT32 Integer)
@@ -462,7 +507,7 @@ AcpiUtTraceU32 (
void
AcpiUtExit (
UINT32 LineNumber,
- char *FunctionName,
+ const char *FunctionName,
char *ModuleName,
UINT32 ComponentId)
{
@@ -495,7 +540,7 @@ AcpiUtExit (
void
AcpiUtStatusExit (
UINT32 LineNumber,
- char *FunctionName,
+ const char *FunctionName,
char *ModuleName,
UINT32 ComponentId,
ACPI_STATUS Status)
@@ -540,7 +585,7 @@ AcpiUtStatusExit (
void
AcpiUtValueExit (
UINT32 LineNumber,
- char *FunctionName,
+ const char *FunctionName,
char *ModuleName,
UINT32 ComponentId,
ACPI_INTEGER Value)
@@ -575,7 +620,7 @@ AcpiUtValueExit (
void
AcpiUtPtrExit (
UINT32 LineNumber,
- char *FunctionName,
+ const char *FunctionName,
char *ModuleName,
UINT32 ComponentId,
UINT8 *Ptr)
@@ -689,8 +734,8 @@ AcpiUtDumpBuffer (
}
/*
- * Print the ASCII equivalent characters
- * But watch out for the bad unprintable ones...
+ * Print the ASCII equivalent characters but watch out for the bad
+ * unprintable ones (printable chars are 0x20 through 0x7E)
*/
AcpiOsPrintf (" ");
for (j = 0; j < 16; j++)
@@ -702,9 +747,7 @@ AcpiUtDumpBuffer (
}
BufChar = Buffer[i + j];
- if ((BufChar > 0x1F && BufChar < 0x2E) ||
- (BufChar > 0x2F && BufChar < 0x61) ||
- (BufChar > 0x60 && BufChar < 0x7F))
+ if (ACPI_IS_PRINT (BufChar))
{
AcpiOsPrintf ("%c", BufChar);
}
diff --git a/usr/src/uts/i86pc/io/acpica/utilities/utdelete.c b/usr/src/uts/i86pc/io/acpica/utilities/utdelete.c
index 77b3bf57fc..16ece2faab 100644
--- a/usr/src/uts/i86pc/io/acpica/utilities/utdelete.c
+++ b/usr/src/uts/i86pc/io/acpica/utilities/utdelete.c
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: utdelete - object deletion and reference count utilities
- * $Revision: 107 $
+ * $Revision: 1.107 $
*
******************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/utilities/uteval.c b/usr/src/uts/i86pc/io/acpica/utilities/uteval.c
index 5b309ede74..04135bb55d 100644
--- a/usr/src/uts/i86pc/io/acpica/utilities/uteval.c
+++ b/usr/src/uts/i86pc/io/acpica/utilities/uteval.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: uteval - Object evaluation
- * $Revision: 59 $
+ * $Revision: 1.59 $
*
*****************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/utilities/utglobal.c b/usr/src/uts/i86pc/io/acpica/utilities/utglobal.c
index 6de849c5db..833f1ddc71 100644
--- a/usr/src/uts/i86pc/io/acpica/utilities/utglobal.c
+++ b/usr/src/uts/i86pc/io/acpica/utilities/utglobal.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: utglobal - Global variables for the ACPI subsystem
- * $Revision: 213 $
+ * $Revision: 1.214 $
*
*****************************************************************************/
@@ -907,6 +907,9 @@ AcpiUtInitGlobals (
AcpiGbl_PsFindCount = 0;
AcpiGbl_AcpiHardwarePresent = TRUE;
AcpiGbl_OwnerIdMask = 0;
+ AcpiGbl_TraceMethodName = 0;
+ AcpiGbl_TraceDbgLevel = 0;
+ AcpiGbl_TraceDbgLayer = 0;
AcpiGbl_DebuggerConfiguration = DEBUGGER_THREADING;
AcpiGbl_DbOutputFlags = ACPI_DB_CONSOLE_OUTPUT;
diff --git a/usr/src/uts/i86pc/io/acpica/utilities/utinit.c b/usr/src/uts/i86pc/io/acpica/utilities/utinit.c
index 5863e15a5d..a02328baf3 100644
--- a/usr/src/uts/i86pc/io/acpica/utilities/utinit.c
+++ b/usr/src/uts/i86pc/io/acpica/utilities/utinit.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: utinit - Common ACPI subsystem initialization
- * $Revision: 123 $
+ * $Revision: 1.123 $
*
*****************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/utilities/utmath.c b/usr/src/uts/i86pc/io/acpica/utilities/utmath.c
index 2544ea0250..d82785d6d0 100644
--- a/usr/src/uts/i86pc/io/acpica/utilities/utmath.c
+++ b/usr/src/uts/i86pc/io/acpica/utilities/utmath.c
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: utmath - Integer math support routines
- * $Revision: 16 $
+ * $Revision: 1.17 $
*
******************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/utilities/utmisc.c b/usr/src/uts/i86pc/io/acpica/utilities/utmisc.c
index 546dd1ce91..414e131b63 100644
--- a/usr/src/uts/i86pc/io/acpica/utilities/utmisc.c
+++ b/usr/src/uts/i86pc/io/acpica/utilities/utmisc.c
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: utmisc - common utility procedures
- * $Revision: 116 $
+ * $Revision: 1.124 $
*
******************************************************************************/
@@ -131,7 +131,11 @@
*
* PARAMETERS: OwnerId - Where the new owner ID is returned
*
- * DESCRIPTION: Allocate a table or method owner id
+ * RETURN: Status
+ *
+ * DESCRIPTION: Allocate a table or method owner ID. The owner ID is used to
+ * track objects created by the table or method, to be deleted
+ * when the method exits or the table is unloaded.
*
******************************************************************************/
@@ -141,11 +145,21 @@ AcpiUtAllocateOwnerId (
{
ACPI_NATIVE_UINT i;
ACPI_STATUS Status;
-
-
+
+
ACPI_FUNCTION_TRACE ("UtAllocateOwnerId");
-
-
+
+
+ /* Guard against multiple allocations of ID to the same location */
+
+ if (*OwnerId)
+ {
+ ACPI_REPORT_ERROR (("Owner ID [%2.2X] already exists\n", *OwnerId));
+ return_ACPI_STATUS (AE_ALREADY_EXISTS);
+ }
+
+ /* Mutex for the global ID mask */
+
Status = AcpiUtAcquireMutex (ACPI_MTX_CACHES);
if (ACPI_FAILURE (Status))
{
@@ -154,28 +168,33 @@ AcpiUtAllocateOwnerId (
/* Find a free owner ID */
- for (i = 0; i < 32; i++)
+ for (i = 0; i < 32; i++)
{
if (!(AcpiGbl_OwnerIdMask & (1 << i)))
{
+ ACPI_DEBUG_PRINT ((ACPI_DB_VALUES,
+ "Current OwnerId mask: %8.8X New ID: %2.2X\n",
+ AcpiGbl_OwnerIdMask, (unsigned int) (i + 1)));
+
AcpiGbl_OwnerIdMask |= (1 << i);
- *OwnerId = (ACPI_OWNER_ID) i;
- goto exit;
+ *OwnerId = (ACPI_OWNER_ID) (i + 1);
+ goto Exit;
}
}
- /*
+ /*
* If we are here, all OwnerIds have been allocated. This probably should
* not happen since the IDs are reused after deallocation. The IDs are
* allocated upon table load (one per table) and method execution, and
* they are released when a table is unloaded or a method completes
* execution.
*/
+ *OwnerId = 0;
Status = AE_OWNER_ID_LIMIT;
ACPI_REPORT_ERROR ((
"Could not allocate new OwnerId (32 max), AE_OWNER_ID_LIMIT\n"));
-exit:
+Exit:
(void) AcpiUtReleaseMutex (ACPI_MTX_CACHES);
return_ACPI_STATUS (Status);
}
@@ -185,43 +204,60 @@ exit:
*
* FUNCTION: AcpiUtReleaseOwnerId
*
- * PARAMETERS: OwnerId - A previously allocated owner ID
+ * PARAMETERS: OwnerIdPtr - Pointer to a previously allocated OwnerID
*
- * DESCRIPTION: Release a table or method owner id
+ * RETURN: None. No error is returned because we are either exiting a
+ * control method or unloading a table. Either way, we would
+ * ignore any error anyway.
+ *
+ * DESCRIPTION: Release a table or method owner ID. Valid IDs are 1 - 32
*
******************************************************************************/
-ACPI_STATUS
+void
AcpiUtReleaseOwnerId (
- ACPI_OWNER_ID OwnerId)
+ ACPI_OWNER_ID *OwnerIdPtr)
{
+ ACPI_OWNER_ID OwnerId = *OwnerIdPtr;
ACPI_STATUS Status;
- ACPI_FUNCTION_TRACE ("UtReleaseOwnerId");
+ ACPI_FUNCTION_TRACE_U32 ("UtReleaseOwnerId", OwnerId);
+
+ /* Always clear the input OwnerId (zero is an invalid ID) */
+
+ *OwnerIdPtr = 0;
+
+ /* Zero is not a valid OwnerID */
+
+ if ((OwnerId == 0) || (OwnerId > 32))
+ {
+ ACPI_REPORT_ERROR (("Invalid OwnerId: %2.2X\n", OwnerId));
+ return_VOID;
+ }
+
+ /* Mutex for the global ID mask */
Status = AcpiUtAcquireMutex (ACPI_MTX_CACHES);
if (ACPI_FAILURE (Status))
{
- return_ACPI_STATUS (Status);
+ return_VOID;
}
- /* Free the owner ID */
+ /* Normalize the ID to zero */
+
+ OwnerId--;
+
+ /* Free the owner ID only if it is valid */
if (AcpiGbl_OwnerIdMask & (1 << OwnerId))
{
AcpiGbl_OwnerIdMask ^= (1 << OwnerId);
}
- else
- {
- /* This OwnerId has not been allocated */
-
- Status = AE_NOT_EXIST;
- }
(void) AcpiUtReleaseMutex (ACPI_MTX_CACHES);
- return_ACPI_STATUS (Status);
+ return_VOID;
}
@@ -231,7 +267,7 @@ AcpiUtReleaseOwnerId (
*
* PARAMETERS: SrcString - The source string to convert
*
- * RETURN: Converted SrcString (same as input pointer)
+ * RETURN: None
*
* DESCRIPTION: Convert string to uppercase
*
@@ -239,7 +275,7 @@ AcpiUtReleaseOwnerId (
*
******************************************************************************/
-char *
+void
AcpiUtStrupr (
char *SrcString)
{
@@ -251,7 +287,7 @@ AcpiUtStrupr (
if (!SrcString)
{
- return (NULL);
+ return;
}
/* Walk entire string, uppercasing the letters */
@@ -261,7 +297,7 @@ AcpiUtStrupr (
*String = (char) ACPI_TOUPPER (*String);
}
- return (SrcString);
+ return;
}
@@ -974,7 +1010,7 @@ AcpiUtGetResourceEndTag (
while (Buffer < EndBuffer)
{
BufferByte = *Buffer;
- if (BufferByte & ACPI_RDESC_TYPE_MASK)
+ if (BufferByte & ACPI_RESOURCE_NAME_LARGE)
{
/* Large Descriptor - Length is next 2 bytes */
@@ -984,7 +1020,7 @@ AcpiUtGetResourceEndTag (
{
/* Small Descriptor. End Tag will be found here */
- if ((BufferByte & ACPI_RDESC_SMALL_MASK) == ACPI_RDESC_TYPE_END_TAG)
+ if ((BufferByte & ACPI_RESOURCE_NAME_SMALL_MASK) == ACPI_RESOURCE_NAME_END_TAG)
{
/* Found the end tag descriptor, all done. */
diff --git a/usr/src/uts/i86pc/io/acpica/utilities/utmutex.c b/usr/src/uts/i86pc/io/acpica/utilities/utmutex.c
index 2b99b3a4fe..d09b9b8c48 100644
--- a/usr/src/uts/i86pc/io/acpica/utilities/utmutex.c
+++ b/usr/src/uts/i86pc/io/acpica/utilities/utmutex.c
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: utmutex - local mutex support
- * $Revision: 2 $
+ * $Revision: 1.3 $
*
******************************************************************************/
@@ -326,7 +326,7 @@ AcpiUtAcquireMutex (
*/
for (i = MutexId; i < MAX_MUTEX; i++)
{
- if (AcpiGbl_MutexInfo[i].OwnerId == ThisThreadId)
+ if (AcpiGbl_MutexInfo[i].ThreadId == ThisThreadId)
{
if (i == MutexId)
{
@@ -432,7 +432,7 @@ AcpiUtReleaseMutex (
*/
for (i = MutexId; i < MAX_MUTEX; i++)
{
- if (AcpiGbl_MutexInfo[i].OwnerId == ThisThreadId)
+ if (AcpiGbl_MutexInfo[i].ThreadId == ThisThreadId)
{
if (i == MutexId)
{
diff --git a/usr/src/uts/i86pc/io/acpica/utilities/utobject.c b/usr/src/uts/i86pc/io/acpica/utilities/utobject.c
index 39f1b44806..36a939d5ad 100644
--- a/usr/src/uts/i86pc/io/acpica/utilities/utobject.c
+++ b/usr/src/uts/i86pc/io/acpica/utilities/utobject.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: utobject - ACPI object create/delete/size/cache routines
- * $Revision: 97 $
+ * $Revision: 1.97 $
*
*****************************************************************************/
diff --git a/usr/src/uts/i86pc/io/acpica/utilities/utstate.c b/usr/src/uts/i86pc/io/acpica/utilities/utstate.c
index ce9a20ccd6..cec1016d14 100644
--- a/usr/src/uts/i86pc/io/acpica/utilities/utstate.c
+++ b/usr/src/uts/i86pc/io/acpica/utilities/utstate.c
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: utstate - state object support procedures
- * $Revision: 1 $
+ * $Revision: 1.2 $
*
******************************************************************************/
@@ -455,5 +455,3 @@ AcpiUtDeleteGenericState (
}
-
-
diff --git a/usr/src/uts/i86pc/io/acpica/utilities/utxface.c b/usr/src/uts/i86pc/io/acpica/utilities/utxface.c
index f66b265581..ff259e6c73 100644
--- a/usr/src/uts/i86pc/io/acpica/utilities/utxface.c
+++ b/usr/src/uts/i86pc/io/acpica/utilities/utxface.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: utxface - External interfaces for "global" ACPI functions
- * $Revision: 112 $
+ * $Revision: 1.112 $
*
*****************************************************************************/
diff --git a/usr/src/uts/i86pc/io/psm/psm_common.c b/usr/src/uts/i86pc/io/psm/psm_common.c
index 4809daffed..ef3d09bd41 100644
--- a/usr/src/uts/i86pc/io/psm/psm_common.c
+++ b/usr/src/uts/i86pc/io/psm/psm_common.c
@@ -102,11 +102,6 @@ int psm_verbose = 0;
static ACPI_HANDLE acpi_sbobj = NULL;
static kmutex_t acpi_irq_cache_mutex;
-#define D2A_INITLEN 20
-static int d2a_len = 0;
-static int d2a_valid = 0;
-static d2a *d2a_table;
-
/*
* irq_cache_table is a list that serves a two-key cache. It is used
* as a pci busid/devid/ipin <-> irq cache and also as a acpi
@@ -476,7 +471,7 @@ acpi_set_irq_resource(acpi_psm_lnk_t *acpipsmlnkp, int irq)
ACPI_RESOURCE *resp;
ACPI_RESOURCE *srsp;
ACPI_HANDLE lnkobj;
- int status;
+ int srs_len, status;
ASSERT(acpipsmlnkp != NULL);
@@ -498,20 +493,21 @@ acpi_set_irq_resource(acpi_psm_lnk_t *acpipsmlnkp, int irq)
* Find an IRQ resource descriptor to use as template
*/
srsp = NULL;
- for (resp = rsb.Pointer; resp->Length != 0;
+ for (resp = rsb.Pointer; resp->Type != ACPI_RESOURCE_TYPE_END_TAG;
resp = ACPI_NEXT_RESOURCE(resp)) {
- if ((resp->Id == ACPI_RSTYPE_IRQ) ||
- (resp->Id == ACPI_RSTYPE_EXT_IRQ)) {
+ if ((resp->Type == ACPI_RESOURCE_TYPE_IRQ) ||
+ (resp->Type == ACPI_RESOURCE_TYPE_EXTENDED_IRQ)) {
+ ACPI_RESOURCE *endtag;
/*
- * Mild trickery here; allocate two
- * resource structures, and set the Length
- * field of the second one to 0 to terminate
- * the list. Copy the possible resource into
- * the first one as a template.
+ * Allocate enough room for this resource entry
+ * and one end tag following it
*/
- srsp = kmem_zalloc(2 * sizeof (*srsp), KM_SLEEP);
- srsp[1].Length = 0;
- *srsp = *resp;
+ srs_len = resp->Length + sizeof (*endtag);
+ srsp = kmem_zalloc(srs_len, KM_SLEEP);
+ bcopy(resp, srsp, resp->Length);
+ endtag = ACPI_NEXT_RESOURCE(srsp);
+ endtag->Type = ACPI_RESOURCE_TYPE_END_TAG;
+ endtag->Length = 0;
break; /* drop out of the loop */
}
}
@@ -528,21 +524,21 @@ acpi_set_irq_resource(acpi_psm_lnk_t *acpipsmlnkp, int irq)
* The Interrupts[] array is always at least one entry
* long; see the definition of ACPI_RESOURCE.
*/
- switch (srsp->Id) {
- case ACPI_RSTYPE_IRQ:
- srsp->Data.Irq.NumberOfInterrupts = 1;
+ switch (srsp->Type) {
+ case ACPI_RESOURCE_TYPE_IRQ:
+ srsp->Data.Irq.InterruptCount = 1;
srsp->Data.Irq.Interrupts[0] = irq;
break;
- case ACPI_RSTYPE_EXT_IRQ:
- srsp->Data.ExtendedIrq.NumberOfInterrupts = 1;
+ case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
+ srsp->Data.ExtendedIrq.InterruptCount = 1;
srsp->Data.ExtendedIrq.Interrupts[0] = irq;
break;
}
rsb.Pointer = srsp;
- rsb.Length = 2 * sizeof (*srsp);
+ rsb.Length = srs_len;
status = AcpiSetCurrentResources(lnkobj, &rsb);
- kmem_free(srsp, 2 * sizeof (*srsp));
+ kmem_free(srsp, srs_len);
if (status != AE_OK) {
cmn_err(CE_WARN, "!psm: set_irq: _SRS failed");
return (ACPI_PSM_FAILURE);
@@ -630,8 +626,9 @@ acpi_get_current_irq_resource(acpi_psm_lnk_t *acpipsmlnkp, int *pci_irqp,
}
irq = -1;
- for (rp = rb.Pointer; rp->Length != 0; rp = ACPI_NEXT_RESOURCE(rp)) {
- if (rp->Id == ACPI_RSTYPE_IRQ) {
+ for (rp = rb.Pointer; rp->Type != ACPI_RESOURCE_TYPE_END_TAG;
+ rp = ACPI_NEXT_RESOURCE(rp)) {
+ if (rp->Type == ACPI_RESOURCE_TYPE_IRQ) {
if (irq > 0) {
PSM_VERBOSE_IRQ((CE_WARN, "!psm: multiple IRQ"
" from _CRS "));
@@ -639,7 +636,7 @@ acpi_get_current_irq_resource(acpi_psm_lnk_t *acpipsmlnkp, int *pci_irqp,
break;
}
- if (rp->Data.Irq.NumberOfInterrupts != 1) {
+ if (rp->Data.Irq.InterruptCount != 1) {
PSM_VERBOSE_IRQ((CE_WARN, "!psm: <>1 interrupt"
" from _CRS "));
status = ACPI_PSM_FAILURE;
@@ -647,12 +644,12 @@ acpi_get_current_irq_resource(acpi_psm_lnk_t *acpipsmlnkp, int *pci_irqp,
}
intr_flagp->intr_el = psm_acpi_edgelevel(
- rp->Data.Irq.EdgeLevel);
+ rp->Data.Irq.Triggering);
intr_flagp->intr_po = psm_acpi_po(
- rp->Data.Irq.ActiveHighLow);
+ rp->Data.Irq.Polarity);
irq = rp->Data.Irq.Interrupts[0];
status = ACPI_PSM_SUCCESS;
- } else if (rp->Id == ACPI_RSTYPE_EXT_IRQ) {
+ } else if (rp->Type == ACPI_RESOURCE_TYPE_EXTENDED_IRQ) {
if (irq > 0) {
PSM_VERBOSE_IRQ((CE_WARN, "!psm: multiple IRQ"
" from _CRS "));
@@ -660,7 +657,7 @@ acpi_get_current_irq_resource(acpi_psm_lnk_t *acpipsmlnkp, int *pci_irqp,
break;
}
- if (rp->Data.ExtendedIrq.NumberOfInterrupts != 1) {
+ if (rp->Data.ExtendedIrq.InterruptCount != 1) {
PSM_VERBOSE_IRQ((CE_WARN, "!psm: <>1 interrupt"
" from _CRS "));
status = ACPI_PSM_FAILURE;
@@ -668,9 +665,9 @@ acpi_get_current_irq_resource(acpi_psm_lnk_t *acpipsmlnkp, int *pci_irqp,
}
intr_flagp->intr_el = psm_acpi_edgelevel(
- rp->Data.ExtendedIrq.EdgeLevel);
+ rp->Data.ExtendedIrq.Triggering);
intr_flagp->intr_po = psm_acpi_po(
- rp->Data.ExtendedIrq.ActiveHighLow);
+ rp->Data.ExtendedIrq.Polarity);
irq = rp->Data.ExtendedIrq.Interrupts[0];
status = ACPI_PSM_SUCCESS;
}
@@ -795,20 +792,20 @@ acpi_get_possible_irq_resources(acpi_psm_lnk_t *acpipsmlnkp,
* Scan the resources looking for an interrupt resource
*/
*irqlistp = 0;
- for (resp = rsb.Pointer; resp->Length != 0;
+ for (resp = rsb.Pointer; resp->Type != ACPI_RESOURCE_TYPE_END_TAG;
resp = ACPI_NEXT_RESOURCE(resp)) {
- switch (resp->Id) {
- case ACPI_RSTYPE_IRQ:
- irqlist_len = resp->Data.Irq.NumberOfInterrupts;
+ switch (resp->Type) {
+ case ACPI_RESOURCE_TYPE_IRQ:
+ irqlist_len = resp->Data.Irq.InterruptCount;
tmplist = resp->Data.Irq.Interrupts;
- el = resp->Data.Irq.EdgeLevel;
- po = resp->Data.Irq.ActiveHighLow;
+ el = resp->Data.Irq.Triggering;
+ po = resp->Data.Irq.Polarity;
break;
- case ACPI_RSTYPE_EXT_IRQ:
- irqlist_len = resp->Data.ExtendedIrq.NumberOfInterrupts;
+ case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
+ irqlist_len = resp->Data.ExtendedIrq.InterruptCount;
tmplist = resp->Data.ExtendedIrq.Interrupts;
- el = resp->Data.ExtendedIrq.EdgeLevel;
- po = resp->Data.ExtendedIrq.ActiveHighLow;
+ el = resp->Data.ExtendedIrq.Triggering;
+ po = resp->Data.ExtendedIrq.Polarity;
break;
default:
continue;
diff --git a/usr/src/uts/intel/sys/acpi/acconfig.h b/usr/src/uts/intel/sys/acpi/acconfig.h
index a6885bc538..f19d47b7a0 100644
--- a/usr/src/uts/intel/sys/acpi/acconfig.h
+++ b/usr/src/uts/intel/sys/acpi/acconfig.h
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: acconfig.h - Global configuration constants
- * $Revision: 189 $
+ * $Revision: 1.193 $
*
*****************************************************************************/
@@ -135,9 +135,9 @@
*
*/
-/* Version string */
+/* Current ACPICA subsystem version in YYYYMMDD format */
-#define ACPI_CA_VERSION 0x20050708
+#define ACPI_CA_VERSION 0x20050930
/*
* OS name, used for the _OS object. The _OS object is essentially obsolete,
diff --git a/usr/src/uts/intel/sys/acpi/acdebug.h b/usr/src/uts/intel/sys/acpi/acdebug.h
index dbe476e6c2..7222fed50a 100644
--- a/usr/src/uts/intel/sys/acpi/acdebug.h
+++ b/usr/src/uts/intel/sys/acpi/acdebug.h
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: acdebug.h - ACPI/AML debugger
- * $Revision: 80 $
+ * $Revision: 1.80 $
*
*****************************************************************************/
diff --git a/usr/src/uts/intel/sys/acpi/acdisasm.h b/usr/src/uts/intel/sys/acpi/acdisasm.h
index 7b7c83b371..48ced65561 100644
--- a/usr/src/uts/intel/sys/acpi/acdisasm.h
+++ b/usr/src/uts/intel/sys/acpi/acdisasm.h
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: acdisasm.h - AML disassembler
- * $Revision: 21 $
+ * $Revision: 1.23 $
*
*****************************************************************************/
@@ -333,61 +333,61 @@ AcpiDmDecodeAttribute (
*/
void
AcpiDmWordDescriptor (
- ASL_WORD_ADDRESS_DESC *Resource,
+ AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmDwordDescriptor (
- ASL_DWORD_ADDRESS_DESC *Resource,
+ AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmExtendedDescriptor (
- ASL_EXTENDED_ADDRESS_DESC *Resource,
+ AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmQwordDescriptor (
- ASL_QWORD_ADDRESS_DESC *Resource,
+ AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmMemory24Descriptor (
- ASL_MEMORY_24_DESC *Resource,
+ AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmMemory32Descriptor (
- ASL_MEMORY_32_DESC *Resource,
+ AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
-AcpiDmFixedMem32Descriptor (
- ASL_FIXED_MEMORY_32_DESC *Resource,
+AcpiDmFixedMemory32Descriptor (
+ AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmGenericRegisterDescriptor (
- ASL_GENERAL_REGISTER_DESC *Resource,
+ AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmInterruptDescriptor (
- ASL_EXTENDED_XRUPT_DESC *Resource,
+ AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmVendorLargeDescriptor (
- ASL_LARGE_VENDOR_DESC *Resource,
+ AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
@@ -397,43 +397,43 @@ AcpiDmVendorLargeDescriptor (
*/
void
AcpiDmIrqDescriptor (
- ASL_IRQ_FORMAT_DESC *Resource,
+ AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmDmaDescriptor (
- ASL_DMA_FORMAT_DESC *Resource,
+ AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmIoDescriptor (
- ASL_IO_PORT_DESC *Resource,
+ AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmFixedIoDescriptor (
- ASL_FIXED_IO_PORT_DESC *Resource,
+ AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmStartDependentDescriptor (
- ASL_START_DEPENDENT_DESC *Resource,
+ AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmEndDependentDescriptor (
- ASL_START_DEPENDENT_DESC *Resource,
+ AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmVendorSmallDescriptor (
- ASL_SMALL_VENDOR_DESC *Resource,
+ AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
diff --git a/usr/src/uts/intel/sys/acpi/acdispat.h b/usr/src/uts/intel/sys/acpi/acdispat.h
index 75b4e0d921..f7cedf4271 100644
--- a/usr/src/uts/intel/sys/acpi/acdispat.h
+++ b/usr/src/uts/intel/sys/acpi/acdispat.h
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: acdispat.h - dispatcher (parser to interpreter interface)
- * $Revision: 65 $
+ * $Revision: 1.67 $
*
*****************************************************************************/
@@ -309,7 +309,7 @@ AcpiDsMethodDataInit (
*/
ACPI_STATUS
AcpiDsParseMethod (
- ACPI_HANDLE ObjHandle);
+ ACPI_NAMESPACE_NODE *Node);
ACPI_STATUS
AcpiDsCallControlMethod (
@@ -322,7 +322,7 @@ AcpiDsRestartControlMethod (
ACPI_WALK_STATE *WalkState,
ACPI_OPERAND_OBJECT *ReturnDesc);
-ACPI_STATUS
+void
AcpiDsTerminateControlMethod (
ACPI_WALK_STATE *WalkState);
@@ -464,7 +464,7 @@ AcpiDsInitAmlWalk (
UINT8 *AmlStart,
UINT32 AmlLength,
ACPI_PARAMETER_INFO *Info,
- UINT32 PassNumber);
+ UINT8 PassNumber);
ACPI_STATUS
AcpiDsObjStackPopAndDelete (
diff --git a/usr/src/uts/intel/sys/acpi/acevents.h b/usr/src/uts/intel/sys/acpi/acevents.h
index 41acc09743..58dc9a176b 100644
--- a/usr/src/uts/intel/sys/acpi/acevents.h
+++ b/usr/src/uts/intel/sys/acpi/acevents.h
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: acevents.h - Event subcomponent prototypes and defines
- * $Revision: 103 $
+ * $Revision: 1.103 $
*
*****************************************************************************/
diff --git a/usr/src/uts/intel/sys/acpi/acexcep.h b/usr/src/uts/intel/sys/acpi/acexcep.h
index c56966096d..cf5d0ba7e8 100644
--- a/usr/src/uts/intel/sys/acpi/acexcep.h
+++ b/usr/src/uts/intel/sys/acpi/acexcep.h
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: acexcep.h - Exception codes returned by the ACPI subsystem
- * $Revision: 75 $
+ * $Revision: 1.75 $
*
*****************************************************************************/
diff --git a/usr/src/uts/intel/sys/acpi/acglobal.h b/usr/src/uts/intel/sys/acpi/acglobal.h
index 170cdeedc9..0046ae140b 100644
--- a/usr/src/uts/intel/sys/acpi/acglobal.h
+++ b/usr/src/uts/intel/sys/acpi/acglobal.h
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: acglobal.h - Declarations for global variables
- * $Revision: 167 $
+ * $Revision: 1.168 $
*
*****************************************************************************/
@@ -155,6 +155,14 @@ extern UINT32 AcpiDbgLayer;
extern UINT32 AcpiGbl_NestingLevel;
+/* Support for dynamic control method tracing mechanism */
+
+ACPI_EXTERN UINT32 AcpiGbl_OriginalDbgLevel;
+ACPI_EXTERN UINT32 AcpiGbl_OriginalDbgLayer;
+ACPI_EXTERN ACPI_NAME AcpiGbl_TraceMethodName;
+ACPI_EXTERN UINT32 AcpiGbl_TraceDbgLevel;
+ACPI_EXTERN UINT32 AcpiGbl_TraceDbgLayer;
+ACPI_EXTERN UINT32 AcpiGbl_TraceFlags;
/*****************************************************************************
*
diff --git a/usr/src/uts/intel/sys/acpi/achware.h b/usr/src/uts/intel/sys/acpi/achware.h
index 1b69a7bf45..76916b582c 100644
--- a/usr/src/uts/intel/sys/acpi/achware.h
+++ b/usr/src/uts/intel/sys/acpi/achware.h
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: achware.h -- hardware specific interfaces
- * $Revision: 78 $
+ * $Revision: 1.79 $
*
*****************************************************************************/
diff --git a/usr/src/uts/intel/sys/acpi/acinterp.h b/usr/src/uts/intel/sys/acpi/acinterp.h
index d642cdf737..470eef6eab 100644
--- a/usr/src/uts/intel/sys/acpi/acinterp.h
+++ b/usr/src/uts/intel/sys/acpi/acinterp.h
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: acinterp.h - Interpreter subcomponent prototypes and defines
- * $Revision: 162 $
+ * $Revision: 1.162 $
*
*****************************************************************************/
diff --git a/usr/src/uts/intel/sys/acpi/aclocal.h b/usr/src/uts/intel/sys/acpi/aclocal.h
index 7aa6dcf0db..314d69bbb6 100644
--- a/usr/src/uts/intel/sys/acpi/aclocal.h
+++ b/usr/src/uts/intel/sys/acpi/aclocal.h
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: aclocal.h - Internal data types used across the ACPI subsystem
- * $Revision: 211 $
+ * $Revision: 1.215 $
*
*****************************************************************************/
@@ -946,45 +946,53 @@ typedef struct acpi_bit_register_info
/* ResourceType values */
-#define ACPI_RESOURCE_TYPE_MEMORY_RANGE 0
-#define ACPI_RESOURCE_TYPE_IO_RANGE 1
-#define ACPI_RESOURCE_TYPE_BUS_NUMBER_RANGE 2
+#define ACPI_ADDRESS_TYPE_MEMORY_RANGE 0
+#define ACPI_ADDRESS_TYPE_IO_RANGE 1
+#define ACPI_ADDRESS_TYPE_BUS_NUMBER_RANGE 2
/* Resource descriptor types and masks */
-#define ACPI_RDESC_TYPE_LARGE 0x80
-#define ACPI_RDESC_TYPE_SMALL 0x00
+#define ACPI_RESOURCE_NAME_LARGE 0x80
+#define ACPI_RESOURCE_NAME_SMALL 0x00
-#define ACPI_RDESC_TYPE_MASK 0x80
-#define ACPI_RDESC_SMALL_MASK 0x78 /* Only bits 6:3 contain the type */
+#define ACPI_RESOURCE_NAME_SMALL_MASK 0x78 /* Bits 6:3 contain the type */
+#define ACPI_RESOURCE_NAME_SMALL_LENGTH_MASK 0x07 /* Bits 2:0 contain the length */
+#define ACPI_RESOURCE_NAME_LARGE_MASK 0x7F /* Bits 6:0 contain the type */
/*
- * Small resource descriptor types
- * Note: The 3 length bits (2:0) must be zero
+ * Small resource descriptor "names" as defined by the ACPI specification.
+ * Note: Bits 2:0 are used for the descriptor length
*/
-#define ACPI_RDESC_TYPE_IRQ_FORMAT 0x20
-#define ACPI_RDESC_TYPE_DMA_FORMAT 0x28
-#define ACPI_RDESC_TYPE_START_DEPENDENT 0x30
-#define ACPI_RDESC_TYPE_END_DEPENDENT 0x38
-#define ACPI_RDESC_TYPE_IO_PORT 0x40
-#define ACPI_RDESC_TYPE_FIXED_IO_PORT 0x48
-#define ACPI_RDESC_TYPE_SMALL_VENDOR 0x70
-#define ACPI_RDESC_TYPE_END_TAG 0x78
+#define ACPI_RESOURCE_NAME_IRQ 0x20
+#define ACPI_RESOURCE_NAME_DMA 0x28
+#define ACPI_RESOURCE_NAME_START_DEPENDENT 0x30
+#define ACPI_RESOURCE_NAME_END_DEPENDENT 0x38
+#define ACPI_RESOURCE_NAME_IO 0x40
+#define ACPI_RESOURCE_NAME_FIXED_IO 0x48
+#define ACPI_RESOURCE_NAME_RESERVED_S1 0x50
+#define ACPI_RESOURCE_NAME_RESERVED_S2 0x58
+#define ACPI_RESOURCE_NAME_RESERVED_S3 0x60
+#define ACPI_RESOURCE_NAME_RESERVED_S4 0x68
+#define ACPI_RESOURCE_NAME_VENDOR_SMALL 0x70
+#define ACPI_RESOURCE_NAME_END_TAG 0x78
/*
- * Large resource descriptor types
+ * Large resource descriptor "names" as defined by the ACPI specification.
+ * Note: includes the Large Descriptor bit in bit[7]
*/
-#define ACPI_RDESC_TYPE_MEMORY_24 0x81
-#define ACPI_RDESC_TYPE_GENERAL_REGISTER 0x82
-#define ACPI_RDESC_TYPE_LARGE_VENDOR 0x84
-#define ACPI_RDESC_TYPE_MEMORY_32 0x85
-#define ACPI_RDESC_TYPE_FIXED_MEMORY_32 0x86
-#define ACPI_RDESC_TYPE_DWORD_ADDRESS_SPACE 0x87
-#define ACPI_RDESC_TYPE_WORD_ADDRESS_SPACE 0x88
-#define ACPI_RDESC_TYPE_EXTENDED_XRUPT 0x89
-#define ACPI_RDESC_TYPE_QWORD_ADDRESS_SPACE 0x8A
-#define ACPI_RDESC_TYPE_EXTENDED_ADDRESS_SPACE 0x8B
+#define ACPI_RESOURCE_NAME_MEMORY24 0x81
+#define ACPI_RESOURCE_NAME_GENERIC_REGISTER 0x82
+#define ACPI_RESOURCE_NAME_RESERVED_L1 0x83
+#define ACPI_RESOURCE_NAME_VENDOR_LARGE 0x84
+#define ACPI_RESOURCE_NAME_MEMORY32 0x85
+#define ACPI_RESOURCE_NAME_FIXED_MEMORY32 0x86
+#define ACPI_RESOURCE_NAME_ADDRESS32 0x87
+#define ACPI_RESOURCE_NAME_ADDRESS16 0x88
+#define ACPI_RESOURCE_NAME_EXTENDED_IRQ 0x89
+#define ACPI_RESOURCE_NAME_ADDRESS64 0x8A
+#define ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64 0x8B
+#define ACPI_RESOURCE_NAME_LARGE_MAX 0x8B
/*****************************************************************************
@@ -993,7 +1001,7 @@ typedef struct acpi_bit_register_info
*
****************************************************************************/
-#define ACPI_ASCII_ZERO 0x30
+#define ACPI_ASCII_ZERO 0x30
/*****************************************************************************
diff --git a/usr/src/uts/intel/sys/acpi/acmacros.h b/usr/src/uts/intel/sys/acpi/acmacros.h
index b088f7ce0b..50c9503c1e 100644
--- a/usr/src/uts/intel/sys/acpi/acmacros.h
+++ b/usr/src/uts/intel/sys/acpi/acmacros.h
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: acmacros.h - C macros for the entire subsystem.
- * $Revision: 160 $
+ * $Revision: 1.163 $
*
*****************************************************************************/
@@ -569,7 +569,7 @@
/*
* If ACPI_GET_FUNCTION_NAME was not defined in the compiler-dependent header,
* define it now. This is the case where there the compiler does not support
- * a __FUNCTION__ macro or equivalent. We save the function name on the
+ * a __FUNCTION__ macro or equivalent. We save the function name on the
* local stack.
*/
#ifndef ACPI_GET_FUNCTION_NAME
@@ -578,8 +578,10 @@
* The Name parameter should be the procedure name as a quoted string.
* This is declared as a local string ("MyFunctionName") so that it can
* be also used by the function exit macros below.
+ * Note: (const char) is used to be compatible with the debug interfaces
+ * and macros such as __FUNCTION__.
*/
-#define ACPI_FUNCTION_NAME(Name) char *_AcpiFunctionName = Name;
+#define ACPI_FUNCTION_NAME(Name) const char *_AcpiFunctionName = Name;
#else
/* Compiler supports __FUNCTION__ (or equivalent) -- Ignore this macro */
@@ -604,6 +606,9 @@
* bad form, but having a separate exit macro is very ugly and difficult to maintain.
* One of the FUNCTION_TRACE macros above must be used in conjunction with these macros
* so that "_AcpiFunctionName" is defined.
+ *
+ * Note: the DO_WHILE0 macro is used to prevent some compilers from complaining
+ * about these constructs.
*/
#ifdef ACPI_USE_DO_WHILE_0
#define ACPI_DO_WHILE0(a) do a while(0)
@@ -611,10 +616,56 @@
#define ACPI_DO_WHILE0(a) a
#endif
-#define return_VOID ACPI_DO_WHILE0 ({AcpiUtExit(ACPI_DEBUG_PARAMETERS);return;})
-#define return_ACPI_STATUS(s) ACPI_DO_WHILE0 ({AcpiUtStatusExit(ACPI_DEBUG_PARAMETERS,(s));return((s));})
-#define return_VALUE(s) ACPI_DO_WHILE0 ({AcpiUtValueExit(ACPI_DEBUG_PARAMETERS,(ACPI_INTEGER)(s));return((s));})
-#define return_PTR(s) ACPI_DO_WHILE0 ({AcpiUtPtrExit(ACPI_DEBUG_PARAMETERS,(UINT8 *)(s));return((s));})
+#define return_VOID ACPI_DO_WHILE0 ({ \
+ AcpiUtExit (ACPI_DEBUG_PARAMETERS); \
+ return;})
+/*
+ * There are two versions of most of the return macros. The default version is
+ * safer, since it avoids side-effects by guaranteeing that the argument will
+ * not be evaluated twice.
+ *
+ * A less-safe version of the macros is provided for optional use if the
+ * compiler uses excessive CPU stack (for example, this may happen in the
+ * debug case if code optimzation is disabled.)
+ */
+#ifndef ACPI_SIMPLE_RETURN_MACROS
+
+#define return_ACPI_STATUS(s) ACPI_DO_WHILE0 ({ \
+ register ACPI_STATUS _s = (s); \
+ AcpiUtStatusExit (ACPI_DEBUG_PARAMETERS, _s); \
+ return (_s); })
+#define return_PTR(s) ACPI_DO_WHILE0 ({ \
+ register void *_s = (void *) (s); \
+ AcpiUtPtrExit (ACPI_DEBUG_PARAMETERS, (UINT8 *) _s); \
+ return (_s); })
+#define return_VALUE(s) ACPI_DO_WHILE0 ({ \
+ register ACPI_INTEGER _s = (s); \
+ AcpiUtValueExit (ACPI_DEBUG_PARAMETERS, _s); \
+ return (_s); })
+#define return_UINT8(s) ACPI_DO_WHILE0 ({ \
+ register UINT8 _s = (UINT8) (s); \
+ AcpiUtValueExit (ACPI_DEBUG_PARAMETERS, _s); \
+ return (_s); })
+#define return_UINT32(s) ACPI_DO_WHILE0 ({ \
+ register UINT32 _s = (UINT32) (s); \
+ AcpiUtValueExit (ACPI_DEBUG_PARAMETERS, _s); \
+ return (_s); })
+#else /* Use original less-safe macros */
+
+#define return_ACPI_STATUS(s) ACPI_DO_WHILE0 ({ \
+ AcpiUtStatusExit (ACPI_DEBUG_PARAMETERS, (s)); \
+ return((s)); })
+#define return_PTR(s) ACPI_DO_WHILE0 ({ \
+ AcpiUtPtrExit (ACPI_DEBUG_PARAMETERS, (UINT8 *) (s)); \
+ return((s)); })
+#define return_VALUE(s) ACPI_DO_WHILE0 ({ \
+ AcpiUtValueExit (ACPI_DEBUG_PARAMETERS, (ACPI_INTEGER) (s)); \
+ return((s)); })
+#define return_UINT8(s) return_VALUE(s)
+#define return_UINT32(s) return_VALUE(s)
+
+#endif /* ACPI_SIMPLE_RETURN_MACROS */
+
/* Conditional execution */
@@ -696,6 +747,8 @@
#define return_VOID return
#define return_ACPI_STATUS(s) return(s)
#define return_VALUE(s) return(s)
+#define return_UINT8(s) return(s)
+#define return_UINT32(s) return(s)
#define return_PTR(s) return(s)
#endif
diff --git a/usr/src/uts/intel/sys/acpi/acnames.h b/usr/src/uts/intel/sys/acpi/acnames.h
index 80b491445c..243cc3478c 100644
--- a/usr/src/uts/intel/sys/acpi/acnames.h
+++ b/usr/src/uts/intel/sys/acpi/acnames.h
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: acnames.h - Global names and strings
- * $Revision: 1 $
+ * $Revision: 1.5 $
*
*****************************************************************************/
@@ -144,14 +144,15 @@
/* Definitions of the predefined namespace names */
-#define ACPI_UNKNOWN_NAME (UINT32) 0x3F3F3F3F /* Unknown name is "????" */
-#define ACPI_ROOT_NAME (UINT32) 0x5F5F5F5C /* Root name is "\___" */
-#define ACPI_SYS_BUS_NAME (UINT32) 0x5F53425F /* Sys bus name is "_SB_" */
+#define ACPI_UNKNOWN_NAME (UINT32) 0x3F3F3F3F /* Unknown name is "????" */
+#define ACPI_ROOT_NAME (UINT32) 0x5F5F5F5C /* Root name is "\___" */
+
+#define ACPI_PREFIX_MIXED (UINT32) 0x69706341 /* "Acpi" */
+#define ACPI_PREFIX_LOWER (UINT32) 0x69706361 /* "acpi" */
#define ACPI_NS_ROOT_PATH "\\"
#define ACPI_NS_SYSTEM_BUS "_SB_"
-
#endif /* __ACNAMES_H__ */
diff --git a/usr/src/uts/intel/sys/acpi/acnamesp.h b/usr/src/uts/intel/sys/acpi/acnamesp.h
index e05e4d8b2d..abf3e12c8f 100644
--- a/usr/src/uts/intel/sys/acpi/acnamesp.h
+++ b/usr/src/uts/intel/sys/acpi/acnamesp.h
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: acnamesp.h - Namespace subcomponent prototypes and defines
- * $Revision: 141 $
+ * $Revision: 1.142 $
*
*****************************************************************************/
@@ -197,7 +197,7 @@ AcpiNsParseTable (
ACPI_STATUS
AcpiNsOneCompleteParse (
- UINT32 PassNumber,
+ UINT8 PassNumber,
ACPI_TABLE_DESC *TableDesc);
diff --git a/usr/src/uts/intel/sys/acpi/acobject.h b/usr/src/uts/intel/sys/acpi/acobject.h
index a2cae21c9c..b56d4c1517 100644
--- a/usr/src/uts/intel/sys/acpi/acobject.h
+++ b/usr/src/uts/intel/sys/acpi/acobject.h
@@ -2,7 +2,7 @@
/******************************************************************************
*
* Name: acobject.h - Definition of ACPI_OPERAND_OBJECT (Internal object only)
- * $Revision: 130 $
+ * $Revision: 1.130 $
*
*****************************************************************************/
diff --git a/usr/src/uts/intel/sys/acpi/acopcode.h b/usr/src/uts/intel/sys/acpi/acopcode.h
index 8cba6107ee..f7c329b02f 100644
--- a/usr/src/uts/intel/sys/acpi/acopcode.h
+++ b/usr/src/uts/intel/sys/acpi/acopcode.h
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: acopcode.h - AML opcode information for the AML parser and interpreter
- * $Revision: 3 $
+ * $Revision: 1.3 $
*
*****************************************************************************/
diff --git a/usr/src/uts/intel/sys/acpi/acoutput.h b/usr/src/uts/intel/sys/acpi/acoutput.h
index 18902fff8a..8988f32d93 100644
--- a/usr/src/uts/intel/sys/acpi/acoutput.h
+++ b/usr/src/uts/intel/sys/acpi/acoutput.h
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: acoutput.h -- debug output
- * $Revision: 97 $
+ * $Revision: 1.97 $
*
*****************************************************************************/
diff --git a/usr/src/uts/intel/sys/acpi/acparser.h b/usr/src/uts/intel/sys/acpi/acparser.h
index c298684d86..05bc56655c 100644
--- a/usr/src/uts/intel/sys/acpi/acparser.h
+++ b/usr/src/uts/intel/sys/acpi/acparser.h
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: acparser.h - AML Parser subcomponent prototypes and defines
- * $Revision: 76 $
+ * $Revision: 1.77 $
*
*****************************************************************************/
@@ -150,12 +150,7 @@
* psxface - Parser external interfaces
*/
ACPI_STATUS
-AcpiPsxLoadTable (
- UINT8 *PcodeAddr,
- UINT32 PcodeLength);
-
-ACPI_STATUS
-AcpiPsxExecute (
+AcpiPsExecuteMethod (
ACPI_PARAMETER_INFO *Info);
diff --git a/usr/src/uts/intel/sys/acpi/acpi.h b/usr/src/uts/intel/sys/acpi/acpi.h
index 3787abadbe..a71e70e4e1 100644
--- a/usr/src/uts/intel/sys/acpi/acpi.h
+++ b/usr/src/uts/intel/sys/acpi/acpi.h
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: acpi.h - Master include file, Publics and external data.
- * $Revision: 59 $
+ * $Revision: 1.59 $
*
*****************************************************************************/
diff --git a/usr/src/uts/intel/sys/acpi/acpixf.h b/usr/src/uts/intel/sys/acpi/acpixf.h
index 5a2ac03286..a4739e1443 100644
--- a/usr/src/uts/intel/sys/acpi/acpixf.h
+++ b/usr/src/uts/intel/sys/acpi/acpixf.h
@@ -274,6 +274,13 @@ AcpiGetData (
ACPI_OBJECT_HANDLER Handler,
void **Data);
+ACPI_STATUS
+AcpiDebugTrace (
+ char *Name,
+ UINT32 DebugLevel,
+ UINT32 DebugLayer,
+ UINT32 Flags);
+
/*
* Object manipulation and enumeration
diff --git a/usr/src/uts/intel/sys/acpi/acresrc.h b/usr/src/uts/intel/sys/acpi/acresrc.h
index f66131f17d..d313cc2acc 100644
--- a/usr/src/uts/intel/sys/acpi/acresrc.h
+++ b/usr/src/uts/intel/sys/acpi/acresrc.h
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: acresrc.h - Resource Manager function prototypes
- * $Revision: 42 $
+ * $Revision: 1.48 $
*
*****************************************************************************/
@@ -118,6 +118,55 @@
#ifndef __ACRESRC_H__
#define __ACRESRC_H__
+/* Need the AML resource descriptor structs */
+
+#include "amlresrc.h"
+
+
+/*
+ * Resource dispatch and info tables
+ */
+typedef struct acpi_resource_info
+{
+ UINT8 LengthType;
+ UINT8 MinimumAmlResourceLength;
+ UINT8 MinimumInternalStructLength;
+
+} ACPI_RESOURCE_INFO;
+
+/* Types for LengthType above */
+
+#define ACPI_FIXED_LENGTH 0
+#define ACPI_VARIABLE_LENGTH 1
+#define ACPI_SMALL_VARIABLE_LENGTH 2
+
+/* Handlers */
+
+typedef ACPI_STATUS (*ACPI_SET_RESOURCE_HANDLER) (
+ ACPI_RESOURCE *Resource,
+ AML_RESOURCE *Aml);
+
+typedef ACPI_STATUS (*ACPI_GET_RESOURCE_HANDLER) (
+ AML_RESOURCE *Aml,
+ UINT16 AmlResourceLength,
+ ACPI_RESOURCE *Resource);
+
+typedef void (*ACPI_DUMP_RESOURCE_HANDLER) (
+ ACPI_RESOURCE_DATA *Data);
+
+/* Tables indexed by internal resource type */
+
+extern UINT8 AcpiGbl_AmlResourceSizes[];
+extern ACPI_SET_RESOURCE_HANDLER AcpiGbl_SetResourceDispatch[];
+extern ACPI_DUMP_RESOURCE_HANDLER AcpiGbl_DumpResourceDispatch[];
+
+/* Tables indexed by raw AML resource descriptor type */
+
+extern ACPI_RESOURCE_INFO AcpiGbl_SmResourceInfo[];
+extern ACPI_RESOURCE_INFO AcpiGbl_LgResourceInfo[];
+extern ACPI_GET_RESOURCE_HANDLER AcpiGbl_SmGetResourceDispatch[];
+extern ACPI_GET_RESOURCE_HANDLER AcpiGbl_LgGetResourceDispatch[];
+
/*
* Function prototypes called from Acpi* APIs
@@ -127,7 +176,6 @@ AcpiRsGetPrtMethodData (
ACPI_HANDLE Handle,
ACPI_BUFFER *RetBuffer);
-
ACPI_STATUS
AcpiRsGetCrsMethodData (
ACPI_HANDLE Handle,
@@ -151,11 +199,11 @@ AcpiRsSetSrsMethodData (
ACPI_STATUS
AcpiRsCreateResourceList (
- ACPI_OPERAND_OBJECT *ByteStreamBuffer,
+ ACPI_OPERAND_OBJECT *AmlBuffer,
ACPI_BUFFER *OutputBuffer);
ACPI_STATUS
-AcpiRsCreateByteStream (
+AcpiRsCreateAmlResources (
ACPI_RESOURCE *LinkedListBuffer,
ACPI_BUFFER *OutputBuffer);
@@ -181,19 +229,13 @@ AcpiRsDumpIrqList (
* rscalc
*/
ACPI_STATUS
-AcpiRsGetByteStreamStart (
- UINT8 *ByteStreamBuffer,
- UINT8 **ByteStreamStart,
- UINT32 *Size);
-
-ACPI_STATUS
AcpiRsGetListLength (
- UINT8 *ByteStreamBuffer,
- UINT32 ByteStreamBufferLength,
+ UINT8 *AmlBuffer,
+ UINT32 AmlBufferLength,
ACPI_SIZE *SizeNeeded);
ACPI_STATUS
-AcpiRsGetByteStreamLength (
+AcpiRsGetAmlLength (
ACPI_RESOURCE *LinkedListBuffer,
ACPI_SIZE *SizeNeeded);
@@ -203,214 +245,351 @@ AcpiRsGetPciRoutingTableLength (
ACPI_SIZE *BufferSizeNeeded);
ACPI_STATUS
-AcpiRsByteStreamToList (
- UINT8 *ByteStreamBuffer,
- UINT32 ByteStreamBufferLength,
+AcpiRsConvertAmlToResources (
+ UINT8 *AmlBuffer,
+ UINT32 AmlBufferLength,
UINT8 *OutputBuffer);
ACPI_STATUS
-AcpiRsListToByteStream (
- ACPI_RESOURCE *LinkedList,
- ACPI_SIZE ByteStreamSizeNeeded,
+AcpiRsConvertResourcesToAml (
+ ACPI_RESOURCE *Resource,
+ ACPI_SIZE AmlSizeNeeded,
UINT8 *OutputBuffer);
+
+/*
+ * rsio
+ */
+ACPI_STATUS
+AcpiRsGetIo (
+ AML_RESOURCE *Aml,
+ UINT16 AmlResourceLength,
+ ACPI_RESOURCE *Resource);
+
ACPI_STATUS
-AcpiRsIoResource (
- UINT8 *ByteStreamBuffer,
- ACPI_SIZE *BytesConsumed,
- UINT8 **OutputBuffer,
- ACPI_SIZE *StructureSize);
+AcpiRsSetIo (
+ ACPI_RESOURCE *Resource,
+ AML_RESOURCE *Aml);
ACPI_STATUS
-AcpiRsFixedIoResource (
- UINT8 *ByteStreamBuffer,
- ACPI_SIZE *BytesConsumed,
- UINT8 **OutputBuffer,
- ACPI_SIZE *StructureSize);
+AcpiRsGetFixedIo (
+ AML_RESOURCE *Aml,
+ UINT16 AmlResourceLength,
+ ACPI_RESOURCE *Resource);
ACPI_STATUS
-AcpiRsIoStream (
- ACPI_RESOURCE *LinkedList,
- UINT8 **OutputBuffer,
- ACPI_SIZE *BytesConsumed);
+AcpiRsSetFixedIo (
+ ACPI_RESOURCE *Resource,
+ AML_RESOURCE *Aml);
ACPI_STATUS
-AcpiRsFixedIoStream (
- ACPI_RESOURCE *LinkedList,
- UINT8 **OutputBuffer,
- ACPI_SIZE *BytesConsumed);
+AcpiRsGetDma (
+ AML_RESOURCE *Aml,
+ UINT16 AmlResourceLength,
+ ACPI_RESOURCE *Resource);
ACPI_STATUS
-AcpiRsIrqResource (
- UINT8 *ByteStreamBuffer,
- ACPI_SIZE *BytesConsumed,
- UINT8 **OutputBuffer,
- ACPI_SIZE *StructureSize);
+AcpiRsSetDma (
+ ACPI_RESOURCE *Resource,
+ AML_RESOURCE *Aml);
+
+/*
+ * rsirq
+ */
ACPI_STATUS
-AcpiRsIrqStream (
- ACPI_RESOURCE *LinkedList,
- UINT8 **OutputBuffer,
- ACPI_SIZE *BytesConsumed);
+AcpiRsGetIrq (
+ AML_RESOURCE *Aml,
+ UINT16 AmlResourceLength,
+ ACPI_RESOURCE *Resource);
ACPI_STATUS
-AcpiRsDmaResource (
- UINT8 *ByteStreamBuffer,
- ACPI_SIZE *BytesConsumed,
- UINT8 **OutputBuffer,
- ACPI_SIZE *StructureSize);
+AcpiRsSetIrq (
+ ACPI_RESOURCE *Resource,
+ AML_RESOURCE *Aml);
ACPI_STATUS
-AcpiRsDmaStream (
- ACPI_RESOURCE *LinkedList,
- UINT8 **OutputBuffer,
- ACPI_SIZE *BytesConsumed);
+AcpiRsGetExtIrq (
+ AML_RESOURCE *Aml,
+ UINT16 AmlResourceLength,
+ ACPI_RESOURCE *Resource);
ACPI_STATUS
-AcpiRsAddress16Resource (
- UINT8 *ByteStreamBuffer,
- ACPI_SIZE *BytesConsumed,
- UINT8 **OutputBuffer,
- ACPI_SIZE *StructureSize);
+AcpiRsSetExtIrq (
+ ACPI_RESOURCE *Resource,
+ AML_RESOURCE *Aml);
+
+/*
+ * rsaddr
+ */
ACPI_STATUS
-AcpiRsAddress16Stream (
- ACPI_RESOURCE *LinkedList,
- UINT8 **OutputBuffer,
- ACPI_SIZE *BytesConsumed);
+AcpiRsGetAddress16 (
+ AML_RESOURCE *Aml,
+ UINT16 AmlResourceLength,
+ ACPI_RESOURCE *Resource);
ACPI_STATUS
-AcpiRsAddress32Resource (
- UINT8 *ByteStreamBuffer,
- ACPI_SIZE *BytesConsumed,
- UINT8 **OutputBuffer,
- ACPI_SIZE *StructureSize);
+AcpiRsSetAddress16 (
+ ACPI_RESOURCE *Resource,
+ AML_RESOURCE *Aml);
ACPI_STATUS
-AcpiRsAddress32Stream (
- ACPI_RESOURCE *LinkedList,
- UINT8 **OutputBuffer,
- ACPI_SIZE *BytesConsumed);
+AcpiRsGetAddress32 (
+ AML_RESOURCE *Aml,
+ UINT16 AmlResourceLength,
+ ACPI_RESOURCE *Resource);
ACPI_STATUS
-AcpiRsAddress64Resource (
- UINT8 *ByteStreamBuffer,
- ACPI_SIZE *BytesConsumed,
- UINT8 **OutputBuffer,
- ACPI_SIZE *StructureSize);
+AcpiRsSetAddress32 (
+ ACPI_RESOURCE *Resource,
+ AML_RESOURCE *Aml);
ACPI_STATUS
-AcpiRsAddress64Stream (
- ACPI_RESOURCE *LinkedList,
- UINT8 **OutputBuffer,
- ACPI_SIZE *BytesConsumed);
+AcpiRsGetAddress64 (
+ AML_RESOURCE *Aml,
+ UINT16 AmlResourceLength,
+ ACPI_RESOURCE *Resource);
ACPI_STATUS
-AcpiRsStartDependFnsResource (
- UINT8 *ByteStreamBuffer,
- ACPI_SIZE *BytesConsumed,
- UINT8 **OutputBuffer,
- ACPI_SIZE *StructureSize);
+AcpiRsSetAddress64 (
+ ACPI_RESOURCE *Resource,
+ AML_RESOURCE *Aml);
ACPI_STATUS
-AcpiRsEndDependFnsResource (
- UINT8 *ByteStreamBuffer,
- ACPI_SIZE *BytesConsumed,
- UINT8 **OutputBuffer,
- ACPI_SIZE *StructureSize);
+AcpiRsGetExtAddress64 (
+ AML_RESOURCE *Aml,
+ UINT16 AmlResourceLength,
+ ACPI_RESOURCE *Resource);
ACPI_STATUS
-AcpiRsStartDependFnsStream (
- ACPI_RESOURCE *LinkedList,
- UINT8 **OutputBuffer,
- ACPI_SIZE *BytesConsumed);
+AcpiRsSetExtAddress64 (
+ ACPI_RESOURCE *Resource,
+ AML_RESOURCE *Aml);
+
+/*
+ * rsmemory
+ */
ACPI_STATUS
-AcpiRsEndDependFnsStream (
- ACPI_RESOURCE *LinkedList,
- UINT8 **OutputBuffer,
- ACPI_SIZE *BytesConsumed);
+AcpiRsGetMemory24 (
+ AML_RESOURCE *Aml,
+ UINT16 AmlResourceLength,
+ ACPI_RESOURCE *Resource);
ACPI_STATUS
-AcpiRsMemory24Resource (
- UINT8 *ByteStreamBuffer,
- ACPI_SIZE *BytesConsumed,
- UINT8 **OutputBuffer,
- ACPI_SIZE *StructureSize);
+AcpiRsSetMemory24 (
+ ACPI_RESOURCE *Resource,
+ AML_RESOURCE *Aml);
+
+ACPI_STATUS
+AcpiRsGetMemory32 (
+ AML_RESOURCE *Aml,
+ UINT16 AmlResourceLength,
+ ACPI_RESOURCE *Resource);
ACPI_STATUS
-AcpiRsMemory24Stream (
- ACPI_RESOURCE *LinkedList,
- UINT8 **OutputBuffer,
- ACPI_SIZE *BytesConsumed);
+AcpiRsSetMemory32 (
+ ACPI_RESOURCE *Resource,
+ AML_RESOURCE *Aml);
+
+ACPI_STATUS
+AcpiRsGetFixedMemory32 (
+ AML_RESOURCE *Aml,
+ UINT16 AmlResourceLength,
+ ACPI_RESOURCE *Resource);
+
+ACPI_STATUS
+AcpiRsSetFixedMemory32 (
+ ACPI_RESOURCE *Resource,
+ AML_RESOURCE *Aml);
+
+/*
+ * rsmisc
+ */
ACPI_STATUS
-AcpiRsMemory32RangeResource (
- UINT8 *ByteStreamBuffer,
- ACPI_SIZE *BytesConsumed,
- UINT8 **OutputBuffer,
- ACPI_SIZE *StructureSize);
+AcpiRsGetGenericReg (
+ AML_RESOURCE *Aml,
+ UINT16 AmlResourceLength,
+ ACPI_RESOURCE *Resource);
ACPI_STATUS
-AcpiRsFixedMemory32Resource (
- UINT8 *ByteStreamBuffer,
- ACPI_SIZE *BytesConsumed,
- UINT8 **OutputBuffer,
- ACPI_SIZE *StructureSize);
+AcpiRsSetGenericReg (
+ ACPI_RESOURCE *Resource,
+ AML_RESOURCE *Aml);
ACPI_STATUS
-AcpiRsMemory32RangeStream (
- ACPI_RESOURCE *LinkedList,
- UINT8 **OutputBuffer,
- ACPI_SIZE *BytesConsumed);
+AcpiRsGetVendor (
+ AML_RESOURCE *Aml,
+ UINT16 AmlResourceLength,
+ ACPI_RESOURCE *Resource);
ACPI_STATUS
-AcpiRsFixedMemory32Stream (
- ACPI_RESOURCE *LinkedList,
- UINT8 **OutputBuffer,
- ACPI_SIZE *BytesConsumed);
+AcpiRsSetVendor (
+ ACPI_RESOURCE *Resource,
+ AML_RESOURCE *Aml);
ACPI_STATUS
-AcpiRsExtendedIrqResource (
- UINT8 *ByteStreamBuffer,
- ACPI_SIZE *BytesConsumed,
- UINT8 **OutputBuffer,
- ACPI_SIZE *StructureSize);
+AcpiRsGetStartDpf (
+ AML_RESOURCE *Aml,
+ UINT16 AmlResourceLength,
+ ACPI_RESOURCE *Resource);
ACPI_STATUS
-AcpiRsExtendedIrqStream (
- ACPI_RESOURCE *LinkedList,
- UINT8 **OutputBuffer,
- ACPI_SIZE *BytesConsumed);
+AcpiRsSetStartDpf (
+ ACPI_RESOURCE *Resource,
+ AML_RESOURCE *Aml);
ACPI_STATUS
-AcpiRsEndTagResource (
- UINT8 *ByteStreamBuffer,
- ACPI_SIZE *BytesConsumed,
- UINT8 **OutputBuffer,
- ACPI_SIZE *StructureSize);
+AcpiRsGetEndDpf (
+ AML_RESOURCE *Aml,
+ UINT16 AmlResourceLength,
+ ACPI_RESOURCE *Resource);
ACPI_STATUS
-AcpiRsEndTagStream (
- ACPI_RESOURCE *LinkedList,
- UINT8 **OutputBuffer,
- ACPI_SIZE *BytesConsumed);
+AcpiRsSetEndDpf (
+ ACPI_RESOURCE *Resource,
+ AML_RESOURCE *Aml);
ACPI_STATUS
-AcpiRsVendorResource (
- UINT8 *ByteStreamBuffer,
- ACPI_SIZE *BytesConsumed,
- UINT8 **OutputBuffer,
- ACPI_SIZE *StructureSize);
+AcpiRsGetEndTag (
+ AML_RESOURCE *Aml,
+ UINT16 AmlResourceLength,
+ ACPI_RESOURCE *Resource);
ACPI_STATUS
-AcpiRsVendorStream (
- ACPI_RESOURCE *LinkedList,
- UINT8 **OutputBuffer,
- ACPI_SIZE *BytesConsumed);
+AcpiRsSetEndTag (
+ ACPI_RESOURCE *Resource,
+ AML_RESOURCE *Aml);
+
+/*
+ * rsutils
+ */
+void
+AcpiRsMoveData (
+ void *Destination,
+ void *Source,
+ UINT16 ItemCount,
+ UINT8 MoveType);
+
+/* Types used in MoveType above */
+
+#define ACPI_MOVE_TYPE_16_TO_32 0
+#define ACPI_MOVE_TYPE_32_TO_16 1
+#define ACPI_MOVE_TYPE_32_TO_32 2
+#define ACPI_MOVE_TYPE_64_TO_64 3
+
+
+UINT16
+AcpiRsGetResourceSource (
+ UINT16 ResourceLength,
+ ACPI_SIZE MinimumLength,
+ ACPI_RESOURCE_SOURCE *ResourceSource,
+ AML_RESOURCE *Aml,
+ char *StringPtr);
+
+ACPI_SIZE
+AcpiRsSetResourceSource (
+ AML_RESOURCE *Aml,
+ ACPI_SIZE MinimumLength,
+ ACPI_RESOURCE_SOURCE *ResourceSource);
UINT8
AcpiRsGetResourceType (
UINT8 ResourceStartByte);
+UINT32
+AcpiRsGetDescriptorLength (
+ AML_RESOURCE *Aml);
+
+UINT16
+AcpiRsGetResourceLength (
+ AML_RESOURCE *Aml);
+
+void
+AcpiRsSetResourceHeader (
+ UINT8 DescriptorType,
+ ACPI_SIZE TotalLength,
+ AML_RESOURCE *Aml);
+
+ACPI_RESOURCE_INFO *
+AcpiRsGetResourceInfo (
+ UINT8 ResourceType);
+
+
+#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
+/*
+ * rsdump
+ */
+void
+AcpiRsDumpIrq (
+ ACPI_RESOURCE_DATA *Resource);
+
+void
+AcpiRsDumpAddress16 (
+ ACPI_RESOURCE_DATA *Resource);
+
+void
+AcpiRsDumpAddress32 (
+ ACPI_RESOURCE_DATA *Resource);
+
+void
+AcpiRsDumpAddress64 (
+ ACPI_RESOURCE_DATA *Resource);
+
+void
+AcpiRsDumpExtAddress64 (
+ ACPI_RESOURCE_DATA *Resource);
+
+void
+AcpiRsDumpDma (
+ ACPI_RESOURCE_DATA *Resource);
+
+void
+AcpiRsDumpIo (
+ ACPI_RESOURCE_DATA *Resource);
+
+void
+AcpiRsDumpExtIrq (
+ ACPI_RESOURCE_DATA *Resource);
+
+void
+AcpiRsDumpFixedIo (
+ ACPI_RESOURCE_DATA *Resource);
+
+void
+AcpiRsDumpFixedMemory32 (
+ ACPI_RESOURCE_DATA *Resource);
+
+void
+AcpiRsDumpMemory24 (
+ ACPI_RESOURCE_DATA *Resource);
+
+void
+AcpiRsDumpMemory32 (
+ ACPI_RESOURCE_DATA *Resource);
+
+void
+AcpiRsDumpStartDpf (
+ ACPI_RESOURCE_DATA *Resource);
+
+void
+AcpiRsDumpVendor (
+ ACPI_RESOURCE_DATA *Resource);
+
+void
+AcpiRsDumpGenericReg (
+ ACPI_RESOURCE_DATA *Resource);
+
+void
+AcpiRsDumpEndDpf (
+ ACPI_RESOURCE_DATA *Resource);
+
+void
+AcpiRsDumpEndTag (
+ ACPI_RESOURCE_DATA *Resource);
+
+#endif
+
#endif /* __ACRESRC_H__ */
diff --git a/usr/src/uts/intel/sys/acpi/acstruct.h b/usr/src/uts/intel/sys/acpi/acstruct.h
index 1d41064d2b..b45e9f4bac 100644
--- a/usr/src/uts/intel/sys/acpi/acstruct.h
+++ b/usr/src/uts/intel/sys/acpi/acstruct.h
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: acstruct.h - Internal structs
- * $Revision: 35 $
+ * $Revision: 1.37 $
*
*****************************************************************************/
@@ -229,6 +229,7 @@ typedef struct acpi_device_walk_info
typedef struct acpi_walk_info
{
UINT32 DebugLevel;
+ UINT32 Count;
ACPI_OWNER_ID OwnerId;
UINT8 DisplayType;
@@ -288,8 +289,10 @@ typedef union acpi_aml_operands
typedef struct acpi_parameter_info
{
ACPI_NAMESPACE_NODE *Node;
+ ACPI_OPERAND_OBJECT *ObjDesc;
ACPI_OPERAND_OBJECT **Parameters;
ACPI_OPERAND_OBJECT *ReturnObject;
+ UINT8 PassNumber;
UINT8 ParameterType;
UINT8 ReturnObjectType;
diff --git a/usr/src/uts/intel/sys/acpi/actables.h b/usr/src/uts/intel/sys/acpi/actables.h
index 921a17ec6c..f3163d9ba2 100644
--- a/usr/src/uts/intel/sys/acpi/actables.h
+++ b/usr/src/uts/intel/sys/acpi/actables.h
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: actables.h - ACPI table management
- * $Revision: 51 $
+ * $Revision: 1.53 $
*
*****************************************************************************/
@@ -251,11 +251,15 @@ AcpiTbValidateRsdp (
* tbutils - common table utilities
*/
ACPI_STATUS
+AcpiTbIsTableInstalled (
+ ACPI_TABLE_DESC *NewTableDesc);
+
+ACPI_STATUS
AcpiTbVerifyTableChecksum (
ACPI_TABLE_HEADER *TableHeader);
UINT8
-AcpiTbChecksum (
+AcpiTbGenerateChecksum (
void *Buffer,
UINT32 Length);
diff --git a/usr/src/uts/intel/sys/acpi/actbl.h b/usr/src/uts/intel/sys/acpi/actbl.h
index 18d7cd2aea..6d473b20e3 100644
--- a/usr/src/uts/intel/sys/acpi/actbl.h
+++ b/usr/src/uts/intel/sys/acpi/actbl.h
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: actbl.h - Table data structures defined in ACPI specification
- * $Revision: 72 $
+ * $Revision: 1.72 $
*
*****************************************************************************/
diff --git a/usr/src/uts/intel/sys/acpi/actbl1.h b/usr/src/uts/intel/sys/acpi/actbl1.h
index c18dfe4d31..51ea92aaa1 100644
--- a/usr/src/uts/intel/sys/acpi/actbl1.h
+++ b/usr/src/uts/intel/sys/acpi/actbl1.h
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: actbl1.h - ACPI 1.0 tables
- * $Revision: 32 $
+ * $Revision: 1.32 $
*
*****************************************************************************/
diff --git a/usr/src/uts/intel/sys/acpi/actbl2.h b/usr/src/uts/intel/sys/acpi/actbl2.h
index 7bcc8b7162..4b65d269cb 100644
--- a/usr/src/uts/intel/sys/acpi/actbl2.h
+++ b/usr/src/uts/intel/sys/acpi/actbl2.h
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: actbl2.h - ACPI Specification Revision 2.0 Tables
- * $Revision: 44 $
+ * $Revision: 1.45 $
*
*****************************************************************************/
@@ -174,7 +174,7 @@ typedef struct facs_descriptor_rev2
UINT32 GlobalLock; /* Global Lock used to synchronize access to shared hardware resources */
/* Flags (32 bits) */
-
+
UINT8_BIT S4Bios_f : 1; /* 00: S4BIOS support is present */
UINT8_BIT : 7; /* 01-07: Reserved, must be zero */
UINT8 Reserved1[3]; /* 08-31: Reserved, must be zero */
diff --git a/usr/src/uts/intel/sys/acpi/actypes.h b/usr/src/uts/intel/sys/acpi/actypes.h
index 97f2c39918..c723f8f1a3 100644
--- a/usr/src/uts/intel/sys/acpi/actypes.h
+++ b/usr/src/uts/intel/sys/acpi/actypes.h
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: actypes.h - Common data types for the entire ACPI subsystem
- * $Revision: 282 $
+ * $Revision: 1.286 $
*
*****************************************************************************/
@@ -1151,57 +1151,61 @@ typedef struct acpi_mem_space_context
*/
typedef struct acpi_resource_irq
{
- UINT32 EdgeLevel;
- UINT32 ActiveHighLow;
- UINT32 SharedExclusive;
- UINT32 NumberOfInterrupts;
+ UINT32 Triggering;
+ UINT32 Polarity;
+ UINT32 Sharable;
+ UINT32 InterruptCount;
UINT32 Interrupts[1];
} ACPI_RESOURCE_IRQ;
+
typedef struct ACPI_RESOURCE_DMA
{
UINT32 Type;
UINT32 BusMaster;
UINT32 Transfer;
- UINT32 NumberOfChannels;
+ UINT32 ChannelCount;
UINT32 Channels[1];
} ACPI_RESOURCE_DMA;
-typedef struct acpi_resource_start_dpf
+
+typedef struct acpi_resource_start_dependent
{
UINT32 CompatibilityPriority;
UINT32 PerformanceRobustness;
-} ACPI_RESOURCE_START_DPF;
+} ACPI_RESOURCE_START_DEPENDENT;
+
/*
* END_DEPENDENT_FUNCTIONS_RESOURCE struct is not
* needed because it has no fields
*/
+
typedef struct acpi_resource_io
{
UINT32 IoDecode;
- UINT32 MinBaseAddress;
- UINT32 MaxBaseAddress;
+ UINT32 Minimum;
+ UINT32 Maximum;
UINT32 Alignment;
- UINT32 RangeLength;
+ UINT32 AddressLength;
} ACPI_RESOURCE_IO;
typedef struct acpi_resource_fixed_io
{
- UINT32 BaseAddress;
- UINT32 RangeLength;
+ UINT32 Address;
+ UINT32 AddressLength;
} ACPI_RESOURCE_FIXED_IO;
typedef struct acpi_resource_vendor
{
- UINT32 Length;
- UINT8 Reserved[1];
+ UINT32 ByteLength;
+ UINT8 ByteData[1];
} ACPI_RESOURCE_VENDOR;
@@ -1211,33 +1215,33 @@ typedef struct acpi_resource_end_tag
} ACPI_RESOURCE_END_TAG;
-typedef struct acpi_resource_mem24
+typedef struct acpi_resource_memory24
{
UINT32 ReadWriteAttribute;
- UINT32 MinBaseAddress;
- UINT32 MaxBaseAddress;
+ UINT32 Minimum;
+ UINT32 Maximum;
UINT32 Alignment;
- UINT32 RangeLength;
+ UINT32 AddressLength;
-} ACPI_RESOURCE_MEM24;
+} ACPI_RESOURCE_MEMORY24;
-typedef struct acpi_resource_mem32
+typedef struct acpi_resource_memory32
{
UINT32 ReadWriteAttribute;
- UINT32 MinBaseAddress;
- UINT32 MaxBaseAddress;
+ UINT32 Minimum;
+ UINT32 Maximum;
UINT32 Alignment;
- UINT32 RangeLength;
+ UINT32 AddressLength;
-} ACPI_RESOURCE_MEM32;
+} ACPI_RESOURCE_MEMORY32;
-typedef struct acpi_resource_fixed_mem32
+typedef struct acpi_resource_fixed_memory32
{
UINT32 ReadWriteAttribute;
- UINT32 RangeBaseAddress;
- UINT32 RangeLength;
+ UINT32 Address;
+ UINT32 AddressLength;
-} ACPI_RESOURCE_FIXED_MEM32;
+} ACPI_RESOURCE_FIXED_MEMORY32;
typedef struct acpi_memory_attribute
{
@@ -1276,18 +1280,29 @@ typedef struct acpi_resource_source
} ACPI_RESOURCE_SOURCE;
+/* Fields common to all address descriptors, 16/32/64 bit */
+
+#define ACPI_RESOURCE_ADDRESS_COMMON \
+ UINT32 ResourceType; \
+ UINT32 ProducerConsumer; \
+ UINT32 Decode; \
+ UINT32 MinAddressFixed; \
+ UINT32 MaxAddressFixed; \
+ ACPI_RESOURCE_ATTRIBUTE Attribute;
+
+typedef struct acpi_resource_address
+{
+ ACPI_RESOURCE_ADDRESS_COMMON
+
+} ACPI_RESOURCE_ADDRESS;
+
typedef struct acpi_resource_address16
{
- UINT32 ResourceType;
- UINT32 ProducerConsumer;
- UINT32 Decode;
- UINT32 MinAddressFixed;
- UINT32 MaxAddressFixed;
- ACPI_RESOURCE_ATTRIBUTE Attribute;
+ ACPI_RESOURCE_ADDRESS_COMMON
UINT32 Granularity;
- UINT32 MinAddressRange;
- UINT32 MaxAddressRange;
- UINT32 AddressTranslationOffset;
+ UINT32 Minimum;
+ UINT32 Maximum;
+ UINT32 TranslationOffset;
UINT32 AddressLength;
ACPI_RESOURCE_SOURCE ResourceSource;
@@ -1295,16 +1310,11 @@ typedef struct acpi_resource_address16
typedef struct acpi_resource_address32
{
- UINT32 ResourceType;
- UINT32 ProducerConsumer;
- UINT32 Decode;
- UINT32 MinAddressFixed;
- UINT32 MaxAddressFixed;
- ACPI_RESOURCE_ATTRIBUTE Attribute;
+ ACPI_RESOURCE_ADDRESS_COMMON
UINT32 Granularity;
- UINT32 MinAddressRange;
- UINT32 MaxAddressRange;
- UINT32 AddressTranslationOffset;
+ UINT32 Minimum;
+ UINT32 Maximum;
+ UINT32 TranslationOffset;
UINT32 AddressLength;
ACPI_RESOURCE_SOURCE ResourceSource;
@@ -1312,86 +1322,113 @@ typedef struct acpi_resource_address32
typedef struct acpi_resource_address64
{
- UINT32 ResourceType;
- UINT32 ProducerConsumer;
- UINT32 Decode;
- UINT32 MinAddressFixed;
- UINT32 MaxAddressFixed;
- ACPI_RESOURCE_ATTRIBUTE Attribute;
+ ACPI_RESOURCE_ADDRESS_COMMON
UINT64 Granularity;
- UINT64 MinAddressRange;
- UINT64 MaxAddressRange;
- UINT64 AddressTranslationOffset;
+ UINT64 Minimum;
+ UINT64 Maximum;
+ UINT64 TranslationOffset;
UINT64 AddressLength;
- UINT64 TypeSpecificAttributes;
ACPI_RESOURCE_SOURCE ResourceSource;
} ACPI_RESOURCE_ADDRESS64;
-typedef struct acpi_resource_ext_irq
+typedef struct acpi_resource_extended_address64
+{
+ ACPI_RESOURCE_ADDRESS_COMMON
+ UINT64 Granularity;
+ UINT64 Minimum;
+ UINT64 Maximum;
+ UINT64 TranslationOffset;
+ UINT64 AddressLength;
+ UINT64 TypeSpecificAttributes;
+ UINT8 RevisionID;
+
+} ACPI_RESOURCE_EXTENDED_ADDRESS64;
+
+typedef struct acpi_resource_extended_irq
{
UINT32 ProducerConsumer;
- UINT32 EdgeLevel;
- UINT32 ActiveHighLow;
- UINT32 SharedExclusive;
- UINT32 NumberOfInterrupts;
+ UINT32 Triggering;
+ UINT32 Polarity;
+ UINT32 Sharable;
+ UINT32 InterruptCount;
ACPI_RESOURCE_SOURCE ResourceSource;
UINT32 Interrupts[1];
-} ACPI_RESOURCE_EXT_IRQ;
+} ACPI_RESOURCE_EXTENDED_IRQ;
+
+typedef struct acpi_resource_generic_register
+{
+ UINT32 SpaceId;
+ UINT32 BitWidth;
+ UINT32 BitOffset;
+ UINT32 AccessSize;
+ UINT64 Address;
+
+} ACPI_RESOURCE_GENERIC_REGISTER;
/* ACPI_RESOURCE_TYPEs */
-#define ACPI_RSTYPE_IRQ 0
-#define ACPI_RSTYPE_DMA 1
-#define ACPI_RSTYPE_START_DPF 2
-#define ACPI_RSTYPE_END_DPF 3
-#define ACPI_RSTYPE_IO 4
-#define ACPI_RSTYPE_FIXED_IO 5
-#define ACPI_RSTYPE_VENDOR 6
-#define ACPI_RSTYPE_END_TAG 7
-#define ACPI_RSTYPE_MEM24 8
-#define ACPI_RSTYPE_MEM32 9
-#define ACPI_RSTYPE_FIXED_MEM32 10
-#define ACPI_RSTYPE_ADDRESS16 11
-#define ACPI_RSTYPE_ADDRESS32 12
-#define ACPI_RSTYPE_ADDRESS64 13
-#define ACPI_RSTYPE_EXT_IRQ 14
-
-typedef UINT32 ACPI_RESOURCE_TYPE;
+#define ACPI_RESOURCE_TYPE_IRQ 0
+#define ACPI_RESOURCE_TYPE_DMA 1
+#define ACPI_RESOURCE_TYPE_START_DEPENDENT 2
+#define ACPI_RESOURCE_TYPE_END_DEPENDENT 3
+#define ACPI_RESOURCE_TYPE_IO 4
+#define ACPI_RESOURCE_TYPE_FIXED_IO 5
+#define ACPI_RESOURCE_TYPE_VENDOR 6
+#define ACPI_RESOURCE_TYPE_END_TAG 7
+#define ACPI_RESOURCE_TYPE_MEMORY24 8
+#define ACPI_RESOURCE_TYPE_MEMORY32 9
+#define ACPI_RESOURCE_TYPE_FIXED_MEMORY32 10
+#define ACPI_RESOURCE_TYPE_ADDRESS16 11
+#define ACPI_RESOURCE_TYPE_ADDRESS32 12
+#define ACPI_RESOURCE_TYPE_ADDRESS64 13
+#define ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 14 /* ACPI 3.0 */
+#define ACPI_RESOURCE_TYPE_EXTENDED_IRQ 15
+#define ACPI_RESOURCE_TYPE_GENERIC_REGISTER 16
+#define ACPI_RESOURCE_TYPE_MAX 16
+
typedef union acpi_resource_data
{
- ACPI_RESOURCE_IRQ Irq;
- ACPI_RESOURCE_DMA Dma;
- ACPI_RESOURCE_START_DPF StartDpf;
- ACPI_RESOURCE_IO Io;
- ACPI_RESOURCE_FIXED_IO FixedIo;
- ACPI_RESOURCE_VENDOR VendorSpecific;
- ACPI_RESOURCE_END_TAG EndTag;
- ACPI_RESOURCE_MEM24 Memory24;
- ACPI_RESOURCE_MEM32 Memory32;
- ACPI_RESOURCE_FIXED_MEM32 FixedMemory32;
- ACPI_RESOURCE_ADDRESS16 Address16;
- ACPI_RESOURCE_ADDRESS32 Address32;
- ACPI_RESOURCE_ADDRESS64 Address64;
- ACPI_RESOURCE_EXT_IRQ ExtendedIrq;
+ ACPI_RESOURCE_IRQ Irq;
+ ACPI_RESOURCE_DMA Dma;
+ ACPI_RESOURCE_START_DEPENDENT StartDpf;
+ ACPI_RESOURCE_IO Io;
+ ACPI_RESOURCE_FIXED_IO FixedIo;
+ ACPI_RESOURCE_VENDOR Vendor;
+ ACPI_RESOURCE_END_TAG EndTag;
+ ACPI_RESOURCE_MEMORY24 Memory24;
+ ACPI_RESOURCE_MEMORY32 Memory32;
+ ACPI_RESOURCE_FIXED_MEMORY32 FixedMemory32;
+ ACPI_RESOURCE_ADDRESS16 Address16;
+ ACPI_RESOURCE_ADDRESS32 Address32;
+ ACPI_RESOURCE_ADDRESS64 Address64;
+ ACPI_RESOURCE_EXTENDED_ADDRESS64 ExtAddress64;
+ ACPI_RESOURCE_EXTENDED_IRQ ExtendedIrq;
+ ACPI_RESOURCE_GENERIC_REGISTER GenericReg;
+
+ /* Common fields */
+
+ ACPI_RESOURCE_ADDRESS Address; /* Common 16/32/64 address fields */
} ACPI_RESOURCE_DATA;
+
typedef struct acpi_resource
{
- ACPI_RESOURCE_TYPE Id;
+ UINT32 Type;
UINT32 Length;
ACPI_RESOURCE_DATA Data;
} ACPI_RESOURCE;
+
#define ACPI_RESOURCE_LENGTH 12
#define ACPI_RESOURCE_LENGTH_NO_DATA 8 /* Id + Length fields */
-#define ACPI_SIZEOF_RESOURCE(Type) (ACPI_RESOURCE_LENGTH_NO_DATA + sizeof (Type))
+#define ACPI_SIZEOF_RESOURCE(Type) (UINT32) (ACPI_RESOURCE_LENGTH_NO_DATA + sizeof (Type))
#define ACPI_NEXT_RESOURCE(Res) (ACPI_RESOURCE *)((UINT8 *) Res + Res->Length)
diff --git a/usr/src/uts/intel/sys/acpi/acutils.h b/usr/src/uts/intel/sys/acpi/acutils.h
index dbad95bff0..393586a8cd 100644
--- a/usr/src/uts/intel/sys/acpi/acutils.h
+++ b/usr/src/uts/intel/sys/acpi/acutils.h
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: acutils.h -- prototypes for the common (subsystem-wide) procedures
- * $Revision: 177 $
+ * $Revision: 1.181 $
*
*****************************************************************************/
@@ -376,14 +376,14 @@ AcpiUtTrackStackPtr (
void
AcpiUtTrace (
UINT32 LineNumber,
- char *FunctionName,
+ const char *FunctionName,
char *ModuleName,
UINT32 ComponentId);
void
AcpiUtTracePtr (
UINT32 LineNumber,
- char *FunctionName,
+ const char *FunctionName,
char *ModuleName,
UINT32 ComponentId,
void *Pointer);
@@ -391,7 +391,7 @@ AcpiUtTracePtr (
void
AcpiUtTraceU32 (
UINT32 LineNumber,
- char *FunctionName,
+ const char *FunctionName,
char *ModuleName,
UINT32 ComponentId,
UINT32 Integer);
@@ -399,7 +399,7 @@ AcpiUtTraceU32 (
void
AcpiUtTraceStr (
UINT32 LineNumber,
- char *FunctionName,
+ const char *FunctionName,
char *ModuleName,
UINT32 ComponentId,
char *String);
@@ -407,14 +407,14 @@ AcpiUtTraceStr (
void
AcpiUtExit (
UINT32 LineNumber,
- char *FunctionName,
+ const char *FunctionName,
char *ModuleName,
UINT32 ComponentId);
void
AcpiUtStatusExit (
UINT32 LineNumber,
- char *FunctionName,
+ const char *FunctionName,
char *ModuleName,
UINT32 ComponentId,
ACPI_STATUS Status);
@@ -422,7 +422,7 @@ AcpiUtStatusExit (
void
AcpiUtValueExit (
UINT32 LineNumber,
- char *FunctionName,
+ const char *FunctionName,
char *ModuleName,
UINT32 ComponentId,
ACPI_INTEGER Value);
@@ -430,7 +430,7 @@ AcpiUtValueExit (
void
AcpiUtPtrExit (
UINT32 LineNumber,
- char *FunctionName,
+ const char *FunctionName,
char *ModuleName,
UINT32 ComponentId,
UINT8 *Ptr);
@@ -464,7 +464,7 @@ void ACPI_INTERNAL_VAR_XFACE
AcpiUtDebugPrint (
UINT32 RequestedDebugLevel,
UINT32 LineNumber,
- char *FunctionName,
+ const char *FunctionName,
char *ModuleName,
UINT32 ComponentId,
char *Format,
@@ -474,7 +474,7 @@ void ACPI_INTERNAL_VAR_XFACE
AcpiUtDebugPrintRaw (
UINT32 RequestedDebugLevel,
UINT32 LineNumber,
- char *FunctionName,
+ const char *FunctionName,
char *ModuleName,
UINT32 ComponentId,
char *Format,
@@ -670,9 +670,9 @@ ACPI_STATUS
AcpiUtAllocateOwnerId (
ACPI_OWNER_ID *OwnerId);
-ACPI_STATUS
+void
AcpiUtReleaseOwnerId (
- ACPI_OWNER_ID OwnerId);
+ ACPI_OWNER_ID *OwnerId);
ACPI_STATUS
AcpiUtWalkPackageTree (
@@ -681,7 +681,7 @@ AcpiUtWalkPackageTree (
ACPI_PKG_CALLBACK WalkCallback,
void *Context);
-char *
+void
AcpiUtStrupr (
char *SrcString);
@@ -755,7 +755,6 @@ AcpiUtReleaseMutex (
ACPI_MUTEX_HANDLE MutexId);
-
/*
* utalloc - memory allocation and object caching
*/
diff --git a/usr/src/uts/intel/sys/acpi/amlcode.h b/usr/src/uts/intel/sys/acpi/amlcode.h
index b546d60e77..a48f1eba33 100644
--- a/usr/src/uts/intel/sys/acpi/amlcode.h
+++ b/usr/src/uts/intel/sys/acpi/amlcode.h
@@ -3,7 +3,7 @@
* Name: amlcode.h - Definitions for AML, as included in "definition blocks"
* Declarations and definitions contained herein are derived
* directly from the ACPI specification.
- * $Revision: 82 $
+ * $Revision: 1.82 $
*
*****************************************************************************/
diff --git a/usr/src/uts/intel/sys/acpi/amlresrc.h b/usr/src/uts/intel/sys/acpi/amlresrc.h
index e9ec173e28..cde16bfc30 100644
--- a/usr/src/uts/intel/sys/acpi/amlresrc.h
+++ b/usr/src/uts/intel/sys/acpi/amlresrc.h
@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: amlresrc.h - AML resource descriptors
- * $Revision: 29 $
+ * $Revision: 1.32 $
*
*****************************************************************************/
@@ -176,239 +176,254 @@ typedef struct asl_resource_node
* Resource descriptors defined in the ACPI specification.
*
* Packing/alignment must be BYTE because these descriptors
- * are used to overlay the AML byte stream.
+ * are used to overlay the raw AML byte stream.
*/
#pragma pack(1)
-typedef struct asl_irq_format_desc
-{
+/*
+ * SMALL descriptors
+ */
+#define AML_RESOURCE_SMALL_HEADER_COMMON \
UINT8 DescriptorType;
+
+typedef struct aml_resource_small_header
+{
+ AML_RESOURCE_SMALL_HEADER_COMMON
+
+} AML_RESOURCE_SMALL_HEADER;
+
+
+typedef struct aml_resource_irq
+{
+ AML_RESOURCE_SMALL_HEADER_COMMON
UINT16 IrqMask;
UINT8 Flags;
-} ASL_IRQ_FORMAT_DESC;
+} AML_RESOURCE_IRQ;
-typedef struct asl_irq_noflags_desc
+typedef struct aml_resource_irq_noflags
{
- UINT8 DescriptorType;
+ AML_RESOURCE_SMALL_HEADER_COMMON
UINT16 IrqMask;
-} ASL_IRQ_NOFLAGS_DESC;
+} AML_RESOURCE_IRQ_NOFLAGS;
-typedef struct asl_dma_format_desc
+typedef struct aml_resource_dma
{
- UINT8 DescriptorType;
+ AML_RESOURCE_SMALL_HEADER_COMMON
UINT8 DmaChannelMask;
UINT8 Flags;
-} ASL_DMA_FORMAT_DESC;
+} AML_RESOURCE_DMA;
-typedef struct asl_start_dependent_desc
+typedef struct aml_resource_start_dependent
{
- UINT8 DescriptorType;
+ AML_RESOURCE_SMALL_HEADER_COMMON
UINT8 Flags;
-} ASL_START_DEPENDENT_DESC;
+} AML_RESOURCE_START_DEPENDENT;
-typedef struct asl_start_dependent_noprio_desc
+typedef struct aml_resource_start_dependent_noprio
{
- UINT8 DescriptorType;
+ AML_RESOURCE_SMALL_HEADER_COMMON
-} ASL_START_DEPENDENT_NOPRIO_DESC;
+} AML_RESOURCE_START_DEPENDENT_NOPRIO;
-typedef struct asl_end_dependent_desc
+typedef struct aml_resource_end_dependent
{
- UINT8 DescriptorType;
+ AML_RESOURCE_SMALL_HEADER_COMMON
-} ASL_END_DEPENDENT_DESC;
+} AML_RESOURCE_END_DEPENDENT;
-typedef struct asl_io_port_desc
+typedef struct aml_resource_io
{
- UINT8 DescriptorType;
+ AML_RESOURCE_SMALL_HEADER_COMMON
UINT8 Information;
- UINT16 AddressMin;
- UINT16 AddressMax;
+ UINT16 Minimum;
+ UINT16 Maximum;
UINT8 Alignment;
- UINT8 Length;
+ UINT8 AddressLength;
-} ASL_IO_PORT_DESC;
+} AML_RESOURCE_IO;
-typedef struct asl_fixed_io_port_desc
+typedef struct aml_resource_fixed_io
{
- UINT8 DescriptorType;
- UINT16 BaseAddress;
- UINT8 Length;
+ AML_RESOURCE_SMALL_HEADER_COMMON
+ UINT16 Address;
+ UINT8 AddressLength;
-} ASL_FIXED_IO_PORT_DESC;
+} AML_RESOURCE_FIXED_IO;
-typedef struct asl_small_vendor_desc
+typedef struct aml_resource_vendor_small
{
- UINT8 DescriptorType;
- UINT8 VendorDefined[7];
+ AML_RESOURCE_SMALL_HEADER_COMMON
-} ASL_SMALL_VENDOR_DESC;
+} AML_RESOURCE_VENDOR_SMALL;
-typedef struct asl_end_tag_desc
+typedef struct aml_resource_end_tag
{
- UINT8 DescriptorType;
+ AML_RESOURCE_SMALL_HEADER_COMMON
UINT8 Checksum;
-} ASL_END_TAG_DESC;
+} AML_RESOURCE_END_TAG;
-/* LARGE descriptors */
+/*
+ * LARGE descriptors
+ */
+#define AML_RESOURCE_LARGE_HEADER_COMMON \
+ UINT8 DescriptorType;\
+ UINT16 ResourceLength;
-typedef struct asl_memory_24_desc
+typedef struct aml_resource_large_header
{
- UINT8 DescriptorType;
- UINT16 Length;
+ AML_RESOURCE_LARGE_HEADER_COMMON
+
+} AML_RESOURCE_LARGE_HEADER;
+
+
+typedef struct aml_resource_memory24
+{
+ AML_RESOURCE_LARGE_HEADER_COMMON
UINT8 Information;
- UINT16 AddressMin;
- UINT16 AddressMax;
+ UINT16 Minimum;
+ UINT16 Maximum;
UINT16 Alignment;
- UINT16 RangeLength;
+ UINT16 AddressLength;
-} ASL_MEMORY_24_DESC;
+} AML_RESOURCE_MEMORY24;
-typedef struct asl_large_vendor_desc
+typedef struct aml_resource_vendor_large
{
- UINT8 DescriptorType;
- UINT16 Length;
- UINT8 VendorDefined[1];
+ AML_RESOURCE_LARGE_HEADER_COMMON
-} ASL_LARGE_VENDOR_DESC;
+} AML_RESOURCE_VENDOR_LARGE;
-typedef struct asl_memory_32_desc
+typedef struct aml_resource_memory32
{
- UINT8 DescriptorType;
- UINT16 Length;
+ AML_RESOURCE_LARGE_HEADER_COMMON
UINT8 Information;
- UINT32 AddressMin;
- UINT32 AddressMax;
+ UINT32 Minimum;
+ UINT32 Maximum;
UINT32 Alignment;
- UINT32 RangeLength;
+ UINT32 AddressLength;
-} ASL_MEMORY_32_DESC;
+} AML_RESOURCE_MEMORY32;
-typedef struct asl_fixed_memory_32_desc
+typedef struct aml_resource_fixed_memory32
{
- UINT8 DescriptorType;
- UINT16 Length;
+ AML_RESOURCE_LARGE_HEADER_COMMON
UINT8 Information;
- UINT32 BaseAddress;
- UINT32 RangeLength;
+ UINT32 Address;
+ UINT32 AddressLength;
-} ASL_FIXED_MEMORY_32_DESC;
+} AML_RESOURCE_FIXED_MEMORY32;
-typedef struct asl_extended_address_desc
-{
- UINT8 DescriptorType;
- UINT16 Length;
- UINT8 ResourceType;
- UINT8 Flags;
+#define AML_RESOURCE_ADDRESS_COMMON \
+ UINT8 ResourceType; \
+ UINT8 Flags; \
UINT8 SpecificFlags;
+
+
+typedef struct aml_resource_address
+{
+ AML_RESOURCE_LARGE_HEADER_COMMON
+ AML_RESOURCE_ADDRESS_COMMON
+
+} AML_RESOURCE_ADDRESS;
+
+
+typedef struct aml_resource_extended_address64
+{
+ AML_RESOURCE_LARGE_HEADER_COMMON
+ AML_RESOURCE_ADDRESS_COMMON
UINT8 RevisionID;
UINT8 Reserved;
UINT64 Granularity;
- UINT64 AddressMin;
- UINT64 AddressMax;
+ UINT64 Minimum;
+ UINT64 Maximum;
UINT64 TranslationOffset;
UINT64 AddressLength;
UINT64 TypeSpecificAttributes;
- UINT8 OptionalFields[2]; /* Used for length calculation only */
-} ASL_EXTENDED_ADDRESS_DESC;
+} AML_RESOURCE_EXTENDED_ADDRESS64;
-#define ASL_EXTENDED_ADDRESS_DESC_REVISION 1 /* ACPI 3.0 */
+#define AML_RESOURCE_EXTENDED_ADDRESS_REVISION 1 /* ACPI 3.0 */
-typedef struct asl_qword_address_desc
+typedef struct aml_resource_address64
{
- UINT8 DescriptorType;
- UINT16 Length;
- UINT8 ResourceType;
- UINT8 Flags;
- UINT8 SpecificFlags;
+ AML_RESOURCE_LARGE_HEADER_COMMON
+ AML_RESOURCE_ADDRESS_COMMON
UINT64 Granularity;
- UINT64 AddressMin;
- UINT64 AddressMax;
+ UINT64 Minimum;
+ UINT64 Maximum;
UINT64 TranslationOffset;
UINT64 AddressLength;
- UINT8 OptionalFields[2];
-} ASL_QWORD_ADDRESS_DESC;
+} AML_RESOURCE_ADDRESS64;
-typedef struct asl_dword_address_desc
+typedef struct aml_resource_address32
{
- UINT8 DescriptorType;
- UINT16 Length;
- UINT8 ResourceType;
- UINT8 Flags;
- UINT8 SpecificFlags;
+ AML_RESOURCE_LARGE_HEADER_COMMON
+ AML_RESOURCE_ADDRESS_COMMON
UINT32 Granularity;
- UINT32 AddressMin;
- UINT32 AddressMax;
+ UINT32 Minimum;
+ UINT32 Maximum;
UINT32 TranslationOffset;
UINT32 AddressLength;
- UINT8 OptionalFields[2];
-} ASL_DWORD_ADDRESS_DESC;
+} AML_RESOURCE_ADDRESS32;
-typedef struct asl_word_address_desc
+typedef struct aml_resource_address16
{
- UINT8 DescriptorType;
- UINT16 Length;
- UINT8 ResourceType;
- UINT8 Flags;
- UINT8 SpecificFlags;
+ AML_RESOURCE_LARGE_HEADER_COMMON
+ AML_RESOURCE_ADDRESS_COMMON
UINT16 Granularity;
- UINT16 AddressMin;
- UINT16 AddressMax;
+ UINT16 Minimum;
+ UINT16 Maximum;
UINT16 TranslationOffset;
UINT16 AddressLength;
- UINT8 OptionalFields[2];
-} ASL_WORD_ADDRESS_DESC;
+} AML_RESOURCE_ADDRESS16;
-typedef struct asl_extended_xrupt_desc
+typedef struct aml_resource_extended_irq
{
- UINT8 DescriptorType;
- UINT16 Length;
+ AML_RESOURCE_LARGE_HEADER_COMMON
UINT8 Flags;
UINT8 TableLength;
UINT32 InterruptNumber[1];
/* ResSourceIndex, ResSource optional fields follow */
-} ASL_EXTENDED_XRUPT_DESC;
+} AML_RESOURCE_EXTENDED_IRQ;
-typedef struct asl_general_register_desc
+typedef struct aml_resource_generic_register
{
- UINT8 DescriptorType;
- UINT16 Length;
+ AML_RESOURCE_LARGE_HEADER_COMMON
UINT8 AddressSpaceId;
UINT8 BitWidth;
UINT8 BitOffset;
- UINT8 AccessSize; /* ACPI 3.0, was Reserved */
+ UINT8 AccessSize; /* ACPI 3.0, was previously Reserved */
UINT64 Address;
-} ASL_GENERAL_REGISTER_DESC;
+} AML_RESOURCE_GENERIC_REGISTER;
/* restore default alignment */
@@ -416,32 +431,45 @@ typedef struct asl_general_register_desc
/* Union of all resource descriptors, so we can allocate the worst case */
-typedef union asl_resource_desc
+typedef union aml_resource
{
- ASL_IRQ_FORMAT_DESC Irq;
- ASL_DMA_FORMAT_DESC Dma;
- ASL_START_DEPENDENT_DESC Std;
- ASL_END_DEPENDENT_DESC End;
- ASL_IO_PORT_DESC Iop;
- ASL_FIXED_IO_PORT_DESC Fio;
- ASL_SMALL_VENDOR_DESC Smv;
- ASL_END_TAG_DESC Et;
-
- ASL_MEMORY_24_DESC M24;
- ASL_LARGE_VENDOR_DESC Lgv;
- ASL_MEMORY_32_DESC M32;
- ASL_FIXED_MEMORY_32_DESC F32;
- ASL_QWORD_ADDRESS_DESC Qas;
- ASL_DWORD_ADDRESS_DESC Das;
- ASL_WORD_ADDRESS_DESC Was;
- ASL_EXTENDED_ADDRESS_DESC Eas;
- ASL_EXTENDED_XRUPT_DESC Exx;
- ASL_GENERAL_REGISTER_DESC Grg;
- UINT32 U32Item;
- UINT16 U16Item;
- UINT8 U8Item;
-
-} ASL_RESOURCE_DESC;
+ /* Descriptor headers */
+
+ AML_RESOURCE_SMALL_HEADER SmallHeader;
+ AML_RESOURCE_LARGE_HEADER LargeHeader;
+
+ /* Small resource descriptors */
+
+ AML_RESOURCE_IRQ Irq;
+ AML_RESOURCE_DMA Dma;
+ AML_RESOURCE_START_DEPENDENT StartDpf;
+ AML_RESOURCE_END_DEPENDENT EndDpf;
+ AML_RESOURCE_IO Io;
+ AML_RESOURCE_FIXED_IO FixedIo;
+ AML_RESOURCE_VENDOR_SMALL VendorSmall;
+ AML_RESOURCE_END_TAG EndTag;
+
+ /* Large resource descriptors */
+
+ AML_RESOURCE_MEMORY24 Memory24;
+ AML_RESOURCE_GENERIC_REGISTER GenericReg;
+ AML_RESOURCE_VENDOR_LARGE VendorLarge;
+ AML_RESOURCE_MEMORY32 Memory32;
+ AML_RESOURCE_FIXED_MEMORY32 FixedMemory32;
+ AML_RESOURCE_ADDRESS16 Address16;
+ AML_RESOURCE_ADDRESS32 Address32;
+ AML_RESOURCE_ADDRESS64 Address64;
+ AML_RESOURCE_EXTENDED_ADDRESS64 ExtAddress64;
+ AML_RESOURCE_EXTENDED_IRQ ExtendedIrq;
+
+ /* Utility overlays */
+
+ AML_RESOURCE_ADDRESS Address;
+ UINT32 U32Item;
+ UINT16 U16Item;
+ UINT8 U8Item;
+
+} AML_RESOURCE;
#endif
diff --git a/usr/src/uts/intel/sys/acpi/platform/acdos16.h b/usr/src/uts/intel/sys/acpi/platform/acdos16.h
index dc47e019a4..34333e9215 100644
--- a/usr/src/uts/intel/sys/acpi/platform/acdos16.h
+++ b/usr/src/uts/intel/sys/acpi/platform/acdos16.h
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: acdos16.h - DOS specific defines, etc.
- * $Revision: 12 $
+ * $Revision: 1.12 $
*
*****************************************************************************/
diff --git a/usr/src/uts/intel/sys/acpi/platform/acefi.h b/usr/src/uts/intel/sys/acpi/platform/acefi.h
index 88c276bee3..7dde203113 100644
--- a/usr/src/uts/intel/sys/acpi/platform/acefi.h
+++ b/usr/src/uts/intel/sys/acpi/platform/acefi.h
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: acefi.h - OS specific defines, etc.
- * $Revision: 16 $
+ * $Revision: 1.16 $
*
*****************************************************************************/
diff --git a/usr/src/uts/intel/sys/acpi/platform/acenv.h b/usr/src/uts/intel/sys/acpi/platform/acenv.h
index d6001a2a70..9b709f8278 100644
--- a/usr/src/uts/intel/sys/acpi/platform/acenv.h
+++ b/usr/src/uts/intel/sys/acpi/platform/acenv.h
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: acenv.h - Generation environment specific items
- * $Revision: 116 $
+ * $Revision: 1.118 $
*
*****************************************************************************/
@@ -142,6 +142,7 @@
#define ACPI_APPLICATION
#define ACPI_DEBUGGER
#define ACPI_DISASSEMBLER
+#define ACPI_MUTEX_DEBUG
#endif
#ifdef ACPI_ASL_COMPILER
@@ -317,15 +318,15 @@
#define ACPI_MEMCPY(d,s,n) (void) memcpy((d), (s), (ACPI_SIZE)(n))
#define ACPI_MEMSET(d,s,n) (void) memset((d), (s), (ACPI_SIZE)(n))
-#define ACPI_TOUPPER toupper
-#define ACPI_TOLOWER tolower
-#define ACPI_IS_XDIGIT isxdigit
-#define ACPI_IS_DIGIT isdigit
-#define ACPI_IS_SPACE isspace
-#define ACPI_IS_UPPER isupper
-#define ACPI_IS_PRINT isprint
-#define ACPI_IS_ALPHA isalpha
-#define ACPI_IS_ASCII isascii
+#define ACPI_TOUPPER(i) toupper((int) (i))
+#define ACPI_TOLOWER(i) tolower((int) (i))
+#define ACPI_IS_XDIGIT(i) isxdigit((int) (i))
+#define ACPI_IS_DIGIT(i) isdigit((int) (i))
+#define ACPI_IS_SPACE(i) isspace((int) (i))
+#define ACPI_IS_UPPER(i) isupper((int) (i))
+#define ACPI_IS_PRINT(i) isprint((int) (i))
+#define ACPI_IS_ALPHA(i) isalpha((int) (i))
+#define ACPI_IS_ASCII(i) isascii((int) (i))
#else
diff --git a/usr/src/uts/intel/sys/acpi/platform/acfreebsd.h b/usr/src/uts/intel/sys/acpi/platform/acfreebsd.h
index 8f18209e13..b1905d9a2c 100644
--- a/usr/src/uts/intel/sys/acpi/platform/acfreebsd.h
+++ b/usr/src/uts/intel/sys/acpi/platform/acfreebsd.h
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: acfreebsd.h - OS specific defines, etc.
- * $Revision: 19 $
+ * $Revision: 1.19 $
*
*****************************************************************************/
diff --git a/usr/src/uts/intel/sys/acpi/platform/acgcc.h b/usr/src/uts/intel/sys/acpi/platform/acgcc.h
index e95e35c5fd..49027292be 100644
--- a/usr/src/uts/intel/sys/acpi/platform/acgcc.h
+++ b/usr/src/uts/intel/sys/acpi/platform/acgcc.h
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: acgcc.h - GCC specific defines, etc.
- * $Revision: 29 $
+ * $Revision: 1.29 $
*
*****************************************************************************/
diff --git a/usr/src/uts/intel/sys/acpi/platform/acintel.h b/usr/src/uts/intel/sys/acpi/platform/acintel.h
index b98bb59cec..5a3c3f8c99 100644
--- a/usr/src/uts/intel/sys/acpi/platform/acintel.h
+++ b/usr/src/uts/intel/sys/acpi/platform/acintel.h
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: acintel.h - VC specific defines, etc.
- * $Revision: 13 $
+ * $Revision: 1.14 $
*
*****************************************************************************/
@@ -160,6 +160,9 @@
/* warn C4706: assignment within conditional expression */
#pragma warning(disable:4706)
+/* warn C4214: bit field types other than int */
+#pragma warning(disable:4214)
+
/* This macro is used to tag functions as "printf-like" because
* some compilers can catch printf format string problems. MSVC
* doesn't, so this is proprocessed away.
diff --git a/usr/src/uts/intel/sys/acpi/platform/aclinux.h b/usr/src/uts/intel/sys/acpi/platform/aclinux.h
index 457db6a82d..72a029642a 100644
--- a/usr/src/uts/intel/sys/acpi/platform/aclinux.h
+++ b/usr/src/uts/intel/sys/acpi/platform/aclinux.h
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: aclinux.h - OS specific defines, etc.
- * $Revision: 37 $
+ * $Revision: 1.37 $
*
*****************************************************************************/
diff --git a/usr/src/uts/intel/sys/acpi/platform/acmsvc.h b/usr/src/uts/intel/sys/acpi/platform/acmsvc.h
index 80fb1ef940..ef2a902862 100644
--- a/usr/src/uts/intel/sys/acpi/platform/acmsvc.h
+++ b/usr/src/uts/intel/sys/acpi/platform/acmsvc.h
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: acmsvc.h - VC specific defines, etc.
- * $Revision: 22 $
+ * $Revision: 1.22 $
*
*****************************************************************************/
diff --git a/usr/src/uts/intel/sys/acpi/platform/acnetbsd.h b/usr/src/uts/intel/sys/acpi/platform/acnetbsd.h
index 754e7a39b2..109aeb2d6a 100644
--- a/usr/src/uts/intel/sys/acpi/platform/acnetbsd.h
+++ b/usr/src/uts/intel/sys/acpi/platform/acnetbsd.h
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: acnetbsd.h - OS specific defines, etc.
- * $Revision: 7 $
+ * $Revision: 1.7 $
*
*****************************************************************************/
diff --git a/usr/src/uts/intel/sys/acpi/platform/acwin.h b/usr/src/uts/intel/sys/acpi/platform/acwin.h
index 868a900dcd..b485b56642 100644
--- a/usr/src/uts/intel/sys/acpi/platform/acwin.h
+++ b/usr/src/uts/intel/sys/acpi/platform/acwin.h
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: acwin.h - OS specific defines, etc.
- * $Revision: 21 $
+ * $Revision: 1.22 $
*
*****************************************************************************/
@@ -154,6 +154,9 @@
#define ACPI_FLUSH_CPU_CACHE() __asm {WBINVD}
#endif
+#ifdef _DEBUG
+#define ACPI_SIMPLE_RETURN_MACROS
+#endif
/*
* For Acpi applications, we don't want to try to access the global lock
diff --git a/usr/src/uts/intel/sys/acpi/platform/acwin64.h b/usr/src/uts/intel/sys/acpi/platform/acwin64.h
index cd5e65360b..72ab822c15 100644
--- a/usr/src/uts/intel/sys/acpi/platform/acwin64.h
+++ b/usr/src/uts/intel/sys/acpi/platform/acwin64.h
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: acwin.h - OS specific defines, etc.
- * $Revision: 14 $
+ * $Revision: 1.14 $
*
*****************************************************************************/