aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpica/exoparg1.c
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2009-11-11 20:52:45 -0500
committerLen Brown <len.brown@intel.com>2009-11-24 21:31:11 -0500
commitdc95a270c684e771b25dce0b60559cc80c033f22 (patch)
tree11c4b75117ab6e2f1b09d483422b7f42572d9c67 /drivers/acpi/acpica/exoparg1.c
parent502f7efa6ae7c3f6d93dac417af521af1f56bcc7 (diff)
ACPICA: Deploy new create integer interface where appropriate
Simplifies creation of simple integer objects. ACPICA BZ 823. http://www.acpica.org/bugzilla/show_bug.cgi?id=823 Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/acpica/exoparg1.c')
-rw-r--r--drivers/acpi/acpica/exoparg1.c38
1 files changed, 17 insertions, 21 deletions
diff --git a/drivers/acpi/acpica/exoparg1.c b/drivers/acpi/acpica/exoparg1.c
index 9635d21e568d..752fe48b2d20 100644
--- a/drivers/acpi/acpica/exoparg1.c
+++ b/drivers/acpi/acpica/exoparg1.c
@@ -100,12 +100,12 @@ acpi_status acpi_ex_opcode_0A_0T_1R(struct acpi_walk_state *walk_state)
100 100
101 /* Create a return object of type Integer */ 101 /* Create a return object of type Integer */
102 102
103 return_desc = acpi_ut_create_internal_object(ACPI_TYPE_INTEGER); 103 return_desc =
104 acpi_ut_create_integer_object(acpi_os_get_timer());
104 if (!return_desc) { 105 if (!return_desc) {
105 status = AE_NO_MEMORY; 106 status = AE_NO_MEMORY;
106 goto cleanup; 107 goto cleanup;
107 } 108 }
108 return_desc->integer.value = acpi_os_get_timer();
109 break; 109 break;
110 110
111 default: /* Unknown opcode */ 111 default: /* Unknown opcode */
@@ -599,7 +599,7 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
599 switch (walk_state->opcode) { 599 switch (walk_state->opcode) {
600 case AML_LNOT_OP: /* LNot (Operand) */ 600 case AML_LNOT_OP: /* LNot (Operand) */
601 601
602 return_desc = acpi_ut_create_internal_object(ACPI_TYPE_INTEGER); 602 return_desc = acpi_ut_create_integer_object((u64) 0);
603 if (!return_desc) { 603 if (!return_desc) {
604 status = AE_NO_MEMORY; 604 status = AE_NO_MEMORY;
605 goto cleanup; 605 goto cleanup;
@@ -702,13 +702,11 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
702 702
703 /* Allocate a descriptor to hold the type. */ 703 /* Allocate a descriptor to hold the type. */
704 704
705 return_desc = acpi_ut_create_internal_object(ACPI_TYPE_INTEGER); 705 return_desc = acpi_ut_create_integer_object((u64) type);
706 if (!return_desc) { 706 if (!return_desc) {
707 status = AE_NO_MEMORY; 707 status = AE_NO_MEMORY;
708 goto cleanup; 708 goto cleanup;
709 } 709 }
710
711 return_desc->integer.value = type;
712 break; 710 break;
713 711
714 case AML_SIZE_OF_OP: /* size_of (source_object) */ 712 case AML_SIZE_OF_OP: /* size_of (source_object) */
@@ -777,13 +775,11 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
777 * Now that we have the size of the object, create a result 775 * Now that we have the size of the object, create a result
778 * object to hold the value 776 * object to hold the value
779 */ 777 */
780 return_desc = acpi_ut_create_internal_object(ACPI_TYPE_INTEGER); 778 return_desc = acpi_ut_create_integer_object(value);
781 if (!return_desc) { 779 if (!return_desc) {
782 status = AE_NO_MEMORY; 780 status = AE_NO_MEMORY;
783 goto cleanup; 781 goto cleanup;
784 } 782 }
785
786 return_desc->integer.value = value;
787 break; 783 break;
788 784
789 case AML_REF_OF_OP: /* ref_of (source_object) */ 785 case AML_REF_OF_OP: /* ref_of (source_object) */
@@ -946,24 +942,24 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
946 * NOTE: index into a buffer is NOT a pointer to a 942 * NOTE: index into a buffer is NOT a pointer to a
947 * sub-buffer of the main buffer, it is only a pointer to a 943 * sub-buffer of the main buffer, it is only a pointer to a
948 * single element (byte) of the buffer! 944 * single element (byte) of the buffer!
945 *
946 * Since we are returning the value of the buffer at the
947 * indexed location, we don't need to add an additional
948 * reference to the buffer itself.
949 */ 949 */
950 return_desc = 950 return_desc =
951 acpi_ut_create_internal_object 951 acpi_ut_create_integer_object((u64)
952 (ACPI_TYPE_INTEGER); 952 temp_desc->
953 buffer.
954 pointer
955 [operand
956 [0]->
957 reference.
958 value]);
953 if (!return_desc) { 959 if (!return_desc) {
954 status = AE_NO_MEMORY; 960 status = AE_NO_MEMORY;
955 goto cleanup; 961 goto cleanup;
956 } 962 }
957
958 /*
959 * Since we are returning the value of the buffer at the
960 * indexed location, we don't need to add an additional
961 * reference to the buffer itself.
962 */
963 return_desc->integer.value =
964 temp_desc->buffer.
965 pointer[operand[0]->reference.
966 value];
967 break; 963 break;
968 964
969 case ACPI_TYPE_PACKAGE: 965 case ACPI_TYPE_PACKAGE: