exconvrt.c (cb5629b10d64a8006622ce3a52bc887d91057d69) | exconvrt.c (3371c19c294a4cb3649aa4e84606be8a1d999e61) |
---|---|
1/****************************************************************************** 2 * 3 * Module Name: exconvrt - Object conversion routines 4 * 5 *****************************************************************************/ 6 7/* 8 * Copyright (C) 2000 - 2008, Intel Corp. --- 68 unchanged lines hidden (view full) --- 77 u8 *pointer; 78 acpi_integer result; 79 u32 i; 80 u32 count; 81 acpi_status status; 82 83 ACPI_FUNCTION_TRACE_PTR(ex_convert_to_integer, obj_desc); 84 | 1/****************************************************************************** 2 * 3 * Module Name: exconvrt - Object conversion routines 4 * 5 *****************************************************************************/ 6 7/* 8 * Copyright (C) 2000 - 2008, Intel Corp. --- 68 unchanged lines hidden (view full) --- 77 u8 *pointer; 78 acpi_integer result; 79 u32 i; 80 u32 count; 81 acpi_status status; 82 83 ACPI_FUNCTION_TRACE_PTR(ex_convert_to_integer, obj_desc); 84 |
85 switch (ACPI_GET_OBJECT_TYPE(obj_desc)) { | 85 switch (obj_desc->common.type) { |
86 case ACPI_TYPE_INTEGER: 87 88 /* No conversion necessary */ 89 90 *result_desc = obj_desc; 91 return_ACPI_STATUS(AE_OK); 92 93 case ACPI_TYPE_BUFFER: --- 17 unchanged lines hidden (view full) --- 111 * There are two terminating conditions for the loop: 112 * 1) The size of an integer has been reached, or 113 * 2) The end of the buffer or string has been reached 114 */ 115 result = 0; 116 117 /* String conversion is different than Buffer conversion */ 118 | 86 case ACPI_TYPE_INTEGER: 87 88 /* No conversion necessary */ 89 90 *result_desc = obj_desc; 91 return_ACPI_STATUS(AE_OK); 92 93 case ACPI_TYPE_BUFFER: --- 17 unchanged lines hidden (view full) --- 111 * There are two terminating conditions for the loop: 112 * 1) The size of an integer has been reached, or 113 * 2) The end of the buffer or string has been reached 114 */ 115 result = 0; 116 117 /* String conversion is different than Buffer conversion */ 118 |
119 switch (ACPI_GET_OBJECT_TYPE(obj_desc)) { | 119 switch (obj_desc->common.type) { |
120 case ACPI_TYPE_STRING: 121 122 /* 123 * Convert string to an integer - for most cases, the string must be 124 * hexadecimal as per the ACPI specification. The only exception (as 125 * of ACPI 3.0) is that the to_integer() operator allows both decimal 126 * and hexadecimal strings (hex prefixed with "0x"). 127 */ --- 73 unchanged lines hidden (view full) --- 201acpi_ex_convert_to_buffer(union acpi_operand_object *obj_desc, 202 union acpi_operand_object **result_desc) 203{ 204 union acpi_operand_object *return_desc; 205 u8 *new_buf; 206 207 ACPI_FUNCTION_TRACE_PTR(ex_convert_to_buffer, obj_desc); 208 | 120 case ACPI_TYPE_STRING: 121 122 /* 123 * Convert string to an integer - for most cases, the string must be 124 * hexadecimal as per the ACPI specification. The only exception (as 125 * of ACPI 3.0) is that the to_integer() operator allows both decimal 126 * and hexadecimal strings (hex prefixed with "0x"). 127 */ --- 73 unchanged lines hidden (view full) --- 201acpi_ex_convert_to_buffer(union acpi_operand_object *obj_desc, 202 union acpi_operand_object **result_desc) 203{ 204 union acpi_operand_object *return_desc; 205 u8 *new_buf; 206 207 ACPI_FUNCTION_TRACE_PTR(ex_convert_to_buffer, obj_desc); 208 |
209 switch (ACPI_GET_OBJECT_TYPE(obj_desc)) { | 209 switch (obj_desc->common.type) { |
210 case ACPI_TYPE_BUFFER: 211 212 /* No conversion necessary */ 213 214 *result_desc = obj_desc; 215 return_ACPI_STATUS(AE_OK); 216 217 case ACPI_TYPE_INTEGER: --- 186 unchanged lines hidden (view full) --- 404 u8 *new_buf; 405 u32 i; 406 u32 string_length = 0; 407 u16 base = 16; 408 u8 separator = ','; 409 410 ACPI_FUNCTION_TRACE_PTR(ex_convert_to_string, obj_desc); 411 | 210 case ACPI_TYPE_BUFFER: 211 212 /* No conversion necessary */ 213 214 *result_desc = obj_desc; 215 return_ACPI_STATUS(AE_OK); 216 217 case ACPI_TYPE_INTEGER: --- 186 unchanged lines hidden (view full) --- 404 u8 *new_buf; 405 u32 i; 406 u32 string_length = 0; 407 u16 base = 16; 408 u8 separator = ','; 409 410 ACPI_FUNCTION_TRACE_PTR(ex_convert_to_string, obj_desc); 411 |
412 switch (ACPI_GET_OBJECT_TYPE(obj_desc)) { | 412 switch (obj_desc->common.type) { |
413 case ACPI_TYPE_STRING: 414 415 /* No conversion necessary */ 416 417 *result_desc = obj_desc; 418 return_ACPI_STATUS(AE_OK); 419 420 case ACPI_TYPE_INTEGER: --- 179 unchanged lines hidden (view full) --- 600 /* 601 * Named field can always handle conversions 602 */ 603 break; 604 605 default: 606 /* No conversion allowed for these types */ 607 | 413 case ACPI_TYPE_STRING: 414 415 /* No conversion necessary */ 416 417 *result_desc = obj_desc; 418 return_ACPI_STATUS(AE_OK); 419 420 case ACPI_TYPE_INTEGER: --- 179 unchanged lines hidden (view full) --- 600 /* 601 * Named field can always handle conversions 602 */ 603 break; 604 605 default: 606 /* No conversion allowed for these types */ 607 |
608 if (destination_type != 609 ACPI_GET_OBJECT_TYPE(source_desc)) { | 608 if (destination_type != source_desc->common.type) { |
610 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 611 "Explicit operator, will store (%s) over existing type (%s)\n", 612 acpi_ut_get_object_type_name 613 (source_desc), 614 acpi_ut_get_type_name 615 (destination_type))); 616 status = AE_TYPE; 617 } --- 75 unchanged lines hidden --- | 609 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 610 "Explicit operator, will store (%s) over existing type (%s)\n", 611 acpi_ut_get_object_type_name 612 (source_desc), 613 acpi_ut_get_type_name 614 (destination_type))); 615 status = AE_TYPE; 616 } --- 75 unchanged lines hidden --- |