aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/namespace/nsutils.c
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2006-05-26 16:36:00 -0400
committerLen Brown <len.brown@intel.com>2006-06-14 02:44:35 -0400
commit4119532c95547821dbe72d6916dfa1b2148475b3 (patch)
tree564eb8f69924fb7dc72e93526faf1547acac7d30 /drivers/acpi/namespace/nsutils.c
parentb8d35192c55fb055792ff0641408eaaec7c88988 (diff)
ACPI: ACPICA 20060526
Restructured, flattened, and simplified the internal interfaces for namespace object evaluation - resulting in smaller code, less CPU stack use, and fewer interfaces. (With assistance from Mikhail Kouzmich) Fixed a problem with the CopyObject operator where the first parameter was not typed correctly for the parser, interpreter, compiler, and disassembler. Caused various errors and unexpected behavior. Fixed a problem where a ShiftLeft or ShiftRight of more than 64 bits produced incorrect results with some C compilers. Since the behavior of C compilers when the shift value is larger than the datatype width is apparently not well defined, the interpreter now detects this condition and simply returns zero as expected in all such cases. (BZ 395) Fixed problem reports (Valery Podrezov) integrated: - Update String-to-Integer conversion to match ACPI 3.0A spec http://bugzilla.kernel.org/show_bug.cgi?id=5329 Allow interpreter to handle nested method declarations http://bugzilla.kernel.org/show_bug.cgi?id=5361 Fixed problem reports (Fiodor Suietov) integrated: - acpi_terminate() doesn't free debug memory allocation list objects (BZ 355) - After Core Subsystem shutdown, acpi_subsystem_status() returns AE_OK (BZ 356) - acpi_os_unmap_memory() for RSDP can be invoked inconsistently (BZ 357) - Resource Manager should return AE_TYPE for non-device objects (BZ 358) - Incomplete cleanup branch in AcpiNsEvaluateRelative (BZ 359) - Use acpi_os_free() instead of ACPI_FREE in acpi_rs_set_srs_method_data (BZ 360) - Incomplete cleanup branch in acpi_ps_parse_aml (BZ 361) - Incomplete cleanup branch in acpi_ds_delete_walk_state (BZ 362) - acpi_get_table_header returns AE_NO_ACPI_TABLES until DSDT is loaded (BZ 365) - Status of the Global Initialization Handler call not used (BZ 366) - Incorrect object parameter to Global Initialization Handler (BZ 367) Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/namespace/nsutils.c')
-rw-r--r--drivers/acpi/namespace/nsutils.c63
1 files changed, 31 insertions, 32 deletions
diff --git a/drivers/acpi/namespace/nsutils.c b/drivers/acpi/namespace/nsutils.c
index d1d55032b455..aa4e799d9a8c 100644
--- a/drivers/acpi/namespace/nsutils.c
+++ b/drivers/acpi/namespace/nsutils.c
@@ -142,8 +142,9 @@ acpi_ns_report_method_error(char *module_name,
142 acpi_os_printf("ACPI Error (%s-%04d): ", module_name, line_number); 142 acpi_os_printf("ACPI Error (%s-%04d): ", module_name, line_number);
143 143
144 if (path) { 144 if (path) {
145 status = acpi_ns_get_node_by_path(path, prefix_node, 145 status =
146 ACPI_NS_NO_UPSEARCH, &node); 146 acpi_ns_get_node(prefix_node, path, ACPI_NS_NO_UPSEARCH,
147 &node);
147 if (ACPI_FAILURE(status)) { 148 if (ACPI_FAILURE(status)) {
148 acpi_os_printf("[Could not get node by pathname]"); 149 acpi_os_printf("[Could not get node by pathname]");
149 } 150 }
@@ -685,13 +686,9 @@ struct acpi_namespace_node *acpi_ns_map_handle_to_node(acpi_handle handle)
685 ACPI_FUNCTION_ENTRY(); 686 ACPI_FUNCTION_ENTRY();
686 687
687 /* 688 /*
688 * Simple implementation. 689 * Simple implementation
689 */ 690 */
690 if (!handle) { 691 if ((!handle) || (handle == ACPI_ROOT_OBJECT)) {
691 return (NULL);
692 }
693
694 if (handle == ACPI_ROOT_OBJECT) {
695 return (acpi_gbl_root_node); 692 return (acpi_gbl_root_node);
696 } 693 }
697 694
@@ -701,7 +698,7 @@ struct acpi_namespace_node *acpi_ns_map_handle_to_node(acpi_handle handle)
701 return (NULL); 698 return (NULL);
702 } 699 }
703 700
704 return ((struct acpi_namespace_node *)handle); 701 return (ACPI_CAST_PTR(struct acpi_namespace_node, handle));
705} 702}
706 703
707/******************************************************************************* 704/*******************************************************************************
@@ -811,12 +808,12 @@ u32 acpi_ns_opens_scope(acpi_object_type type)
811 808
812/******************************************************************************* 809/*******************************************************************************
813 * 810 *
814 * FUNCTION: acpi_ns_get_node_by_path 811 * FUNCTION: acpi_ns_get_node
815 * 812 *
816 * PARAMETERS: *Pathname - Name to be found, in external (ASL) format. The 813 * PARAMETERS: *Pathname - Name to be found, in external (ASL) format. The
817 * \ (backslash) and ^ (carat) prefixes, and the 814 * \ (backslash) and ^ (carat) prefixes, and the
818 * . (period) to separate segments are supported. 815 * . (period) to separate segments are supported.
819 * start_node - Root of subtree to be searched, or NS_ALL for the 816 * prefix_node - Root of subtree to be searched, or NS_ALL for the
820 * root of the name space. If Name is fully 817 * root of the name space. If Name is fully
821 * qualified (first s8 is '\'), the passed value 818 * qualified (first s8 is '\'), the passed value
822 * of Scope will not be accessed. 819 * of Scope will not be accessed.
@@ -832,24 +829,29 @@ u32 acpi_ns_opens_scope(acpi_object_type type)
832 ******************************************************************************/ 829 ******************************************************************************/
833 830
834acpi_status 831acpi_status
835acpi_ns_get_node_by_path(char *pathname, 832acpi_ns_get_node(struct acpi_namespace_node *prefix_node,
836 struct acpi_namespace_node *start_node, 833 char *pathname,
837 u32 flags, struct acpi_namespace_node **return_node) 834 u32 flags, struct acpi_namespace_node **return_node)
838{ 835{
839 union acpi_generic_state scope_info; 836 union acpi_generic_state scope_info;
840 acpi_status status; 837 acpi_status status;
841 char *internal_path = NULL; 838 char *internal_path;
842 839
843 ACPI_FUNCTION_TRACE_PTR(ns_get_node_by_path, pathname); 840 ACPI_FUNCTION_TRACE_PTR(ns_get_node, pathname);
844 841
845 if (pathname) { 842 if (!pathname) {
843 *return_node = prefix_node;
844 if (!prefix_node) {
845 *return_node = acpi_gbl_root_node;
846 }
847 return_ACPI_STATUS(AE_OK);
848 }
846 849
847 /* Convert path to internal representation */ 850 /* Convert path to internal representation */
848 851
849 status = acpi_ns_internalize_name(pathname, &internal_path); 852 status = acpi_ns_internalize_name(pathname, &internal_path);
850 if (ACPI_FAILURE(status)) { 853 if (ACPI_FAILURE(status)) {
851 return_ACPI_STATUS(status); 854 return_ACPI_STATUS(status);
852 }
853 } 855 }
854 856
855 /* Must lock namespace during lookup */ 857 /* Must lock namespace during lookup */
@@ -861,26 +863,23 @@ acpi_ns_get_node_by_path(char *pathname,
861 863
862 /* Setup lookup scope (search starting point) */ 864 /* Setup lookup scope (search starting point) */
863 865
864 scope_info.scope.node = start_node; 866 scope_info.scope.node = prefix_node;
865 867
866 /* Lookup the name in the namespace */ 868 /* Lookup the name in the namespace */
867 869
868 status = acpi_ns_lookup(&scope_info, internal_path, 870 status = acpi_ns_lookup(&scope_info, internal_path, ACPI_TYPE_ANY,
869 ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE, 871 ACPI_IMODE_EXECUTE,
870 (flags | ACPI_NS_DONT_OPEN_SCOPE), 872 (flags | ACPI_NS_DONT_OPEN_SCOPE), NULL,
871 NULL, return_node); 873 return_node);
872 if (ACPI_FAILURE(status)) { 874 if (ACPI_FAILURE(status)) {
873 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "%s, %s\n", 875 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "%s, %s\n",
874 internal_path, 876 pathname, acpi_format_exception(status)));
875 acpi_format_exception(status)));
876 } 877 }
877 878
878 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); 879 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
879 880
880 cleanup: 881 cleanup:
881 if (internal_path) { 882 ACPI_FREE(internal_path);
882 ACPI_FREE(internal_path);
883 }
884 return_ACPI_STATUS(status); 883 return_ACPI_STATUS(status);
885} 884}
886 885