asltree.c (217365) | asltree.c (218590) |
---|---|
1 2/****************************************************************************** 3 * 4 * Module Name: asltree - parse tree management 5 * 6 *****************************************************************************/ 7 8/* --- 31 unchanged lines hidden (view full) --- 40 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 41 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 42 * POSSIBILITY OF SUCH DAMAGES. 43 */ 44 45 46#include <contrib/dev/acpica/compiler/aslcompiler.h> 47#include "aslcompiler.y.h" | 1 2/****************************************************************************** 3 * 4 * Module Name: asltree - parse tree management 5 * 6 *****************************************************************************/ 7 8/* --- 31 unchanged lines hidden (view full) --- 40 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 41 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 42 * POSSIBILITY OF SUCH DAMAGES. 43 */ 44 45 46#include <contrib/dev/acpica/compiler/aslcompiler.h> 47#include "aslcompiler.y.h" |
48#include <time.h> |
|
48 49#define _COMPONENT ACPI_COMPILER 50 ACPI_MODULE_NAME ("asltree") 51 52/* Local prototypes */ 53 54static ACPI_PARSE_OBJECT * 55TrGetNextNode ( --- 342 unchanged lines hidden (view full) --- 398 Op->Asl.LineNumber, Op->Asl.Column, Op, UtGetOpName(ParseOpcode)); 399 400 return Op; 401} 402 403 404/******************************************************************************* 405 * | 49 50#define _COMPONENT ACPI_COMPILER 51 ACPI_MODULE_NAME ("asltree") 52 53/* Local prototypes */ 54 55static ACPI_PARSE_OBJECT * 56TrGetNextNode ( --- 342 unchanged lines hidden (view full) --- 399 Op->Asl.LineNumber, Op->Asl.Column, Op, UtGetOpName(ParseOpcode)); 400 401 return Op; 402} 403 404 405/******************************************************************************* 406 * |
407 * FUNCTION: TrCreateConstantLeafNode 408 * 409 * PARAMETERS: ParseOpcode - The constant opcode 410 * 411 * RETURN: Pointer to the new node. Aborts on allocation failure 412 * 413 * DESCRIPTION: Create a leaf node (no children or peers) for one of the 414 * special constants - __LINE__, __FILE__, and __DATE__. 415 * 416 * Note: An implemenation of __FUNC__ cannot happen here because we don't 417 * have a full parse tree at this time and cannot find the parent control 418 * method. If it is ever needed, __FUNC__ must be implemented later, after 419 * the parse tree has been fully constructed. 420 * 421 ******************************************************************************/ 422 423ACPI_PARSE_OBJECT * 424TrCreateConstantLeafNode ( 425 UINT32 ParseOpcode) 426{ 427 ACPI_PARSE_OBJECT *Op = NULL; 428 time_t CurrentTime; 429 char *StaticTimeString; 430 char *TimeString; 431 432 433 switch (ParseOpcode) 434 { 435 case PARSEOP___LINE__: 436 Op = TrAllocateNode (PARSEOP_INTEGER); 437 Op->Asl.Value.Integer = Op->Asl.LineNumber; 438 break; 439 440 case PARSEOP___FILE__: 441 Op = TrAllocateNode (PARSEOP_STRING_LITERAL); 442 443 /* Op.Asl.Filename contains the full pathname to the file */ 444 445 Op->Asl.Value.String = Op->Asl.Filename; 446 break; 447 448 case PARSEOP___DATE__: 449 Op = TrAllocateNode (PARSEOP_STRING_LITERAL); 450 451 /* Get a copy of the current time */ 452 453 CurrentTime = time (NULL); 454 StaticTimeString = ctime (&CurrentTime); 455 TimeString = UtLocalCalloc (strlen (StaticTimeString) + 1); 456 strcpy (TimeString, StaticTimeString); 457 458 TimeString[strlen(TimeString) -1] = 0; /* Remove trailing newline */ 459 Op->Asl.Value.String = TimeString; 460 break; 461 462 default: /* This would be an internal error */ 463 return (NULL); 464 } 465 466 DbgPrint (ASL_PARSE_OUTPUT, 467 "\nCreateConstantLeafNode Ln/Col %u/%u NewNode %p Op %s Value %8.8X%8.8X ", 468 Op->Asl.LineNumber, Op->Asl.Column, Op, UtGetOpName (ParseOpcode), 469 ACPI_FORMAT_UINT64 (Op->Asl.Value.Integer)); 470 return (Op); 471} 472 473 474/******************************************************************************* 475 * |
|
406 * FUNCTION: TrCreateValuedLeafNode 407 * 408 * PARAMETERS: ParseOpcode - New opcode to be assigned to the node 409 * Value - Value to be assigned to the node 410 * 411 * RETURN: Pointer to the new node. Aborts on allocation failure 412 * 413 * DESCRIPTION: Create a leaf node (no children or peers) with a value --- 709 unchanged lines hidden --- | 476 * FUNCTION: TrCreateValuedLeafNode 477 * 478 * PARAMETERS: ParseOpcode - New opcode to be assigned to the node 479 * Value - Value to be assigned to the node 480 * 481 * RETURN: Pointer to the new node. Aborts on allocation failure 482 * 483 * DESCRIPTION: Create a leaf node (no children or peers) with a value --- 709 unchanged lines hidden --- |