本文整理汇总了C++中ACPI_PTR_DIFF函数的典型用法代码示例。如果您正苦于以下问题:C++ ACPI_PTR_DIFF函数的具体用法?C++ ACPI_PTR_DIFF怎么用?C++ ACPI_PTR_DIFF使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ACPI_PTR_DIFF函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: AcpiExConcatTemplate
ACPI_STATUS
AcpiExConcatTemplate (
ACPI_OPERAND_OBJECT *ObjDesc1,
ACPI_OPERAND_OBJECT *ObjDesc2,
ACPI_OPERAND_OBJECT **ActualReturnDesc,
ACPI_WALK_STATE *WalkState)
{
ACPI_OPERAND_OBJECT *ReturnDesc;
UINT8 *NewBuf;
UINT8 *EndTag1;
UINT8 *EndTag2;
ACPI_SIZE Length1;
ACPI_SIZE Length2;
ACPI_FUNCTION_TRACE ("ExConcatTemplate");
/* Find the EndTags in each resource template */
EndTag1 = AcpiUtGetResourceEndTag (ObjDesc1);
EndTag2 = AcpiUtGetResourceEndTag (ObjDesc2);
if (!EndTag1 || !EndTag2)
{
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
}
/* Compute the length of each part */
Length1 = ACPI_PTR_DIFF (EndTag1, ObjDesc1->Buffer.Pointer);
Length2 = ACPI_PTR_DIFF (EndTag2, ObjDesc2->Buffer.Pointer) +
2; /* Size of END_TAG */
/* Create a new buffer object for the result */
ReturnDesc = AcpiUtCreateBufferObject (Length1 + Length2);
if (!ReturnDesc)
{
return_ACPI_STATUS (AE_NO_MEMORY);
}
/* Copy the templates to the new descriptor */
NewBuf = ReturnDesc->Buffer.Pointer;
ACPI_MEMCPY (NewBuf, ObjDesc1->Buffer.Pointer, Length1);
ACPI_MEMCPY (NewBuf + Length1, ObjDesc2->Buffer.Pointer, Length2);
/* Compute the new checksum */
NewBuf[ReturnDesc->Buffer.Length - 1] =
AcpiUtGenerateChecksum (ReturnDesc->Buffer.Pointer,
(ReturnDesc->Buffer.Length - 1));
/* Return the completed template descriptor */
*ActualReturnDesc = ReturnDesc;
return_ACPI_STATUS (AE_OK);
}
开发者ID:UnitedMarsupials,项目名称:kame,代码行数:58,代码来源:exmisc.c
示例2: acpi_ex_concat_template
acpi_status
acpi_ex_concat_template (
union acpi_operand_object *obj_desc1,
union acpi_operand_object *obj_desc2,
union acpi_operand_object **actual_return_desc,
struct acpi_walk_state *walk_state)
{
union acpi_operand_object *return_desc;
u8 *new_buf;
u8 *end_tag1;
u8 *end_tag2;
acpi_size length1;
acpi_size length2;
ACPI_FUNCTION_TRACE ("ex_concat_template");
/* Find the end_tags in each resource template */
end_tag1 = acpi_ut_get_resource_end_tag (obj_desc1);
end_tag2 = acpi_ut_get_resource_end_tag (obj_desc2);
if (!end_tag1 || !end_tag2) {
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
}
/* Compute the length of each part */
length1 = ACPI_PTR_DIFF (end_tag1, obj_desc1->buffer.pointer);
length2 = ACPI_PTR_DIFF (end_tag2, obj_desc2->buffer.pointer) +
2; /* Size of END_TAG */
/* Create a new buffer object for the result */
return_desc = acpi_ut_create_buffer_object (length1 + length2);
if (!return_desc) {
return_ACPI_STATUS (AE_NO_MEMORY);
}
/* Copy the templates to the new descriptor */
new_buf = return_desc->buffer.pointer;
ACPI_MEMCPY (new_buf, obj_desc1->buffer.pointer, length1);
ACPI_MEMCPY (new_buf + length1, obj_desc2->buffer.pointer, length2);
/* Compute the new checksum */
new_buf[return_desc->buffer.length - 1] =
acpi_ut_generate_checksum (return_desc->buffer.pointer,
(return_desc->buffer.length - 1));
/* Return the completed template descriptor */
*actual_return_desc = return_desc;
return_ACPI_STATUS (AE_OK);
}
开发者ID:BackupTheBerlios,项目名称:tuxap,代码行数:56,代码来源:exmisc.c
示例3: acpi_pptt_leaf_node
/**
* acpi_pptt_leaf_node() - Given a processor node, determine if its a leaf
* @table_hdr: Pointer to the head of the PPTT table
* @node: passed node is checked to see if its a leaf
*
* Determine if the *node parameter is a leaf node by iterating the
* PPTT table, looking for nodes which reference it.
*
* Return: 0 if we find a node referencing the passed node (or table error),
* or 1 if we don't.
*/
static int acpi_pptt_leaf_node(struct acpi_table_header *table_hdr,
struct acpi_pptt_processor *node)
{
struct acpi_subtable_header *entry;
unsigned long table_end;
u32 node_entry;
struct acpi_pptt_processor *cpu_node;
u32 proc_sz;
if (table_hdr->revision > 1)
return (node->flags & ACPI_PPTT_ACPI_LEAF_NODE);
table_end = (unsigned long)table_hdr + table_hdr->length;
node_entry = ACPI_PTR_DIFF(node, table_hdr);
entry = ACPI_ADD_PTR(struct acpi_subtable_header, table_hdr,
sizeof(struct acpi_table_pptt));
proc_sz = sizeof(struct acpi_pptt_processor *);
while ((unsigned long)entry + proc_sz < table_end) {
cpu_node = (struct acpi_pptt_processor *)entry;
if (entry->type == ACPI_PPTT_TYPE_PROCESSOR &&
cpu_node->parent == node_entry)
return 0;
if (entry->length == 0)
return 0;
entry = ACPI_ADD_PTR(struct acpi_subtable_header, entry,
entry->length);
}
return 1;
}
开发者ID:avagin,项目名称:linux,代码行数:42,代码来源:pptt.c
示例4: topology_get_acpi_cpu_tag
/**
* topology_get_acpi_cpu_tag() - Find a unique topology value for a feature
* @table: Pointer to the head of the PPTT table
* @cpu: Kernel logical CPU number
* @level: A level that terminates the search
* @flag: A flag which terminates the search
*
* Get a unique value given a CPU, and a topology level, that can be
* matched to determine which cpus share common topological features
* at that level.
*
* Return: Unique value, or -ENOENT if unable to locate CPU
*/
static int topology_get_acpi_cpu_tag(struct acpi_table_header *table,
unsigned int cpu, int level, int flag)
{
struct acpi_pptt_processor *cpu_node;
u32 acpi_cpu_id = get_acpi_id_for_cpu(cpu);
cpu_node = acpi_find_processor_node(table, acpi_cpu_id);
if (cpu_node) {
cpu_node = acpi_find_processor_package_id(table, cpu_node,
level, flag);
/*
* As per specification if the processor structure represents
* an actual processor, then ACPI processor ID must be valid.
* For processor containers ACPI_PPTT_ACPI_PROCESSOR_ID_VALID
* should be set if the UID is valid
*/
if (level == 0 ||
cpu_node->flags & ACPI_PPTT_ACPI_PROCESSOR_ID_VALID)
return cpu_node->acpi_processor_id;
return ACPI_PTR_DIFF(cpu_node, table);
}
pr_warn_once("PPTT table found, but unable to locate core %d (%d)\n",
cpu, acpi_cpu_id);
return -ENOENT;
}
开发者ID:avagin,项目名称:linux,代码行数:38,代码来源:pptt.c
示例5: AcpiDbSetMethodBreakpoint
void
AcpiDbSetMethodBreakpoint (
char *Location,
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *Op)
{
UINT32 Address;
UINT32 AmlOffset;
if (!Op)
{
AcpiOsPrintf ("There is no method currently executing\n");
return;
}
/* Get and verify the breakpoint address */
Address = strtoul (Location, NULL, 16);
AmlOffset = (UINT32) ACPI_PTR_DIFF (Op->Common.Aml,
WalkState->ParserState.AmlStart);
if (Address <= AmlOffset)
{
AcpiOsPrintf ("Breakpoint %X is beyond current address %X\n",
Address, AmlOffset);
}
/* Save breakpoint in current walk */
WalkState->UserBreakpoint = Address;
AcpiOsPrintf ("Breakpoint set at AML offset %X\n", Address);
}
开发者ID:iHaD,项目名称:DragonFlyBSD,代码行数:32,代码来源:dbmethod.c
示例6: find_acpi_cpu_cache_topology
/**
* find_acpi_cpu_cache_topology() - Determine a unique cache topology value
* @cpu: Kernel logical CPU number
* @level: The cache level for which we would like a unique ID
*
* Determine a unique ID for each unified cache in the system
*
* Return: -ENOENT if the PPTT doesn't exist, or the CPU cannot be found.
* Otherwise returns a value which represents a unique topological feature.
*/
int find_acpi_cpu_cache_topology(unsigned int cpu, int level)
{
struct acpi_table_header *table;
struct acpi_pptt_cache *found_cache;
acpi_status status;
u32 acpi_cpu_id = get_acpi_id_for_cpu(cpu);
struct acpi_pptt_processor *cpu_node = NULL;
int ret = -1;
status = acpi_get_table(ACPI_SIG_PPTT, 0, &table);
if (ACPI_FAILURE(status)) {
acpi_pptt_warn_missing();
return -ENOENT;
}
found_cache = acpi_find_cache_node(table, acpi_cpu_id,
CACHE_TYPE_UNIFIED,
level,
&cpu_node);
if (found_cache)
ret = ACPI_PTR_DIFF(cpu_node, table);
acpi_put_table(table);
return ret;
}
开发者ID:avagin,项目名称:linux,代码行数:36,代码来源:pptt.c
示例7: AcpiRsVendorStream
ACPI_STATUS
AcpiRsVendorStream (
ACPI_RESOURCE *LinkedList,
UINT8 **OutputBuffer,
ACPI_SIZE *BytesConsumed)
{
UINT8 *Buffer = *OutputBuffer;
UINT16 Temp16 = 0;
UINT8 Temp8 = 0;
UINT8 Index;
ACPI_FUNCTION_TRACE ("RsVendorStream");
/*
* Dereference the length to find if this is a large or small item.
*/
if(LinkedList->Data.VendorSpecific.Length > 7)
{
/*
* Large Item, Set the descriptor field and length bytes
*/
*Buffer = 0x84;
Buffer += 1;
Temp16 = (UINT16) LinkedList->Data.VendorSpecific.Length;
ACPI_MOVE_UNALIGNED16_TO_16 (Buffer, &Temp16);
Buffer += 2;
}
else
{
/*
* Small Item, Set the descriptor field
*/
Temp8 = 0x70;
Temp8 |= (UINT8) LinkedList->Data.VendorSpecific.Length;
*Buffer = Temp8;
Buffer += 1;
}
/*
* Loop through all of the Vendor Specific fields
*/
for (Index = 0; Index < LinkedList->Data.VendorSpecific.Length; Index++)
{
Temp8 = LinkedList->Data.VendorSpecific.Reserved[Index];
*Buffer = Temp8;
Buffer += 1;
}
/*
* Return the number of bytes consumed in this operation
*/
*BytesConsumed = ACPI_PTR_DIFF (Buffer, *OutputBuffer);
return_ACPI_STATUS (AE_OK);
}
开发者ID:UnitedMarsupials,项目名称:kame,代码行数:60,代码来源:rsmisc.c
示例8: AcpiRsEndTagStream
ACPI_STATUS
AcpiRsEndTagStream (
ACPI_RESOURCE *LinkedList,
UINT8 **OutputBuffer,
ACPI_SIZE *BytesConsumed)
{
UINT8 *Buffer = *OutputBuffer;
UINT8 Temp8 = 0;
ACPI_FUNCTION_TRACE ("RsEndTagStream");
/*
* The descriptor field is static
*/
*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)
*/
Temp8 = 0;
*Buffer = Temp8;
Buffer += 1;
/*
* Return the number of bytes consumed in this operation
*/
*BytesConsumed = ACPI_PTR_DIFF (Buffer, *OutputBuffer);
return_ACPI_STATUS (AE_OK);
}
开发者ID:UnitedMarsupials,项目名称:kame,代码行数:34,代码来源:rsmisc.c
示例9: AcpiPsGetAmlOpcode
static ACPI_STATUS
AcpiPsGetAmlOpcode (
ACPI_WALK_STATE *WalkState)
{
ACPI_FUNCTION_TRACE_PTR (PsGetAmlOpcode, WalkState);
WalkState->AmlOffset = (UINT32) ACPI_PTR_DIFF (WalkState->ParserState.Aml,
WalkState->ParserState.AmlStart);
WalkState->Opcode = AcpiPsPeekOpcode (&(WalkState->ParserState));
/*
* First cut to determine what we have found:
* 1) A valid AML opcode
* 2) A name string
* 3) An unknown/invalid opcode
*/
WalkState->OpInfo = AcpiPsGetOpcodeInfo (WalkState->Opcode);
switch (WalkState->OpInfo->Class)
{
case AML_CLASS_ASCII:
case AML_CLASS_PREFIX:
/*
* Starts with a valid prefix or ASCII char, this is a name
* string. Convert the bare name string to a namepath.
*/
WalkState->Opcode = AML_INT_NAMEPATH_OP;
WalkState->ArgTypes = ARGP_NAMESTRING;
break;
case AML_CLASS_UNKNOWN:
/* The opcode is unrecognized. Just skip unknown opcodes */
ACPI_ERROR ((AE_INFO,
"Found unknown opcode 0x%X at AML address %p offset 0x%X, ignoring",
WalkState->Opcode, WalkState->ParserState.Aml, WalkState->AmlOffset));
ACPI_DUMP_BUFFER (WalkState->ParserState.Aml, 128);
/* Assume one-byte bad opcode */
WalkState->ParserState.Aml++;
return_ACPI_STATUS (AE_CTRL_PARSE_CONTINUE);
default:
/* Found opcode info, this is a normal opcode */
WalkState->ParserState.Aml += AcpiPsGetOpcodeSize (WalkState->Opcode);
WalkState->ArgTypes = WalkState->OpInfo->ParseArgs;
break;
}
return_ACPI_STATUS (AE_OK);
}
开发者ID:AgamAgarwal,项目名称:minix,代码行数:58,代码来源:psloop.c
示例10: AcpiUtInitStackPtrTrace
void
AcpiUtInitStackPtrTrace (
void)
{
UINT32 CurrentSp;
AcpiGbl_EntryStackPointer = ACPI_PTR_DIFF (&CurrentSp, NULL);
}
开发者ID:andreiw,项目名称:polaris,代码行数:9,代码来源:utdebug.c
示例11: acpi_ut_init_stack_ptr_trace
void
acpi_ut_init_stack_ptr_trace (
void)
{
u32 current_sp;
acpi_gbl_entry_stack_pointer = ACPI_PTR_DIFF (¤t_sp, NULL);
}
开发者ID:kzlin129,项目名称:tt-gpl,代码行数:9,代码来源:utdebug.c
示例12: AcpiDsMethodError
ACPI_STATUS
AcpiDsMethodError (
ACPI_STATUS Status,
ACPI_WALK_STATE *WalkState)
{
UINT32 AmlOffset;
ACPI_FUNCTION_ENTRY ();
/* Ignore AE_OK and control exception codes */
if (ACPI_SUCCESS (Status) ||
(Status & AE_CODE_CONTROL))
{
return (Status);
}
/* Invoke the global exception handler */
if (AcpiGbl_ExceptionHandler)
{
/* Exit the interpreter, allow handler to execute methods */
AcpiExExitInterpreter ();
/*
* Handler can map the exception code to anything it wants, including
* AE_OK, in which case the executing method will not be aborted.
*/
AmlOffset = (UINT32) ACPI_PTR_DIFF (WalkState->Aml,
WalkState->ParserState.AmlStart);
Status = AcpiGbl_ExceptionHandler (Status,
WalkState->MethodNode ?
WalkState->MethodNode->Name.Integer : 0,
WalkState->Opcode, AmlOffset, NULL);
AcpiExEnterInterpreter ();
}
AcpiDsClearImplicitReturn (WalkState);
if (ACPI_FAILURE (Status))
{
AcpiDsDumpMethodStack (Status, WalkState, WalkState->Op);
/* Display method locals/args if debugger is present */
#ifdef ACPI_DEBUGGER
AcpiDbDumpMethodInfo (Status, WalkState);
#endif
}
return (Status);
}
开发者ID:jaredmcneill,项目名称:freebsd,代码行数:56,代码来源:dsmethod.c
示例13: acpi_ds_method_error
acpi_status
acpi_ds_method_error(acpi_status status, struct acpi_walk_state *walk_state)
{
u32 aml_offset;
acpi_name name = 0;
ACPI_FUNCTION_ENTRY();
/* Ignore AE_OK and control exception codes */
if (ACPI_SUCCESS(status) || (status & AE_CODE_CONTROL)) {
return (status);
}
/* Invoke the global exception handler */
if (acpi_gbl_exception_handler) {
/* Exit the interpreter, allow handler to execute methods */
acpi_ex_exit_interpreter();
/*
* Handler can map the exception code to anything it wants, including
* AE_OK, in which case the executing method will not be aborted.
*/
aml_offset = (u32)ACPI_PTR_DIFF(walk_state->aml,
walk_state->parser_state.
aml_start);
if (walk_state->method_node) {
name = walk_state->method_node->name.integer;
} else if (walk_state->deferred_node) {
name = walk_state->deferred_node->name.integer;
}
status = acpi_gbl_exception_handler(status, name,
walk_state->opcode,
aml_offset, NULL);
acpi_ex_enter_interpreter();
}
acpi_ds_clear_implicit_return(walk_state);
if (ACPI_FAILURE(status)) {
acpi_ds_dump_method_stack(status, walk_state, walk_state->op);
/* Display method locals/args if debugger is present */
#ifdef ACPI_DEBUGGER
acpi_db_dump_method_info(status, walk_state);
#endif
}
return (status);
}
开发者ID:AlexShiLucky,项目名称:linux,代码行数:56,代码来源:dsmethod.c
示例14: acpi_rs_fixed_memory32_stream
acpi_status
acpi_rs_fixed_memory32_stream (
struct acpi_resource *linked_list,
u8 **output_buffer,
acpi_size *bytes_consumed)
{
u8 *buffer = *output_buffer;
u16 temp16 = 0;
u8 temp8 = 0;
ACPI_FUNCTION_TRACE ("rs_fixed_memory32_stream");
/*
* 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 = (u8) (linked_list->data.fixed_memory32.read_write_attribute & 0x01);
*buffer = temp8;
buffer += 1;
/*
* Set the Range base address
*/
ACPI_MOVE_32_TO_32 (buffer,
&linked_list->data.fixed_memory32.range_base_address);
buffer += 4;
/*
* Set the range length
*/
ACPI_MOVE_32_TO_32 (buffer,
&linked_list->data.fixed_memory32.range_length);
buffer += 4;
/*
* Return the number of bytes consumed in this operation
*/
*bytes_consumed = ACPI_PTR_DIFF (buffer, *output_buffer);
return_ACPI_STATUS (AE_OK);
}
开发者ID:Brainiarc7,项目名称:ralink_sdk,代码行数:55,代码来源:rsmemory.c
示例15: acpi_ut_track_stack_ptr
void acpi_ut_track_stack_ptr(void)
{
acpi_size current_sp;
current_sp = ACPI_PTR_DIFF(¤t_sp, NULL);
if (current_sp < acpi_gbl_lowest_stack_pointer) {
acpi_gbl_lowest_stack_pointer = current_sp;
}
if (acpi_gbl_nesting_level > acpi_gbl_deepest_nesting) {
acpi_gbl_deepest_nesting = acpi_gbl_nesting_level;
}
}
开发者ID:BackupTheBerlios,项目名称:tew632-brp-svn,代码行数:14,代码来源:utdebug.c
示例16: AcpiUtTrackStackPtr
void
AcpiUtTrackStackPtr (
void)
{
ACPI_SIZE CurrentSp;
CurrentSp = ACPI_PTR_DIFF (&CurrentSp, NULL);
if (CurrentSp < AcpiGbl_LowestStackPointer)
{
AcpiGbl_LowestStackPointer = CurrentSp;
}
if (AcpiGbl_NestingLevel > AcpiGbl_DeepestNesting)
{
AcpiGbl_DeepestNesting = AcpiGbl_NestingLevel;
}
}
开发者ID:andreiw,项目名称:polaris,代码行数:19,代码来源:utdebug.c
示例17: AcpiUtFormatNumber
static char *
AcpiUtFormatNumber (
char *String,
char *End,
UINT64 Number,
UINT8 Base,
INT32 Width,
INT32 Precision,
UINT8 Type)
{
char *Pos;
char Sign;
char Zero;
BOOLEAN NeedPrefix;
BOOLEAN Upper;
INT32 i;
char ReversedString[66];
/* Parameter validation */
if (Base < 2 || Base > 16)
{
return (NULL);
}
if (Type & ACPI_FORMAT_LEFT)
{
Type &= ~ACPI_FORMAT_ZERO;
}
NeedPrefix = ((Type & ACPI_FORMAT_PREFIX) && Base != 10) ? TRUE : FALSE;
Upper = (Type & ACPI_FORMAT_UPPER) ? TRUE : FALSE;
Zero = (Type & ACPI_FORMAT_ZERO) ? '0' : ' ';
/* Calculate size according to sign and prefix */
Sign = '\0';
if (Type & ACPI_FORMAT_SIGN)
{
if ((INT64) Number < 0)
{
Sign = '-';
Number = - (INT64) Number;
Width--;
}
else if (Type & ACPI_FORMAT_SIGN_PLUS)
{
Sign = '+';
Width--;
}
else if (Type & ACPI_FORMAT_SIGN_PLUS_SPACE)
{
Sign = ' ';
Width--;
}
}
if (NeedPrefix)
{
Width--;
if (Base == 16)
{
Width--;
}
}
/* Generate full string in reverse order */
Pos = AcpiUtPutNumber (ReversedString, Number, Base, Upper);
i = ACPI_PTR_DIFF (Pos, ReversedString);
/* Printing 100 using %2d gives "100", not "00" */
if (i > Precision)
{
Precision = i;
}
Width -= Precision;
/* Output the string */
if (!(Type & (ACPI_FORMAT_ZERO | ACPI_FORMAT_LEFT)))
{
while (--Width >= 0)
{
String = AcpiUtBoundStringOutput (String, End, ' ');
}
}
if (Sign)
{
String = AcpiUtBoundStringOutput (String, End, Sign);
}
if (NeedPrefix)
{
String = AcpiUtBoundStringOutput (String, End, '0');
if (Base == 16)
{
String = AcpiUtBoundStringOutput (String, End,
Upper ? 'X' : 'x');
//.........这里部分代码省略.........
开发者ID:JasonFord53,项目名称:freebsd,代码行数:101,代码来源:utprint.c
示例18: AeBuildLocalTables
//.........这里部分代码省略.........
if (!DsdtAddress)
{
/* Use the local DSDT because incoming table(s) are all SSDT(s) */
DsdtAddress = ACPI_PTR_TO_PHYSADDR (LocalDsdtCode);
DsdtToInstallOverride = ACPI_CAST_PTR (ACPI_TABLE_HEADER, LocalDsdtCode);
}
/*
* Build an FADT. There are three options for the FADT:
* 1) Incoming external FADT specified on the command line
* 2) A "hardware reduced" local FADT
* 3) A fully featured local FADT
*/
memset (&LocalFADT, 0, sizeof (ACPI_TABLE_FADT));
if (ExternalFadt)
{
/*
* Use the external FADT, but we must update the DSDT/FACS
* addresses as well as the checksum
*/
ExternalFadt->Dsdt = (UINT32) DsdtAddress;
if (!AcpiGbl_ReducedHardware)
{
ExternalFadt->Facs = ACPI_PTR_TO_PHYSADDR (&LocalFACS);
}
/*
* If there room in the FADT for the XDsdt and XFacs 64-bit
* pointers, use them.
*/
if (ExternalFadt->Header.Length > ACPI_PTR_DIFF (
&ExternalFadt->XDsdt, ExternalFadt))
{
ExternalFadt->Dsdt = 0;
ExternalFadt->Facs = 0;
ExternalFadt->XDsdt = DsdtAddress;
if (!AcpiGbl_ReducedHardware)
{
ExternalFadt->XFacs = ACPI_PTR_TO_PHYSADDR (&LocalFACS);
}
}
/* Complete the external FADT with the checksum */
ExternalFadt->Header.Checksum = 0;
ExternalFadt->Header.Checksum = (UINT8) -AcpiTbChecksum (
(void *) ExternalFadt, ExternalFadt->Header.Length);
}
else if (AcpiGbl_UseHwReducedFadt)
{
memcpy (&LocalFADT, HwReducedFadtCode, ACPI_FADT_V5_SIZE);
LocalFADT.Dsdt = 0;
LocalFADT.XDsdt = DsdtAddress;
}
else
{
/*
* Build a local FADT so we can test the hardware/event init
*/
LocalFADT.Header.Revision = 5;
/* Setup FADT header and DSDT/FACS addresses */
开发者ID:BarrelfishOS,项目名称:barrelfish,代码行数:67,代码来源:aetables.c
示例19: AcpiDbDisplayStatistics
//.........这里部分代码省略.........
AcpiGbl_NumNodes, AcpiGbl_NumObjects);
break;
case CMD_STAT_MEMORY:
#ifdef ACPI_DBG_TRACK_ALLOCATIONS
AcpiOsPrintf ("\n----Object Statistics (all in hex)---------\n");
AcpiDbListInfo (AcpiGbl_GlobalList);
AcpiDbListInfo (AcpiGbl_NsNodeList);
#endif
#ifdef ACPI_USE_LOCAL_CACHE
AcpiOsPrintf ("\n----Cache Statistics (all in hex)---------\n");
AcpiDbListInfo (AcpiGbl_OperandCache);
AcpiDbListInfo (AcpiGbl_PsNodeCache);
AcpiDbListInfo (AcpiGbl_PsNodeExtCache);
AcpiDbListInfo (AcpiGbl_StateCache);
#endif
break;
case CMD_STAT_MISC:
AcpiOsPrintf ("\nMiscellaneous Statistics:\n\n");
AcpiOsPrintf ("Calls to AcpiPsFind:.. ........% 7ld\n",
AcpiGbl_PsFindCount);
AcpiOsPrintf ("Calls to AcpiNsLookup:..........% 7ld\n",
AcpiGbl_NsLookupCount);
AcpiOsPrintf ("\n");
AcpiOsPrintf ("Mutex usage:\n\n");
for (i = 0; i < ACPI_NUM_MUTEX; i++)
{
AcpiOsPrintf ("%-28s: % 7ld\n",
AcpiUtGetMutexName (i), AcpiGbl_MutexInfo[i].UseCount);
}
break;
case CMD_STAT_SIZES:
AcpiOsPrintf ("\nInternal object sizes:\n\n");
AcpiOsPrintf ("Common %3d\n", sizeof (ACPI_OBJECT_COMMON));
AcpiOsPrintf ("Number %3d\n", sizeof (ACPI_OBJECT_INTEGER));
AcpiOsPrintf ("String %3d\n", sizeof (ACPI_OBJECT_STRING));
AcpiOsPrintf ("Buffer %3d\n", sizeof (ACPI_OBJECT_BUFFER));
AcpiOsPrintf ("Package %3d\n", sizeof (ACPI_OBJECT_PACKAGE));
AcpiOsPrintf ("BufferField %3d\n", sizeof (ACPI_OBJECT_BUFFER_FIELD));
AcpiOsPrintf ("Device %3d\n", sizeof (ACPI_OBJECT_DEVICE));
AcpiOsPrintf ("Event %3d\n", sizeof (ACPI_OBJECT_EVENT));
AcpiOsPrintf ("Method %3d\n", sizeof (ACPI_OBJECT_METHOD));
AcpiOsPrintf ("Mutex %3d\n", sizeof (ACPI_OBJECT_MUTEX));
AcpiOsPrintf ("Region %3d\n", sizeof (ACPI_OBJECT_REGION));
AcpiOsPrintf ("PowerResource %3d\n", sizeof (ACPI_OBJECT_POWER_RESOURCE));
AcpiOsPrintf ("Processor %3d\n", sizeof (ACPI_OBJECT_PROCESSOR));
AcpiOsPrintf ("ThermalZone %3d\n", sizeof (ACPI_OBJECT_THERMAL_ZONE));
AcpiOsPrintf ("RegionField %3d\n", sizeof (ACPI_OBJECT_REGION_FIELD));
AcpiOsPrintf ("BankField %3d\n", sizeof (ACPI_OBJECT_BANK_FIELD));
AcpiOsPrintf ("IndexField %3d\n", sizeof (ACPI_OBJECT_INDEX_FIELD));
AcpiOsPrintf ("Reference %3d\n", sizeof (ACPI_OBJECT_REFERENCE));
AcpiOsPrintf ("Notify %3d\n", sizeof (ACPI_OBJECT_NOTIFY_HANDLER));
AcpiOsPrintf ("AddressSpace %3d\n", sizeof (ACPI_OBJECT_ADDR_HANDLER));
AcpiOsPrintf ("Extra %3d\n", sizeof (ACPI_OBJECT_EXTRA));
AcpiOsPrintf ("Data %3d\n", sizeof (ACPI_OBJECT_DATA));
AcpiOsPrintf ("\n");
AcpiOsPrintf ("ParseObject %3d\n", sizeof (ACPI_PARSE_OBJ_COMMON));
AcpiOsPrintf ("ParseObjectNamed %3d\n", sizeof (ACPI_PARSE_OBJ_NAMED));
AcpiOsPrintf ("ParseObjectAsl %3d\n", sizeof (ACPI_PARSE_OBJ_ASL));
AcpiOsPrintf ("OperandObject %3d\n", sizeof (ACPI_OPERAND_OBJECT));
AcpiOsPrintf ("NamespaceNode %3d\n", sizeof (ACPI_NAMESPACE_NODE));
AcpiOsPrintf ("AcpiObject %3d\n", sizeof (ACPI_OBJECT));
break;
case CMD_STAT_STACK:
#if defined(ACPI_DEBUG_OUTPUT)
Temp = (UINT32) ACPI_PTR_DIFF (AcpiGbl_EntryStackPointer, AcpiGbl_LowestStackPointer);
AcpiOsPrintf ("\nSubsystem Stack Usage:\n\n");
AcpiOsPrintf ("Entry Stack Pointer %p\n", AcpiGbl_EntryStackPointer);
AcpiOsPrintf ("Lowest Stack Pointer %p\n", AcpiGbl_LowestStackPointer);
AcpiOsPrintf ("Stack Use %X (%u)\n", Temp, Temp);
AcpiOsPrintf ("Deepest Procedure Nesting %u\n", AcpiGbl_DeepestNesting);
#endif
break;
default:
break;
}
AcpiOsPrintf ("\n");
return (AE_OK);
}
开发者ID:apprisi,项目名称:illumos-gate,代码行数:101,代码来源:dbstats.c
示例20: return
static char *acpi_ut_format_number(char *string,
char *end,
u64 number,
u8 base, s32 width, s32 precision, u8 type)
{
char *pos;
char sign;
char zero;
u8 need_prefix;
u8 upper;
s32 i;
char reversed_string[66];
/* Parameter validation */
if (base < 2 || base > 16) {
return (NULL);
}
if (type & ACPI_FORMAT_LEFT) {
type &= ~ACPI_FORMAT_ZERO;
}
need_prefix = ((type & ACPI_FORMAT_PREFIX)
&& base != 10) ? TRUE : FALSE;
upper = (type & ACPI_FORMAT_UPPER) ? TRUE : FALSE;
zero = (type & ACPI_FORMAT_ZERO) ? '0' : ' ';
/* Calculate size according to sign and prefix */
sign = '\0';
if (type & ACPI_FORMAT_SIGN) {
if ((s64) number < 0) {
sign = '-';
number = -(s64) number;
width--;
} else if (type & ACPI_FORMAT_SIGN_PLUS) {
sign = '+';
width--;
} else if (type & ACPI_FORMAT_SIGN_PLUS_SPACE) {
sign = ' ';
width--;
}
}
if (need_prefix) {
width--;
if (base == 16) {
width--;
}
}
/* Generate full string in reverse order */
pos = acpi_ut_put_number(reversed_string, number, base, upper);
i = ACPI_PTR_DIFF(pos, reversed_string);
/* Printing 100 using %2d gives "100", not "00" */
if (i > precision) {
precision = i;
}
width -= precision;
/* Output the string */
if (!(type & (ACPI_FORMAT_ZERO | ACPI_FORMAT_LEFT))) {
while (--width >= 0) {
string = acpi_ut_bound_string_output(string, end, ' ');
}
}
if (sign) {
string = acpi_ut_bound_string_output(string, end, sign);
}
if (need_prefix) {
string = acpi_ut_bound_string_output(string, end, '0');
if (base == 16) {
string = acpi_ut_bound_string_output(string, end,
upper ? 'X' : 'x');
}
}
if (!(type & ACPI_FORMAT_LEFT)) {
while (--width >= 0) {
string = acpi_ut_bound_string_output(string, end, zero);
}
}
while (i <= --precision) {
string = acpi_ut_bound_string_output(string, end, '0');
}
while (--i >= 0) {
string = acpi_ut_bound_string_output(string, end,
reversed_string[i]);
}
while (--width >= 0) {
string = acpi_ut_bound_string_output(string, end, ' ');
}
return (string);
}
开发者ID:asdlei00,项目名称:linux,代码行数:100,代码来源:utprint.c
注:本文中的ACPI_PTR_DIFF函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论