aslprepkg.c (249112) | aslprepkg.c (249663) |
---|---|
1/****************************************************************************** 2 * 3 * Module Name: aslprepkg - support for ACPI predefined name package objects 4 * 5 *****************************************************************************/ 6 7/* 8 * Copyright (C) 2000 - 2013, Intel Corp. --- 40 unchanged lines hidden (view full) --- 49#define _COMPONENT ACPI_COMPILER 50 ACPI_MODULE_NAME ("aslprepkg") 51 52 53/* Local prototypes */ 54 55static void 56ApCheckPackageElements ( | 1/****************************************************************************** 2 * 3 * Module Name: aslprepkg - support for ACPI predefined name package objects 4 * 5 *****************************************************************************/ 6 7/* 8 * Copyright (C) 2000 - 2013, Intel Corp. --- 40 unchanged lines hidden (view full) --- 49#define _COMPONENT ACPI_COMPILER 50 ACPI_MODULE_NAME ("aslprepkg") 51 52 53/* Local prototypes */ 54 55static void 56ApCheckPackageElements ( |
57 const char *PredefinedName, 58 ACPI_PARSE_OBJECT *Op, 59 UINT8 Type1, 60 UINT32 Count1, 61 UINT8 Type2, 62 UINT32 Count2); | 57 const char *PredefinedName, 58 ACPI_PARSE_OBJECT *Op, 59 UINT8 Type1, 60 UINT32 Count1, 61 UINT8 Type2, 62 UINT32 Count2); |
63 64static void 65ApCheckPackageList ( 66 const char *PredefinedName, 67 ACPI_PARSE_OBJECT *ParentOp, 68 const ACPI_PREDEFINED_INFO *Package, 69 UINT32 StartIndex, 70 UINT32 Count); --- 17 unchanged lines hidden (view full) --- 88 UINT32 Count, 89 UINT32 ExpectedCount); 90 91 92/******************************************************************************* 93 * 94 * FUNCTION: ApCheckPackage 95 * | 63 64static void 65ApCheckPackageList ( 66 const char *PredefinedName, 67 ACPI_PARSE_OBJECT *ParentOp, 68 const ACPI_PREDEFINED_INFO *Package, 69 UINT32 StartIndex, 70 UINT32 Count); --- 17 unchanged lines hidden (view full) --- 88 UINT32 Count, 89 UINT32 ExpectedCount); 90 91 92/******************************************************************************* 93 * 94 * FUNCTION: ApCheckPackage 95 * |
96 * PARAMETERS: ParentOp - Parser op for the package 97 * Predefined - Pointer to package-specific info for method | 96 * PARAMETERS: ParentOp - Parser op for the package 97 * Predefined - Pointer to package-specific info for 98 * the method |
98 * 99 * RETURN: None 100 * 101 * DESCRIPTION: Top-level validation for predefined name return package 102 * objects. 103 * 104 ******************************************************************************/ 105 --- 82 unchanged lines hidden (view full) --- 188 189 ApCheckPackageElements (Predefined->Info.Name, Op, 190 Package->RetInfo.ObjectType1, Package->RetInfo.Count1, 191 Package->RetInfo.ObjectType2, Package->RetInfo.Count2); 192 break; 193 194 case ACPI_PTYPE1_VAR: 195 /* | 99 * 100 * RETURN: None 101 * 102 * DESCRIPTION: Top-level validation for predefined name return package 103 * objects. 104 * 105 ******************************************************************************/ 106 --- 82 unchanged lines hidden (view full) --- 189 190 ApCheckPackageElements (Predefined->Info.Name, Op, 191 Package->RetInfo.ObjectType1, Package->RetInfo.Count1, 192 Package->RetInfo.ObjectType2, Package->RetInfo.Count2); 193 break; 194 195 case ACPI_PTYPE1_VAR: 196 /* |
196 * The package count is variable, there are no sub-packages, and all 197 * elements must be of the same type | 197 * The package count is variable, there are no sub-packages, 198 * and all elements must be of the same type |
198 */ 199 for (i = 0; i < Count; i++) 200 { 201 ApCheckObjectType (Predefined->Info.Name, Op, 202 Package->RetInfo.ObjectType1, i); 203 Op = Op->Asl.Next; 204 } 205 break; 206 207 case ACPI_PTYPE1_OPTION: 208 /* | 199 */ 200 for (i = 0; i < Count; i++) 201 { 202 ApCheckObjectType (Predefined->Info.Name, Op, 203 Package->RetInfo.ObjectType1, i); 204 Op = Op->Asl.Next; 205 } 206 break; 207 208 case ACPI_PTYPE1_OPTION: 209 /* |
209 * The package count is variable, there are no sub-packages. There are 210 * a fixed number of required elements, and a variable number of 211 * optional elements. | 210 * The package count is variable, there are no sub-packages. 211 * There are a fixed number of required elements, and a variable 212 * number of optional elements. |
212 * 213 * Check if package is at least as large as the minimum required 214 */ 215 ExpectedCount = Package->RetInfo3.Count; 216 if (Count < ExpectedCount) 217 { 218 goto PackageTooSmall; 219 } --- 43 unchanged lines hidden (view full) --- 263 Status = ApCheckObjectType (Predefined->Info.Name, Op, 264 ACPI_RTYPE_INTEGER, 0); 265 266 /* We must have an integer count from above (otherwise, use Count) */ 267 268 if (ACPI_SUCCESS (Status)) 269 { 270 /* | 213 * 214 * Check if package is at least as large as the minimum required 215 */ 216 ExpectedCount = Package->RetInfo3.Count; 217 if (Count < ExpectedCount) 218 { 219 goto PackageTooSmall; 220 } --- 43 unchanged lines hidden (view full) --- 264 Status = ApCheckObjectType (Predefined->Info.Name, Op, 265 ACPI_RTYPE_INTEGER, 0); 266 267 /* We must have an integer count from above (otherwise, use Count) */ 268 269 if (ACPI_SUCCESS (Status)) 270 { 271 /* |
271 * Count cannot be larger than the parent package length, but allow it 272 * to be smaller. The >= accounts for the Integer above. | 272 * Count cannot be larger than the parent package length, but 273 * allow it to be smaller. The >= accounts for the Integer above. |
273 */ 274 ExpectedCount = (UINT32) Op->Asl.Value.Integer; 275 if (ExpectedCount >= Count) 276 { 277 goto PackageTooSmall; 278 } 279 280 Count = ExpectedCount; --- 34 unchanged lines hidden (view full) --- 315 Count, ExpectedCount); 316} 317 318 319/******************************************************************************* 320 * 321 * FUNCTION: ApCheckPackageElements 322 * | 274 */ 275 ExpectedCount = (UINT32) Op->Asl.Value.Integer; 276 if (ExpectedCount >= Count) 277 { 278 goto PackageTooSmall; 279 } 280 281 Count = ExpectedCount; --- 34 unchanged lines hidden (view full) --- 316 Count, ExpectedCount); 317} 318 319 320/******************************************************************************* 321 * 322 * FUNCTION: ApCheckPackageElements 323 * |
323 * PARAMETERS: PredefinedName - Pointer to validation data structure 324 * Op - Parser op for the package 325 * Type1 - Object type for first group 326 * Count1 - Count for first group 327 * Type2 - Object type for second group 328 * Count2 - Count for second group | 324 * PARAMETERS: PredefinedName - Name of the predefined object 325 * Op - Parser op for the package 326 * Type1 - Object type for first group 327 * Count1 - Count for first group 328 * Type2 - Object type for second group 329 * Count2 - Count for second group |
329 * 330 * RETURN: None 331 * 332 * DESCRIPTION: Validate all elements of a package. Works with packages that 333 * are defined to contain up to two groups of different object 334 * types. 335 * 336 ******************************************************************************/ --- 345 unchanged lines hidden --- | 330 * 331 * RETURN: None 332 * 333 * DESCRIPTION: Validate all elements of a package. Works with packages that 334 * are defined to contain up to two groups of different object 335 * types. 336 * 337 ******************************************************************************/ --- 345 unchanged lines hidden --- |