aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/utilities/utalloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/utilities/utalloc.c')
-rw-r--r--drivers/acpi/utilities/utalloc.c51
1 files changed, 33 insertions, 18 deletions
diff --git a/drivers/acpi/utilities/utalloc.c b/drivers/acpi/utilities/utalloc.c
index 65a7c2ed9aa1..7940fc1bd69e 100644
--- a/drivers/acpi/utilities/utalloc.c
+++ b/drivers/acpi/utilities/utalloc.c
@@ -61,24 +61,6 @@ acpi_status acpi_ut_create_caches(void)
61{ 61{
62 acpi_status status; 62 acpi_status status;
63 63
64#ifdef ACPI_DBG_TRACK_ALLOCATIONS
65
66 /* Memory allocation lists */
67
68 status = acpi_ut_create_list("Acpi-Global", 0, &acpi_gbl_global_list);
69 if (ACPI_FAILURE(status)) {
70 return (status);
71 }
72
73 status =
74 acpi_ut_create_list("Acpi-Namespace",
75 sizeof(struct acpi_namespace_node),
76 &acpi_gbl_ns_node_list);
77 if (ACPI_FAILURE(status)) {
78 return (status);
79 }
80#endif
81
82 /* Object Caches, for frequently used objects */ 64 /* Object Caches, for frequently used objects */
83 65
84 status = 66 status =
@@ -125,6 +107,24 @@ acpi_status acpi_ut_create_caches(void)
125 return (status); 107 return (status);
126 } 108 }
127 109
110#ifdef ACPI_DBG_TRACK_ALLOCATIONS
111
112 /* Memory allocation lists */
113
114 status = acpi_ut_create_list("Acpi-Global", 0, &acpi_gbl_global_list);
115 if (ACPI_FAILURE(status)) {
116 return (status);
117 }
118
119 status =
120 acpi_ut_create_list("Acpi-Namespace",
121 sizeof(struct acpi_namespace_node),
122 &acpi_gbl_ns_node_list);
123 if (ACPI_FAILURE(status)) {
124 return (status);
125 }
126#endif
127
128 return (AE_OK); 128 return (AE_OK);
129} 129}
130 130
@@ -158,6 +158,21 @@ acpi_status acpi_ut_delete_caches(void)
158 (void)acpi_os_delete_cache(acpi_gbl_ps_node_ext_cache); 158 (void)acpi_os_delete_cache(acpi_gbl_ps_node_ext_cache);
159 acpi_gbl_ps_node_ext_cache = NULL; 159 acpi_gbl_ps_node_ext_cache = NULL;
160 160
161#ifdef ACPI_DBG_TRACK_ALLOCATIONS
162
163 /* Debug only - display leftover memory allocation, if any */
164
165 acpi_ut_dump_allocations(ACPI_UINT32_MAX, NULL);
166
167 /* Free memory lists */
168
169 acpi_os_free(acpi_gbl_global_list);
170 acpi_gbl_global_list = NULL;
171
172 acpi_os_free(acpi_gbl_ns_node_list);
173 acpi_gbl_ns_node_list = NULL;
174#endif
175
161 return (AE_OK); 176 return (AE_OK);
162} 177}
163 178