本文整理匯總了C++中AcpiUtStrupr函數的典型用法代碼示例。如果您正苦於以下問題:C++ AcpiUtStrupr函數的具體用法?C++ AcpiUtStrupr怎麽用?C++ AcpiUtStrupr使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了AcpiUtStrupr函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: AcpiDbFindNameInNamespace
ACPI_STATUS
AcpiDbFindNameInNamespace (
char *NameArg)
{
char AcpiName[5] = "____";
char *AcpiNamePtr = AcpiName;
if (strlen (NameArg) > 4)
{
AcpiOsPrintf ("Name must be no longer than 4 characters\n");
return (AE_OK);
}
/* Pad out name with underscores as necessary to create a 4-char name */
AcpiUtStrupr (NameArg);
while (*NameArg)
{
*AcpiNamePtr = *NameArg;
AcpiNamePtr++;
NameArg++;
}
/* Walk the namespace from the root */
(void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
AcpiDbWalkAndMatchName, NULL, AcpiName, NULL);
AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT);
return (AE_OK);
}
示例2: AcpiDbExecuteTest
void
AcpiDbExecuteTest (
char *TypeArg)
{
UINT32 Temp;
AcpiUtStrupr (TypeArg);
Temp = AcpiDbMatchArgument (TypeArg, AcpiDbTestTypes);
if (Temp == ACPI_TYPE_NOT_FOUND)
{
AcpiOsPrintf ("Invalid or unsupported argument\n");
return;
}
switch (Temp)
{
case CMD_TEST_OBJECTS:
AcpiDbTestAllObjects ();
break;
case CMD_TEST_PREDEFINED:
AcpiDbEvaluateAllPredefinedNames (NULL);
break;
default:
break;
}
}
示例3: OpcFindName
static BOOLEAN
OpcFindName (
const char **List,
char *Name,
UINT32 *Index)
{
const char *NameString;
UINT32 i;
AcpiUtStrupr (Name);
for (i = 0, NameString = List[0];
NameString;
i++, NameString = List[i])
{
if (!(strncmp (NameString, Name, strlen (Name))))
{
*Index = i;
return (TRUE);
}
}
return (FALSE);
}
示例4: AhDisplayDeviceIds
void
AhDisplayDeviceIds (
char *Name)
{
const AH_DEVICE_ID *Info;
UINT32 Length;
BOOLEAN Matched;
UINT32 i;
BOOLEAN Found = FALSE;
/* Null input name indicates "display all" */
if (!Name || (Name[0] == '*'))
{
printf ("ACPI and PNP Device/Hardware IDs:\n\n");
for (Info = AslDeviceIds; Info->Name; Info++)
{
printf ("%8s %s\n", Info->Name, Info->Description);
}
return;
}
Length = strlen (Name);
if (Length > 8)
{
printf ("%.8s: Hardware ID must be 8 characters maximum\n", Name);
return;
}
/* Find/display all names that match the input name prefix */
AcpiUtStrupr (Name);
for (Info = AslDeviceIds; Info->Name; Info++)
{
Matched = TRUE;
for (i = 0; i < Length; i++)
{
if (Info->Name[i] != Name[i])
{
Matched = FALSE;
break;
}
}
if (Matched)
{
Found = TRUE;
printf ("%8s %s\n", Info->Name, Info->Description);
}
}
if (!Found)
{
printf ("%s, Hardware ID not found\n", Name);
}
}
示例5: AhFindAmlOpcode
void
AhFindAmlOpcode (
char *Name)
{
const AH_AML_OPCODE *Op;
BOOLEAN Found = FALSE;
AcpiUtStrupr (Name);
/* Find/display all opcode names that match the input name prefix */
for (Op = AmlOpcodeInfo; Op->OpcodeString; Op++)
{
if (!Op->OpcodeName) /* Unused opcodes */
{
continue;
}
if (!Name)
{
AhDisplayAmlOpcode (Op);
Found = TRUE;
continue;
}
/* Upper case the opcode name before substring compare */
strcpy (Gbl_Buffer, Op->OpcodeName);
AcpiUtStrupr (Gbl_Buffer);
if (strstr (Gbl_Buffer, Name) == Gbl_Buffer)
{
AhDisplayAmlOpcode (Op);
Found = TRUE;
}
}
if (!Found)
{
printf ("%s, no matching AML operators\n", Name);
}
}
示例6: AhFindAslOperators
UINT32
AhFindAslOperators (
char *Name)
{
const AH_ASL_OPERATOR *Operator;
BOOLEAN MatchCount = 0;
AcpiUtStrupr (Name);
/* Find/display all names that match the input name prefix */
for (Operator = Gbl_AslOperatorInfo; Operator->Name; Operator++)
{
if (!Name || (Name[0] == '*'))
{
AhDisplayAslOperator (Operator);
MatchCount++;
continue;
}
/* Upper case the operator name before substring compare */
strcpy (Gbl_Buffer, Operator->Name);
AcpiUtStrupr (Gbl_Buffer);
if (strstr (Gbl_Buffer, Name) == Gbl_Buffer)
{
AhDisplayAslOperator (Operator);
MatchCount++;
}
}
if (!MatchCount)
{
printf ("%s, no matching ASL operators\n", Name);
}
return (MatchCount);
}
示例7: AhFindAslKeywords
void
AhFindAslKeywords (
char *Name)
{
const AH_ASL_KEYWORD *Keyword;
BOOLEAN Found = FALSE;
AcpiUtStrupr (Name);
for (Keyword = Gbl_AslKeywordInfo; Keyword->Name; Keyword++)
{
if (!Name || (Name[0] == '*'))
{
AhDisplayAslKeyword (Keyword);
Found = TRUE;
continue;
}
/* Upper case the operator name before substring compare */
strcpy (Gbl_Buffer, Keyword->Name);
AcpiUtStrupr (Gbl_Buffer);
if (strstr (Gbl_Buffer, Name) == Gbl_Buffer)
{
AhDisplayAslKeyword (Keyword);
Found = TRUE;
}
}
if (!Found)
{
printf ("%s, no matching ASL keywords\n", Name);
}
}
示例8: AcpiDbGetLine
static UINT32
AcpiDbGetLine (
char *InputBuffer)
{
UINT32 i;
UINT32 Count;
char *Next;
char *This;
if (AcpiUtSafeStrcpy (AcpiGbl_DbParsedBuf, sizeof (AcpiGbl_DbParsedBuf),
InputBuffer))
{
AcpiOsPrintf (
"Buffer overflow while parsing input line (max %u characters)\n",
sizeof (AcpiGbl_DbParsedBuf));
return (0);
}
This = AcpiGbl_DbParsedBuf;
for (i = 0; i < ACPI_DEBUGGER_MAX_ARGS; i++)
{
AcpiGbl_DbArgs[i] = AcpiDbGetNextToken (This, &Next,
&AcpiGbl_DbArgTypes[i]);
if (!AcpiGbl_DbArgs[i])
{
break;
}
This = Next;
}
/* Uppercase the actual command */
if (AcpiGbl_DbArgs[0])
{
AcpiUtStrupr (AcpiGbl_DbArgs[0]);
}
Count = i;
if (Count)
{
Count--; /* Number of args only */
}
return (Count);
}
示例9: AcpiDbGetLine
static UINT32
AcpiDbGetLine (
char *InputBuffer)
{
UINT32 i;
UINT32 Count;
char *Next;
char *This;
ACPI_STRCPY (AcpiGbl_DbParsedBuf, InputBuffer);
This = AcpiGbl_DbParsedBuf;
for (i = 0; i < ACPI_DEBUGGER_MAX_ARGS; i++)
{
AcpiGbl_DbArgs[i] = AcpiDbGetNextToken (This, &Next,
&AcpiGbl_DbArgTypes[i]);
if (!AcpiGbl_DbArgs[i])
{
break;
}
This = Next;
}
/* Uppercase the actual command */
if (AcpiGbl_DbArgs[0])
{
AcpiUtStrupr (AcpiGbl_DbArgs[0]);
}
Count = i;
if (Count)
{
Count--; /* Number of args only */
}
return (Count);
}
示例10: AcpiDbPrepNamestring
void
AcpiDbPrepNamestring (
char *Name)
{
if (!Name)
{
return;
}
AcpiUtStrupr (Name);
/* Convert a leading forward slash to a backslash */
if (*Name == '/')
{
*Name = '\\';
}
/* Ignore a leading backslash, this is the root prefix */
if (ACPI_IS_ROOT_PREFIX (*Name))
{
Name++;
}
/* Convert all slash path separators to dots */
while (*Name)
{
if ((*Name == '/') ||
(*Name == '\\'))
{
*Name = '.';
}
Name++;
}
}
示例11: AhFindPredefinedNames
void
AhFindPredefinedNames (
char *NamePrefix)
{
UINT32 Length;
BOOLEAN Found;
char Name[9];
if (!NamePrefix || (NamePrefix[0] == '*'))
{
Found = AhDisplayPredefinedName (NULL, 0);
return;
}
/* Contruct a local name or name prefix */
AcpiUtStrupr (NamePrefix);
if (*NamePrefix == '_')
{
NamePrefix++;
}
Name[0] = '_';
AcpiUtSafeStrncpy (&Name[1], NamePrefix, 7);
Length = strlen (Name);
if (Length > ACPI_NAME_SIZE)
{
printf ("%.8s: Predefined name must be 4 characters maximum\n", Name);
return;
}
Found = AhDisplayPredefinedName (Name, Length);
if (!Found)
{
printf ("%s, no matching predefined names\n", Name);
}
}
示例12: AcpiDbDecodeAndDisplayObject
void
AcpiDbDecodeAndDisplayObject (
char *Target,
char *OutputType)
{
void *ObjPtr;
ACPI_NAMESPACE_NODE *Node;
ACPI_OPERAND_OBJECT *ObjDesc;
UINT32 Display = DB_BYTE_DISPLAY;
char Buffer[80];
ACPI_BUFFER RetBuf;
ACPI_STATUS Status;
UINT32 Size;
if (!Target)
{
return;
}
/* Decode the output type */
if (OutputType)
{
AcpiUtStrupr (OutputType);
if (OutputType[0] == 'W')
{
Display = DB_WORD_DISPLAY;
}
else if (OutputType[0] == 'D')
{
Display = DB_DWORD_DISPLAY;
}
else if (OutputType[0] == 'Q')
{
Display = DB_QWORD_DISPLAY;
}
}
RetBuf.Length = sizeof (Buffer);
RetBuf.Pointer = Buffer;
/* Differentiate between a number and a name */
if ((Target[0] >= 0x30) && (Target[0] <= 0x39))
{
ObjPtr = AcpiDbGetPointer (Target);
if (!AcpiOsReadable (ObjPtr, 16))
{
AcpiOsPrintf (
"Address %p is invalid in this address space\n",
ObjPtr);
return;
}
/* Decode the object type */
switch (ACPI_GET_DESCRIPTOR_TYPE (ObjPtr))
{
case ACPI_DESC_TYPE_NAMED:
/* This is a namespace Node */
if (!AcpiOsReadable (ObjPtr, sizeof (ACPI_NAMESPACE_NODE)))
{
AcpiOsPrintf (
"Cannot read entire Named object at address %p\n",
ObjPtr);
return;
}
Node = ObjPtr;
goto DumpNode;
case ACPI_DESC_TYPE_OPERAND:
/* This is a ACPI OPERAND OBJECT */
if (!AcpiOsReadable (ObjPtr, sizeof (ACPI_OPERAND_OBJECT)))
{
AcpiOsPrintf (
"Cannot read entire ACPI object at address %p\n",
ObjPtr);
return;
}
AcpiUtDebugDumpBuffer (ObjPtr, sizeof (ACPI_OPERAND_OBJECT),
Display, ACPI_UINT32_MAX);
AcpiExDumpObjectDescriptor (ObjPtr, 1);
break;
case ACPI_DESC_TYPE_PARSER:
/* This is a Parser Op object */
if (!AcpiOsReadable (ObjPtr, sizeof (ACPI_PARSE_OBJECT)))
{
AcpiOsPrintf (
"Cannot read entire Parser object at address %p\n",
ObjPtr);
//.........這裏部分代碼省略.........
示例13: EcGpeQueryHandler
static void
EcGpeQueryHandler(void *Context)
{
struct acpi_ec_softc *sc = (struct acpi_ec_softc *)Context;
UINT8 Data;
ACPI_STATUS Status;
int retry, sci_enqueued;
char qxx[5];
ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
KASSERT(Context != NULL, ("EcGpeQueryHandler called with NULL"));
/* Serialize user access with EcSpaceHandler(). */
Status = EcLock(sc);
if (ACPI_FAILURE(Status)) {
device_printf(sc->ec_dev, "GpeQuery lock error: %s\n",
AcpiFormatException(Status));
return;
}
/*
* Send a query command to the EC to find out which _Qxx call it
* wants to make. This command clears the SCI bit and also the
* interrupt source since we are edge-triggered. To prevent the GPE
* that may arise from running the query from causing another query
* to be queued, we clear the pending flag only after running it.
*/
sci_enqueued = sc->ec_sci_pend;
for (retry = 0; retry < 2; retry++) {
Status = EcCommand(sc, EC_COMMAND_QUERY);
if (ACPI_SUCCESS(Status))
break;
if (EcCheckStatus(sc, "retr_check",
EC_EVENT_INPUT_BUFFER_EMPTY) == AE_OK)
continue;
else
break;
}
sc->ec_sci_pend = FALSE;
if (ACPI_FAILURE(Status)) {
EcUnlock(sc);
device_printf(sc->ec_dev, "GPE query failed: %s\n",
AcpiFormatException(Status));
return;
}
Data = EC_GET_DATA(sc);
/*
* We have to unlock before running the _Qxx method below since that
* method may attempt to read/write from EC address space, causing
* recursive acquisition of the lock.
*/
EcUnlock(sc);
/* Ignore the value for "no outstanding event". (13.3.5) */
if (Data == 0)
return;
/* Evaluate _Qxx to respond to the controller. */
ksnprintf(qxx, sizeof(qxx), "_Q%02X", Data);
AcpiUtStrupr(qxx);
Status = AcpiEvaluateObject(sc->ec_handle, qxx, NULL, NULL);
if (ACPI_FAILURE(Status) && Status != AE_NOT_FOUND) {
device_printf(sc->ec_dev, "evaluation of query method %s failed: %s\n",
qxx, AcpiFormatException(Status));
}
/* Reenable runtime GPE if its execution was deferred. */
if (sci_enqueued) {
Status = AcpiFinishGpe(sc->ec_gpehandle, sc->ec_gpebit);
if (ACPI_FAILURE(Status))
device_printf(sc->ec_dev, "reenabling runtime GPE failed: %s\n",
AcpiFormatException(Status));
}
}
示例14: DtCreateTemplates
ACPI_STATUS
DtCreateTemplates (
char *Signature)
{
ACPI_DMTABLE_DATA *TableData;
ACPI_STATUS Status;
AslInitializeGlobals ();
/* Default (no signature) is DSDT */
if (!Signature)
{
Signature = "DSDT";
goto GetTemplate;
}
AcpiUtStrupr (Signature);
if (!ACPI_STRCMP (Signature, "ALL") ||
!ACPI_STRCMP (Signature, "*"))
{
/* Create all available/known templates */
Status = DtCreateAllTemplates ();
return (Status);
}
/*
* Validate signature and get the template data:
* 1) Signature must be 4 characters
* 2) Signature must be a recognized ACPI table
* 3) There must be a template associated with the signature
*/
if (strlen (Signature) != ACPI_NAME_SIZE)
{
fprintf (stderr,
"%s: Invalid ACPI table signature (length must be 4 characters)\n",
Signature);
return (AE_ERROR);
}
/*
* Some slack for the two strange tables whose name is different than
* their signatures: MADT->APIC and FADT->FACP.
*/
if (!strcmp (Signature, "MADT"))
{
Signature = "APIC";
}
else if (!strcmp (Signature, "FADT"))
{
Signature = "FACP";
}
GetTemplate:
TableData = AcpiDmGetTableData (Signature);
if (TableData)
{
if (!TableData->Template)
{
fprintf (stderr, "%4.4s: No template available\n", Signature);
return (AE_ERROR);
}
}
else if (!AcpiUtIsSpecialTable (Signature))
{
fprintf (stderr,
"%4.4s: Unrecognized ACPI table signature\n", Signature);
return (AE_ERROR);
}
Status = AdInitialize ();
if (ACPI_FAILURE (Status))
{
return (Status);
}
Status = DtCreateOneTemplate (Signature, TableData);
return (Status);
}
示例15: AcpiDbDisplayInterfaces
void
AcpiDbDisplayInterfaces (
char *ActionArg,
char *InterfaceNameArg)
{
ACPI_INTERFACE_INFO *NextInterface;
char *SubString;
ACPI_STATUS Status;
/* If no arguments, just display current interface list */
if (!ActionArg)
{
(void) AcpiOsAcquireMutex (AcpiGbl_OsiMutex,
ACPI_WAIT_FOREVER);
NextInterface = AcpiGbl_SupportedInterfaces;
while (NextInterface)
{
if (!(NextInterface->Flags & ACPI_OSI_INVALID))
{
AcpiOsPrintf ("%s\n", NextInterface->Name);
}
NextInterface = NextInterface->Next;
}
AcpiOsReleaseMutex (AcpiGbl_OsiMutex);
return;
}
/* If ActionArg exists, so must InterfaceNameArg */
if (!InterfaceNameArg)
{
AcpiOsPrintf ("Missing Interface Name argument\n");
return;
}
/* Uppercase the action for match below */
AcpiUtStrupr (ActionArg);
/* Install - install an interface */
SubString = ACPI_STRSTR ("INSTALL", ActionArg);
if (SubString)
{
Status = AcpiInstallInterface (InterfaceNameArg);
if (ACPI_FAILURE (Status))
{
AcpiOsPrintf ("%s, while installing \"%s\"\n",
AcpiFormatException (Status), InterfaceNameArg);
}
return;
}
/* Remove - remove an interface */
SubString = ACPI_STRSTR ("REMOVE", ActionArg);
if (SubString)
{
Status = AcpiRemoveInterface (InterfaceNameArg);
if (ACPI_FAILURE (Status))
{
AcpiOsPrintf ("%s, while removing \"%s\"\n",
AcpiFormatException (Status), InterfaceNameArg);
}
return;
}
/* Invalid ActionArg */
AcpiOsPrintf ("Invalid action argument: %s\n", ActionArg);
return;
}