asloperands.c (9a696dc6bb0e8e783dfd169c8299e1f33aac2935) asloperands.c (44b0f624aee0d43179bf3874c70e03b6ae49a4db)
1/******************************************************************************
2 *
3 * Module Name: asloperands - AML operand processing
4 *
5 *****************************************************************************/
6
7/******************************************************************************
8 *

--- 1031 unchanged lines hidden (view full) ---

1040static void
1041OpnDoDefinitionBlock (
1042 ACPI_PARSE_OBJECT *Op)
1043{
1044 ACPI_PARSE_OBJECT *Child;
1045 ACPI_SIZE Length;
1046 UINT32 i;
1047 char *Filename;
1/******************************************************************************
2 *
3 * Module Name: asloperands - AML operand processing
4 *
5 *****************************************************************************/
6
7/******************************************************************************
8 *

--- 1031 unchanged lines hidden (view full) ---

1040static void
1041OpnDoDefinitionBlock (
1042 ACPI_PARSE_OBJECT *Op)
1043{
1044 ACPI_PARSE_OBJECT *Child;
1045 ACPI_SIZE Length;
1046 UINT32 i;
1047 char *Filename;
1048 ACPI_STATUS Status;
1048
1049
1050 /*
1051 * These nodes get stuffed into the table header. They are special
1052 * cased when the table is written to the output file.
1053 *
1054 * Mark all of these nodes as non-usable so they won't get output
1055 * as AML opcodes!
1056 */
1057
1058 /* Get AML filename. Use it if non-null */
1059
1060 Child = Op->Asl.Child;
1061 if (Child->Asl.Value.Buffer &&
1062 *Child->Asl.Value.Buffer &&
1063 (AslGbl_UseDefaultAmlFilename))
1064 {
1065 /*
1049
1050
1051 /*
1052 * These nodes get stuffed into the table header. They are special
1053 * cased when the table is written to the output file.
1054 *
1055 * Mark all of these nodes as non-usable so they won't get output
1056 * as AML opcodes!
1057 */
1058
1059 /* Get AML filename. Use it if non-null */
1060
1061 Child = Op->Asl.Child;
1062 if (Child->Asl.Value.Buffer &&
1063 *Child->Asl.Value.Buffer &&
1064 (AslGbl_UseDefaultAmlFilename))
1065 {
1066 /*
1067 * The walk may traverse multiple definition blocks. Switch files
1068 * to ensure that the correct files are manipulated.
1069 */
1070 FlSwitchFileSet (Op->Asl.Filename);
1071
1072 /*
1066 * We will use the AML filename that is embedded in the source file
1067 * for the output filename.
1068 */
1069 Filename = UtLocalCacheCalloc (strlen (AslGbl_DirectoryPath) +
1070 strlen ((char *) Child->Asl.Value.Buffer) + 1);
1071
1072 /* Prepend the current directory path */
1073
1074 strcpy (Filename, AslGbl_DirectoryPath);
1075 strcat (Filename, (char *) Child->Asl.Value.Buffer);
1076
1077 AslGbl_OutputFilenamePrefix = Filename;
1078 UtConvertBackslashes (AslGbl_OutputFilenamePrefix);
1073 * We will use the AML filename that is embedded in the source file
1074 * for the output filename.
1075 */
1076 Filename = UtLocalCacheCalloc (strlen (AslGbl_DirectoryPath) +
1077 strlen ((char *) Child->Asl.Value.Buffer) + 1);
1078
1079 /* Prepend the current directory path */
1080
1081 strcpy (Filename, AslGbl_DirectoryPath);
1082 strcat (Filename, (char *) Child->Asl.Value.Buffer);
1083
1084 AslGbl_OutputFilenamePrefix = Filename;
1085 UtConvertBackslashes (AslGbl_OutputFilenamePrefix);
1086
1087 /*
1088 * Use the definition block file parameter instead of the input
1089 * filename. Since all files were opened previously, remove the
1090 * existing file and open a new file with the name of this
1091 * definiton block parameter. Since AML code generation has yet
1092 * to happen, the previous file can be removed without any impacts.
1093 */
1094 FlCloseFile (ASL_FILE_AML_OUTPUT);
1095 FlDeleteFile (ASL_FILE_AML_OUTPUT);
1096 Status = FlOpenAmlOutputFile (AslGbl_OutputFilenamePrefix);
1097 if (ACPI_FAILURE (Status))
1098 {
1099 AslError (ASL_ERROR, ASL_MSG_OUTPUT_FILE_OPEN, NULL, NULL);
1100 return;
1101 }
1079 }
1080
1081 Child->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
1082
1083 /* Signature */
1084
1085 Child = Child->Asl.Next;
1086 Child->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
1087 if (Child->Asl.Value.String)
1088 {
1102 }
1103
1104 Child->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
1105
1106 /* Signature */
1107
1108 Child = Child->Asl.Next;
1109 Child->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
1110 if (Child->Asl.Value.String)
1111 {
1112 AslGbl_FilesList->TableSignature = Child->Asl.Value.String;
1089 AslGbl_TableSignature = Child->Asl.Value.String;
1090 if (strlen (AslGbl_TableSignature) != ACPI_NAMESEG_SIZE)
1091 {
1092 AslError (ASL_ERROR, ASL_MSG_TABLE_SIGNATURE, Child,
1093 "Length must be exactly 4 characters");
1094 }
1095
1096 for (i = 0; i < ACPI_NAMESEG_SIZE; i++)

--- 36 unchanged lines hidden (view full) ---

1133 if (Length > ACPI_OEM_TABLE_ID_SIZE)
1134 {
1135 AslError (ASL_ERROR, ASL_MSG_OEM_TABLE_ID, Child,
1136 "Length cannot exceed 8 characters");
1137 }
1138
1139 AslGbl_TableId = UtLocalCacheCalloc (Length + 1);
1140 strcpy (AslGbl_TableId, Child->Asl.Value.String);
1113 AslGbl_TableSignature = Child->Asl.Value.String;
1114 if (strlen (AslGbl_TableSignature) != ACPI_NAMESEG_SIZE)
1115 {
1116 AslError (ASL_ERROR, ASL_MSG_TABLE_SIGNATURE, Child,
1117 "Length must be exactly 4 characters");
1118 }
1119
1120 for (i = 0; i < ACPI_NAMESEG_SIZE; i++)

--- 36 unchanged lines hidden (view full) ---

1157 if (Length > ACPI_OEM_TABLE_ID_SIZE)
1158 {
1159 AslError (ASL_ERROR, ASL_MSG_OEM_TABLE_ID, Child,
1160 "Length cannot exceed 8 characters");
1161 }
1162
1163 AslGbl_TableId = UtLocalCacheCalloc (Length + 1);
1164 strcpy (AslGbl_TableId, Child->Asl.Value.String);
1165 AslGbl_FilesList->TableId = AslGbl_TableId;
1141
1142 /*
1143 * Convert anything non-alphanumeric to an underscore. This
1144 * allows us to use the TableID to generate unique C symbols.
1145 */
1146 for (i = 0; i < Length; i++)
1147 {
1148 if (!isalnum ((int) AslGbl_TableId[i]))

--- 213 unchanged lines hidden ---
1166
1167 /*
1168 * Convert anything non-alphanumeric to an underscore. This
1169 * allows us to use the TableID to generate unique C symbols.
1170 */
1171 for (i = 0; i < Length; i++)
1172 {
1173 if (!isalnum ((int) AslGbl_TableId[i]))

--- 213 unchanged lines hidden ---