diff options
author | Jerry Jelinek <jerry.jelinek@joyent.com> | 2016-07-26 15:05:29 +0000 |
---|---|---|
committer | Jerry Jelinek <jerry.jelinek@joyent.com> | 2016-07-26 15:05:29 +0000 |
commit | d103e8b98085dbb5f7707242723b9d3ce74f2723 (patch) | |
tree | 263af7aa964a6c36a7cd561cd80268d6cbba5d5d /usr/src/uts/intel/io/acpica/namespace/nsaccess.c | |
parent | 9b221abb819d37d8c917941b8348a6c0e49c74b1 (diff) | |
download | illumos-joyent-d103e8b98085dbb5f7707242723b9d3ce74f2723.tar.gz |
OS-5536 update to ACPI version 6.x
Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>
Diffstat (limited to 'usr/src/uts/intel/io/acpica/namespace/nsaccess.c')
-rw-r--r-- | usr/src/uts/intel/io/acpica/namespace/nsaccess.c | 48 |
1 files changed, 26 insertions, 22 deletions
diff --git a/usr/src/uts/intel/io/acpica/namespace/nsaccess.c b/usr/src/uts/intel/io/acpica/namespace/nsaccess.c index 9dfa76fb08..eb6fed6230 100644 --- a/usr/src/uts/intel/io/acpica/namespace/nsaccess.c +++ b/usr/src/uts/intel/io/acpica/namespace/nsaccess.c @@ -5,7 +5,7 @@ ******************************************************************************/ /* - * Copyright (C) 2000 - 2012, Intel Corp. + * Copyright (C) 2000 - 2016, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,8 +41,6 @@ * POSSIBILITY OF SUCH DAMAGES. */ -#define __NSACCESS_C__ - #include "acpi.h" #include "accommon.h" #include "amlcode.h" @@ -113,20 +111,20 @@ AcpiNsRootInitialize ( { /* _OSI is optional for now, will be permanent later */ - if (!ACPI_STRCMP (InitVal->Name, "_OSI") && !AcpiGbl_CreateOsiMethod) + if (!strcmp (InitVal->Name, "_OSI") && !AcpiGbl_CreateOsiMethod) { continue; } - Status = AcpiNsLookup (NULL, InitVal->Name, InitVal->Type, - ACPI_IMODE_LOAD_PASS2, ACPI_NS_NO_UPSEARCH, - NULL, &NewNode); - - if (ACPI_FAILURE (Status) || (!NewNode)) /* Must be on same line for code converter */ + Status = AcpiNsLookup (NULL, ACPI_CAST_PTR (char, InitVal->Name), + InitVal->Type, ACPI_IMODE_LOAD_PASS2, ACPI_NS_NO_UPSEARCH, + NULL, &NewNode); + if (ACPI_FAILURE (Status)) { ACPI_EXCEPTION ((AE_INFO, Status, "Could not create predefined name %s", InitVal->Name)); + continue; } /* @@ -167,6 +165,7 @@ AcpiNsRootInitialize ( switch (InitVal->Type) { case ACPI_TYPE_METHOD: + ObjDesc->Method.ParamCount = (UINT8) ACPI_TO_INTEGER (Val); ObjDesc->Common.Flags |= AOPOBJ_DATA_VALID; @@ -188,17 +187,15 @@ AcpiNsRootInitialize ( ObjDesc->Integer.Value = ACPI_TO_INTEGER (Val); break; - case ACPI_TYPE_STRING: /* Build an object around the static string */ - ObjDesc->String.Length = (UINT32) ACPI_STRLEN (Val); + ObjDesc->String.Length = (UINT32) strlen (Val); ObjDesc->String.Pointer = Val; ObjDesc->Common.Flags |= AOPOBJ_STATIC_POINTER; break; - case ACPI_TYPE_MUTEX: ObjDesc->Mutex.Node = NewNode; @@ -215,14 +212,14 @@ AcpiNsRootInitialize ( /* Special case for ACPI Global Lock */ - if (ACPI_STRCMP (InitVal->Name, "_GL_") == 0) + if (strcmp (InitVal->Name, "_GL_") == 0) { AcpiGbl_GlobalLockMutex = ObjDesc; /* Create additional counting semaphore for global lock */ Status = AcpiOsCreateSemaphore ( - 1, 0, &AcpiGbl_GlobalLockSemaphore); + 1, 0, &AcpiGbl_GlobalLockSemaphore); if (ACPI_FAILURE (Status)) { AcpiUtRemoveReference (ObjDesc); @@ -231,7 +228,6 @@ AcpiNsRootInitialize ( } break; - default: ACPI_ERROR ((AE_INFO, "Unsupported initial type value 0x%X", @@ -244,7 +240,7 @@ AcpiNsRootInitialize ( /* Store pointer to value descriptor in the Node */ Status = AcpiNsAttachObject (NewNode, ObjDesc, - ObjDesc->Common.Type); + ObjDesc->Common.Type); /* Remove local reference to the object */ @@ -261,7 +257,7 @@ UnlockAndExit: if (ACPI_SUCCESS (Status)) { Status = AcpiNsGetNode (NULL, "\\_GPE", ACPI_NS_NO_UPSEARCH, - &AcpiGbl_FadtGpeDevice); + &AcpiGbl_FadtGpeDevice); } return_ACPI_STATUS (Status); @@ -323,7 +319,9 @@ AcpiNsLookup ( return_ACPI_STATUS (AE_BAD_PARAMETER); } - LocalFlags = Flags & ~(ACPI_NS_ERROR_IF_FOUND | ACPI_NS_SEARCH_PARENT); + LocalFlags = Flags & + ~(ACPI_NS_ERROR_IF_FOUND | ACPI_NS_OVERRIDE_IF_FOUND | + ACPI_NS_SEARCH_PARENT); *ReturnNode = ACPI_ENTRY_NOT_FOUND; AcpiGbl_NsLookupCount++; @@ -450,8 +448,8 @@ AcpiNsLookup ( /* Current scope has no parent scope */ ACPI_ERROR ((AE_INFO, - "ACPI path has too many parent prefixes (^) " - "- reached beyond root node")); + "%s: Path has too many parent prefixes (^) " + "- reached beyond root node", Pathname)); return_ACPI_STATUS (AE_NOT_FOUND); } } @@ -575,6 +573,13 @@ AcpiNsLookup ( { LocalFlags |= ACPI_NS_ERROR_IF_FOUND; } + + /* Set override flag according to caller */ + + if (Flags & ACPI_NS_OVERRIDE_IF_FOUND) + { + LocalFlags |= ACPI_NS_OVERRIDE_IF_FOUND; + } } /* Extract one ACPI name from the front of the pathname */ @@ -584,7 +589,7 @@ AcpiNsLookup ( /* Try to find the single (4 character) ACPI name */ Status = AcpiNsSearchAndEnter (SimpleName, WalkState, CurrentNode, - InterpreterMode, ThisSearchType, LocalFlags, &ThisNode); + InterpreterMode, ThisSearchType, LocalFlags, &ThisNode); if (ACPI_FAILURE (Status)) { if (Status == AE_NOT_FOUND) @@ -697,4 +702,3 @@ AcpiNsLookup ( *ReturnNode = ThisNode; return_ACPI_STATUS (AE_OK); } - |