exstorob.c (71867) | exstorob.c (73561) |
---|---|
1 2/****************************************************************************** 3 * 4 * Module Name: amstorob - AML Interpreter object store support, store to object | 1 2/****************************************************************************** 3 * 4 * Module Name: amstorob - AML Interpreter object store support, store to object |
5 * $Revision: 22 $ | 5 * $Revision: 23 $ |
6 * 7 *****************************************************************************/ 8 9/****************************************************************************** 10 * 11 * 1. Copyright Notice 12 * 13 * Some or all of this work - Copyright (c) 1999, 2000, 2001, Intel Corp. --- 141 unchanged lines hidden (view full) --- 155 156 /* 157 * We know that SourceDesc is a buffer by now 158 */ 159 Buffer = (UINT8 *) SourceDesc->Buffer.Pointer; 160 Length = SourceDesc->Buffer.Length; 161 162 /* | 6 * 7 *****************************************************************************/ 8 9/****************************************************************************** 10 * 11 * 1. Copyright Notice 12 * 13 * Some or all of this work - Copyright (c) 1999, 2000, 2001, Intel Corp. --- 141 unchanged lines hidden (view full) --- 155 156 /* 157 * We know that SourceDesc is a buffer by now 158 */ 159 Buffer = (UINT8 *) SourceDesc->Buffer.Pointer; 160 Length = SourceDesc->Buffer.Length; 161 162 /* |
163 * If target is a buffer of length zero, allocate a new 164 * buffer of the proper length 165 */ 166 if (TargetDesc->Buffer.Length == 0) 167 { 168 TargetDesc->Buffer.Pointer = AcpiCmAllocate (Length); 169 if (!TargetDesc->Buffer.Pointer) 170 { 171 return (AE_NO_MEMORY); 172 } 173 174 TargetDesc->Buffer.Length = Length; 175 } 176 177 /* |
|
163 * Buffer is a static allocation, 164 * only place what will fit in the buffer. 165 */ 166 if (Length <= TargetDesc->Buffer.Length) 167 { 168 /* Clear existing buffer and copy in the new one */ 169 170 MEMSET(TargetDesc->Buffer.Pointer, 0, TargetDesc->Buffer.Length); 171 MEMCPY(TargetDesc->Buffer.Pointer, Buffer, Length); 172 } 173 | 178 * Buffer is a static allocation, 179 * only place what will fit in the buffer. 180 */ 181 if (Length <= TargetDesc->Buffer.Length) 182 { 183 /* Clear existing buffer and copy in the new one */ 184 185 MEMSET(TargetDesc->Buffer.Pointer, 0, TargetDesc->Buffer.Length); 186 MEMCPY(TargetDesc->Buffer.Pointer, Buffer, Length); 187 } 188 |
174 else | 189 else |
175 { 176 /* 177 * Truncate the source, copy only what will fit 178 */ 179 MEMCPY(TargetDesc->Buffer.Pointer, Buffer, TargetDesc->Buffer.Length); 180 181 DEBUG_PRINT (ACPI_INFO, | 190 { 191 /* 192 * Truncate the source, copy only what will fit 193 */ 194 MEMCPY(TargetDesc->Buffer.Pointer, Buffer, TargetDesc->Buffer.Length); 195 196 DEBUG_PRINT (ACPI_INFO, |
182 ("AmlStoreObjectToNode: Truncating src buffer from %X to %X\n", | 197 ("AmlCopyBufferToBuffer: Truncating src buffer from %X to %X\n", |
183 Length, TargetDesc->Buffer.Length)); 184 } 185 186 return (AE_OK); 187} 188 189 190 --- 48 unchanged lines hidden (view full) --- 239 { 240 /* 241 * Only free if not a pointer into the DSDT 242 */ 243 AcpiCmFree(TargetDesc->String.Pointer); 244 } 245 246 TargetDesc->String.Pointer = AcpiCmAllocate (Length + 1); | 198 Length, TargetDesc->Buffer.Length)); 199 } 200 201 return (AE_OK); 202} 203 204 205 --- 48 unchanged lines hidden (view full) --- 254 { 255 /* 256 * Only free if not a pointer into the DSDT 257 */ 258 AcpiCmFree(TargetDesc->String.Pointer); 259 } 260 261 TargetDesc->String.Pointer = AcpiCmAllocate (Length + 1); |
247 TargetDesc->String.Length = Length; 248 | |
249 if (!TargetDesc->String.Pointer) 250 { 251 return (AE_NO_MEMORY); 252 } | 262 if (!TargetDesc->String.Pointer) 263 { 264 return (AE_NO_MEMORY); 265 } |
266 TargetDesc->String.Length = Length; |
|
253 | 267 |
268 |
|
254 MEMCPY(TargetDesc->String.Pointer, Buffer, Length); 255 } 256 257 return (AE_OK); 258} 259 260 261 --- 39 unchanged lines hidden (view full) --- 301 /* SetIndex was successful, next set Data value */ 302 303 Status = AcpiAmlAccessNamedField (ACPI_WRITE, 304 TargetDesc->IndexField.Data, 305 &SourceDesc->Integer.Value, 306 sizeof (SourceDesc->Integer.Value)); 307 308 DEBUG_PRINT (ACPI_INFO, | 269 MEMCPY(TargetDesc->String.Pointer, Buffer, Length); 270 } 271 272 return (AE_OK); 273} 274 275 276 --- 39 unchanged lines hidden (view full) --- 316 /* SetIndex was successful, next set Data value */ 317 318 Status = AcpiAmlAccessNamedField (ACPI_WRITE, 319 TargetDesc->IndexField.Data, 320 &SourceDesc->Integer.Value, 321 sizeof (SourceDesc->Integer.Value)); 322 323 DEBUG_PRINT (ACPI_INFO, |
309 ("AmlStoreObjectToNode: IndexField: set data returned %s\n", | 324 ("AmlCopyIntegerToIndexField: IndexField: set data returned %s\n", |
310 AcpiCmFormatException (Status))); 311 } 312 313 else 314 { 315 DEBUG_PRINT (ACPI_INFO, | 325 AcpiCmFormatException (Status))); 326 } 327 328 else 329 { 330 DEBUG_PRINT (ACPI_INFO, |
316 ("AmlStoreObjectToNode: IndexField: set index returned %s\n", | 331 ("AmlCopyIntegerToIndexField: IndexField: set index returned %s\n", |
317 AcpiCmFormatException (Status))); 318 } 319 320 321 /* 322 * Release global lock if we acquired it earlier 323 */ 324 AcpiAmlReleaseGlobalLock (Locked); --- 49 unchanged lines hidden (view full) --- 374 TargetDesc->BankField.BankSelect, 375 &SourceDesc->BankField.Value, 376 sizeof (SourceDesc->BankField.Value)); 377 } 378 379 else 380 { 381 DEBUG_PRINT (ACPI_INFO, | 332 AcpiCmFormatException (Status))); 333 } 334 335 336 /* 337 * Release global lock if we acquired it earlier 338 */ 339 AcpiAmlReleaseGlobalLock (Locked); --- 49 unchanged lines hidden (view full) --- 389 TargetDesc->BankField.BankSelect, 390 &SourceDesc->BankField.Value, 391 sizeof (SourceDesc->BankField.Value)); 392 } 393 394 else 395 { 396 DEBUG_PRINT (ACPI_INFO, |
382 ("AmlStoreObjectToNode: BankField: set bakn returned %s\n", | 397 ("AmlCopyIntegerToBankField: BankField: set bakn returned %s\n", |
383 AcpiCmFormatException (Status))); 384 } 385 386 387 /* 388 * Release global lock if we acquired it earlier 389 */ 390 AcpiAmlReleaseGlobalLock (Locked); --- 191 unchanged lines hidden --- | 398 AcpiCmFormatException (Status))); 399 } 400 401 402 /* 403 * Release global lock if we acquired it earlier 404 */ 405 AcpiAmlReleaseGlobalLock (Locked); --- 191 unchanged lines hidden --- |