50 #define _COMPONENT ACPI_EXECUTER
54 static
char *acpi_ex_allocate_name_string(
u32 prefix_count,
u32 num_name_segs);
57 acpi_ex_name_segment(
u8 ** in_aml_address,
char *name_string);
75 static
char *acpi_ex_allocate_name_string(
u32 prefix_count,
u32 num_name_segs)
105 "Could not allocate size %u", size_needed));
109 temp_ptr = name_string;
116 while (prefix_count--) {
123 if (num_name_segs > 2) {
128 *temp_ptr++ = (
char)num_name_segs;
129 }
else if (2 == num_name_segs) {
159 static acpi_status acpi_ex_name_segment(
u8 ** in_aml_address,
char *name_string)
161 char *aml_address = (
void *)*in_aml_address;
172 char_buf[0] = *aml_address;
174 if (
'0' <= char_buf[0] && char_buf[0] <=
'9') {
183 char_buf[
index] = *aml_address++;
198 "Appended to - %s\n", name_string));
201 "No Name string - %s\n", char_buf));
203 }
else if (index == 0) {
209 "Leading character is not alpha: %02Xh (not a name)\n",
219 "Bad character 0x%02x in name, at %p",
220 *aml_address, aml_address));
247 char **out_name_string,
u32 * out_name_length)
250 u8 *aml_address = in_aml_address;
251 char *name_string =
NULL;
253 u32 prefix_count = 0;
264 name_string = acpi_ex_allocate_name_string(0, 1);
269 acpi_ex_name_segment(&aml_address, name_string);
276 switch (*aml_address) {
280 "RootPrefix(\\) at %p\n",
298 "ParentPrefix (^) at %p\n",
318 switch (*aml_address) {
322 "DualNamePrefix at %p\n",
327 acpi_ex_allocate_name_string(prefix_count, 2);
338 acpi_ex_name_segment(&aml_address, name_string);
341 acpi_ex_name_segment(&aml_address,
349 "MultiNamePrefix at %p\n",
355 num_segments = *aml_address;
358 acpi_ex_allocate_name_string(prefix_count,
370 while (num_segments &&
372 acpi_ex_name_segment(&aml_address,
373 name_string)) ==
AE_OK) {
385 "NameSeg is \"\\\" followed by NULL\n"));
392 acpi_ex_allocate_name_string(prefix_count, 0);
405 acpi_ex_allocate_name_string(prefix_count, 1);
412 acpi_ex_name_segment(&aml_address, name_string);
432 *out_name_string = name_string;
433 *out_name_length = (
u32) (aml_address - in_aml_address);