本文整理汇总了C++中AcpiUtStrupr函数的典型用法代码示例。如果您正苦于以下问题:C++ AcpiUtStrupr函数的具体用法?C++ AcpiUtStrupr怎么用?C++ AcpiUtStrupr使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了AcpiUtStrupr函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:fsheikh,项目名称:acpica,代码行数:32,代码来源:dbnames.c
示例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;
}
}
开发者ID:fjdoria76,项目名称:acpica,代码行数:31,代码来源:dbtest.c
示例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);
}
开发者ID:ahs3,项目名称:acpica-tools,代码行数:25,代码来源:aslpld.c
示例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);
}
}
开发者ID:malattia,项目名称:acpica-tools,代码行数:58,代码来源:ahdecode.c
示例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);
}
}
开发者ID:benevo,项目名称:acpica,代码行数:43,代码来源:ahdecode.c
示例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);
}
开发者ID:ahs3,项目名称:acpica-tools,代码行数:40,代码来源:ahasl.c
示例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);
}
}
开发者ID:ahs3,项目名称:acpica-tools,代码行数:36,代码来源:ahasl.c
示例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);
}
开发者ID:iHaD,项目名称:DragonFlyBSD,代码行数:47,代码来源:dbinput.c
示例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);
}
开发者ID:RonnieDilli,项目名称:acpica,代码行数:40,代码来源:dbinput.c
示例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++;
}
}
开发者ID:cloudius-systems,项目名称:acpica,代码行数:39,代码来源:dbutils.c
示例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);
}
}
开发者ID:malattia,项目名称:acpica-tools,代码行数:39,代码来源:ahdecode.c
示例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);
//.........这里部分代码省略.........
开发者ID:iHaD,项目名称:DragonFlyBSD,代码行数:101,代码来源:dbdisply.c
示例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));
}
}
开发者ID:AhmadTux,项目名称:DragonFlyBSD,代码行数:75,代码来源:acpi_ec.c
示例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);
}
开发者ID:99corps,项目名称:runtime,代码行数:81,代码来源:dttemplate.c
示例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;
}
开发者ID:dmarion,项目名称:freebsd-armv6-sys,代码行数:77,代码来源:dbcmds.c
示例16: AcpiDbCommandDispatch
//.........这里部分代码省略.........
case CMD_LIST:
AcpiDbDisassembleAml (AcpiGbl_DbArgs[1], Op);
break;
case CMD_LOCKS:
AcpiDbDisplayLocks ();
break;
case CMD_LOCALS:
AcpiDbDisplayLocals ();
break;
case CMD_METHODS:
Status = AcpiDbDisplayObjects ("METHOD", AcpiGbl_DbArgs[1]);
break;
case CMD_NAMESPACE:
AcpiDbDumpNamespace (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]);
break;
case CMD_NOTIFY:
Temp = strtoul (AcpiGbl_DbArgs[2], NULL, 0);
AcpiDbSendNotify (AcpiGbl_DbArgs[1], Temp);
break;
case CMD_OBJECTS:
AcpiUtStrupr (AcpiGbl_DbArgs[1]);
Status = AcpiDbDisplayObjects (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]);
break;
case CMD_OSI:
AcpiDbDisplayInterfaces (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]);
break;
case CMD_OWNER:
AcpiDbDumpNamespaceByOwner (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]);
break;
case CMD_PATHS:
AcpiDbDumpNamespacePaths ();
break;
case CMD_PREFIX:
AcpiDbSetScope (AcpiGbl_DbArgs[1]);
break;
case CMD_REFERENCES:
AcpiDbFindReferences (AcpiGbl_DbArgs[1]);
break;
case CMD_RESOURCES:
AcpiDbDisplayResources (AcpiGbl_DbArgs[1]);
break;
开发者ID:9elements,项目名称:fwts,代码行数:67,代码来源:dbinput.c
示例17: ApDumpTableByName
int
ApDumpTableByName (
char *Signature)
{
char LocalSignature [ACPI_NAME_SIZE + 1];
UINT32 Instance;
ACPI_TABLE_HEADER *Table;
ACPI_PHYSICAL_ADDRESS Address;
ACPI_STATUS Status;
int TableStatus;
if (strlen (Signature) != ACPI_NAME_SIZE)
{
AcpiLogError (
"Invalid table signature [%s]: must be exactly 4 characters\n",
Signature);
return (-1);
}
/* Table signatures are expected to be uppercase */
strcpy (LocalSignature, Signature);
AcpiUtStrupr (LocalSignature);
/* To be friendly, handle tables whose signatures do not match the name */
if (ACPI_COMPARE_NAME (LocalSignature, "FADT"))
{
strcpy (LocalSignature, ACPI_SIG_FADT);
}
else if (ACPI_COMPARE_NAME (LocalSignature, "MADT"))
{
strcpy (LocalSignature, ACPI_SIG_MADT);
}
/* Dump all instances of this signature (to handle multiple SSDTs) */
for (Instance = 0; Instance < AP_MAX_ACPI_FILES; Instance++)
{
Status = AcpiOsGetTableByName (LocalSignature, Instance,
&Table, &Address);
if (ACPI_FAILURE (Status))
{
/* AE_LIMIT means that no more tables are available */
if (Status == AE_LIMIT)
{
return (0);
}
AcpiLogError (
"Could not get ACPI table with signature [%s], %s\n",
LocalSignature, AcpiFormatException (Status));
return (-1);
}
TableStatus = ApDumpTableBuffer (Table, Instance, Address);
ACPI_FREE (Table);
if (TableStatus)
{
break;
}
}
/* Something seriously bad happened if the loop terminates here */
return (-1);
}
开发者ID:bininc,项目名称:acpica,代码行数:70,代码来源:apdump.c
示例18: AcpiDbCommandDispatch
//.........这里部分代码省略.........
}
break;
case CMD_LIST:
AcpiDbDisassembleAml (AcpiGbl_DbArgs[1], Op);
break;
case CMD_LOAD:
Status = AcpiDbGetTableFromFile (AcpiGbl_DbArgs[1], NULL);
break;
case CMD_LOCKS:
AcpiDbDisplayLocks ();
break;
case CMD_LOCALS:
AcpiDbDisplayLocals ();
break;
case CMD_METHODS:
Status = AcpiDbDisplayObjects ("METHOD", AcpiGbl_DbArgs[1]);
break;
case CMD_NAMESPACE:
AcpiDbDumpNamespace (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]);
break;
case CMD_NOTIFY:
Temp = ACPI_STRTOUL (AcpiGbl_DbArgs[2], NULL, 0);
AcpiDbSendNotify (AcpiGbl_DbArgs[1], Temp);
break;
case CMD_OBJECT:
AcpiUtStrupr (AcpiGbl_DbArgs[1]);
Status = AcpiDbDisplayObjects (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]);
break;
case CMD_OPEN:
AcpiDbOpenDebugFile (AcpiGbl_DbArgs[1]);
break;
case CMD_OWNER:
AcpiDbDumpNamespaceByOwner (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]);
break;
case CMD_PREFIX:
AcpiDbSetScope (AcpiGbl_DbArgs[1]);
break;
case CMD_REFERENCES:
AcpiDbFindReferences (AcpiGbl_DbArgs[1]);
break;
case CMD_RESOURCES:
AcpiDbDisplayResources (AcpiGbl_DbArgs[1]);
break;
case CMD_RESULTS:
AcpiDbDisplayResults ();
break;
case CMD_SET:
AcpiDbSetMethodData (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2],
AcpiGbl_DbArgs[3]);
break;
开发者ID:oza,项目名称:FreeBSD-7.3-dyntick,代码行数:66,代码来源:dbinput.c
示例19: AbExtractAmlFile
int
AbExtractAmlFile (
char *TableSig,
char *File1Path,
char *File2Path)
{
char *Table;
char Value;
UINT32 i;
FILE *FileHandle;
FILE *FileOutHandle;
UINT32 Count = 0;
int Scanned;
/* Open in/out files. input is in text mode, output is in binary mode */
FileHandle = fopen (File1Path, "rt");
if (!FileHandle)
{
printf ("Could not open %s\n", File1Path);
return -1;
}
FileOutHandle = fopen (File2Path, "w+b");
if (!FileOutHandle)
{
printf ("Could not open %s\n", File2Path);
return -1;
}
/* Force input table sig to uppercase */
AcpiUtStrupr (TableSig);
/* TBD: examine input for ASCII */
/* We have an ascii file, grab one line at a time */
while (fgets (Buffer, BUFFER_SIZE, FileHandle))
{
/* The 4-char ACPI signature appears at the beginning of a line */
if (!strncmp (Buffer, TableSig, 4))
{
printf ("Found table [%4.4s]\n", TableSig);
/*
* Eat all lines in the table, of the form:
* <offset>: <16 bytes of hex data, separated by spaces> <ASCII representation> <newline>
*
* Example:
*
* 02C0: 5F 53 42 5F 4C 4E 4B 44 00 12 13 04 0C FF FF 08 _SB_LNKD........
*
*/
while (fgets (Buffer, BUFFER_SIZE, FileHandle))
{
/* Get past the offset, terminated by a colon */
Table = strchr (Buffer, ':');
if (!Table)
{
/* No colon, all done */
goto Exit;
}
Table += 2; /* Eat the colon + space */
for (i = 0; i < 16; i++)
{
Scanned = AbHexByteToBinary (Table, &Value);
if (!Scanned)
{
goto Exit;
}
Table += 3; /* Go past this hex byte and space */
/* Write the converted (binary) byte */
fwrite (&Value, 1, 1, FileOutHandle);
Count++;
}
}
/* No more lines, EOF, all done */
goto Exit;
}
}
/* Searched entire file, no match to table signature */
printf ("Could not match table signature\n");
fclose (FileHandle);
return -1;
//.........这里部分代码省略.........
开发者ID:minggr,项目名称:acpica,代码行数:101,代码来源:abcompare.c
示例20: AcpiDbTrace
void
AcpiDbTrace (
char *EnableArg,
char *MethodArg,
char *OnceArg)
{
UINT32 DebugLevel = 0;
UINT32 DebugLayer = 0;
UINT32 Flags = 0;
if (EnableArg)
{
AcpiUtStrupr (EnableArg);
}
if (OnceArg)
{
AcpiUtStrupr (OnceArg);
}
if (MethodArg)
{
if (AcpiDbTraceMethodName)
{
ACPI_FREE (AcpiDbTraceMethodName);
AcpiDbTraceMethodName = NULL;
}
AcpiDbTraceMethodName = ACPI_ALLOCATE (strlen (MethodArg) + 1);
if (!AcpiDbTraceMethodName)
{
AcpiOsPrintf ("Failed to allocate method name (%s)\n",
MethodArg);
return;
}
strcpy (AcpiDbTraceMethodName, MethodArg);
}
if (!strcmp (EnableArg, "ENABLE") ||
!strcmp (EnableArg, "METHOD") ||
!strcmp (EnableArg, "OPCODE"))
{
if (!strcmp (EnableArg, "ENABLE"))
{
/* Inherit current console settings */
DebugLevel = AcpiGbl_DbConsoleDebugLevel;
DebugLayer = AcpiDbgLayer;
}
else
{
/* Restrict console output to trace points only */
DebugLevel = ACPI_LV_TRACE_POINT;
DebugLayer = ACPI_EXECUTER;
}
Flags = ACPI_TRACE_ENABLED;
if (!strcmp (EnableArg, "OPCODE"))
{
Flags |= ACPI_TRACE_OPCODE;
}
if (OnceArg && !strcmp (OnceArg, "ONCE"))
{
Flags |= ACPI_TRACE_ONESHOT;
}
}
(void) AcpiDebugTrace (AcpiDbTraceMethodName,
DebugLevel, DebugLayer, Flags);
}
开发者ID:iHaD,项目名称:DragonFlyBSD,代码行数:75,代码来源:dbcmds.c
注:本文中的AcpiUtStrupr函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论