aslsupport.y revision 1.1.1.5.2.2 1 1.1.1.5.2.2 jdolecek NoEcho('
2 1.1.1.5.2.2 jdolecek /******************************************************************************
3 1.1.1.5.2.2 jdolecek *
4 1.1.1.5.2.2 jdolecek * Module Name: aslsupport.y - Bison/Yacc C support functions
5 1.1.1.5.2.2 jdolecek *
6 1.1.1.5.2.2 jdolecek *****************************************************************************/
7 1.1.1.5.2.2 jdolecek
8 1.1.1.5.2.2 jdolecek /*
9 1.1.1.5.2.2 jdolecek * Copyright (C) 2000 - 2017, Intel Corp.
10 1.1.1.5.2.2 jdolecek * All rights reserved.
11 1.1.1.5.2.2 jdolecek *
12 1.1.1.5.2.2 jdolecek * Redistribution and use in source and binary forms, with or without
13 1.1.1.5.2.2 jdolecek * modification, are permitted provided that the following conditions
14 1.1.1.5.2.2 jdolecek * are met:
15 1.1.1.5.2.2 jdolecek * 1. Redistributions of source code must retain the above copyright
16 1.1.1.5.2.2 jdolecek * notice, this list of conditions, and the following disclaimer,
17 1.1.1.5.2.2 jdolecek * without modification.
18 1.1.1.5.2.2 jdolecek * 2. Redistributions in binary form must reproduce at minimum a disclaimer
19 1.1.1.5.2.2 jdolecek * substantially similar to the "NO WARRANTY" disclaimer below
20 1.1.1.5.2.2 jdolecek * ("Disclaimer") and any redistribution must be conditioned upon
21 1.1.1.5.2.2 jdolecek * including a substantially similar Disclaimer requirement for further
22 1.1.1.5.2.2 jdolecek * binary redistribution.
23 1.1.1.5.2.2 jdolecek * 3. Neither the names of the above-listed copyright holders nor the names
24 1.1.1.5.2.2 jdolecek * of any contributors may be used to endorse or promote products derived
25 1.1.1.5.2.2 jdolecek * from this software without specific prior written permission.
26 1.1.1.5.2.2 jdolecek *
27 1.1.1.5.2.2 jdolecek * Alternatively, this software may be distributed under the terms of the
28 1.1.1.5.2.2 jdolecek * GNU General Public License ("GPL") version 2 as published by the Free
29 1.1.1.5.2.2 jdolecek * Software Foundation.
30 1.1.1.5.2.2 jdolecek *
31 1.1.1.5.2.2 jdolecek * NO WARRANTY
32 1.1.1.5.2.2 jdolecek * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
33 1.1.1.5.2.2 jdolecek * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
34 1.1.1.5.2.2 jdolecek * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
35 1.1.1.5.2.2 jdolecek * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
36 1.1.1.5.2.2 jdolecek * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
37 1.1.1.5.2.2 jdolecek * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
38 1.1.1.5.2.2 jdolecek * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
39 1.1.1.5.2.2 jdolecek * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
40 1.1.1.5.2.2 jdolecek * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
41 1.1.1.5.2.2 jdolecek * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
42 1.1.1.5.2.2 jdolecek * POSSIBILITY OF SUCH DAMAGES.
43 1.1.1.5.2.2 jdolecek */
44 1.1.1.5.2.2 jdolecek
45 1.1.1.5.2.2 jdolecek ')
46 1.1.1.5.2.2 jdolecek
47 1.1.1.5.2.2 jdolecek /******************************************************************************
48 1.1.1.5.2.2 jdolecek *
49 1.1.1.5.2.2 jdolecek * Local support functions
50 1.1.1.5.2.2 jdolecek *
51 1.1.1.5.2.2 jdolecek *****************************************************************************/
52 1.1.1.5.2.2 jdolecek
53 1.1.1.5.2.2 jdolecek /*! [Begin] no source code translation */
54 1.1.1.5.2.2 jdolecek int
55 1.1.1.5.2.2 jdolecek AslCompilerwrap(void)
56 1.1.1.5.2.2 jdolecek {
57 1.1.1.5.2.2 jdolecek return (1);
58 1.1.1.5.2.2 jdolecek }
59 1.1.1.5.2.2 jdolecek /*! [End] no source code translation !*/
60 1.1.1.5.2.2 jdolecek
61 1.1.1.5.2.2 jdolecek
62 1.1.1.5.2.2 jdolecek void *
63 1.1.1.5.2.2 jdolecek AslLocalAllocate (
64 1.1.1.5.2.2 jdolecek unsigned int Size)
65 1.1.1.5.2.2 jdolecek {
66 1.1.1.5.2.2 jdolecek void *Mem;
67 1.1.1.5.2.2 jdolecek
68 1.1.1.5.2.2 jdolecek
69 1.1.1.5.2.2 jdolecek DbgPrint (ASL_PARSE_OUTPUT,
70 1.1.1.5.2.2 jdolecek "\nAslLocalAllocate: Expanding Stack to %u\n\n", Size);
71 1.1.1.5.2.2 jdolecek
72 1.1.1.5.2.2 jdolecek Mem = ACPI_ALLOCATE_ZEROED (Size);
73 1.1.1.5.2.2 jdolecek if (!Mem)
74 1.1.1.5.2.2 jdolecek {
75 1.1.1.5.2.2 jdolecek AslCommonError (ASL_ERROR, ASL_MSG_MEMORY_ALLOCATION,
76 1.1.1.5.2.2 jdolecek Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
77 1.1.1.5.2.2 jdolecek Gbl_InputByteCount, Gbl_CurrentColumn,
78 1.1.1.5.2.2 jdolecek Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
79 1.1.1.5.2.2 jdolecek exit (1);
80 1.1.1.5.2.2 jdolecek }
81 1.1.1.5.2.2 jdolecek
82 1.1.1.5.2.2 jdolecek return (Mem);
83 1.1.1.5.2.2 jdolecek }
84 1.1.1.5.2.2 jdolecek
85 1.1.1.5.2.2 jdolecek ACPI_PARSE_OBJECT *
86 1.1.1.5.2.2 jdolecek AslDoError (
87 1.1.1.5.2.2 jdolecek void)
88 1.1.1.5.2.2 jdolecek {
89 1.1.1.5.2.2 jdolecek
90 1.1.1.5.2.2 jdolecek return (TrCreateLeafOp (PARSEOP_ERRORNODE));
91 1.1.1.5.2.2 jdolecek }
92 1.1.1.5.2.2 jdolecek
93 1.1.1.5.2.2 jdolecek
94 1.1.1.5.2.2 jdolecek /*******************************************************************************
95 1.1.1.5.2.2 jdolecek *
96 1.1.1.5.2.2 jdolecek * FUNCTION: UtGetOpName
97 1.1.1.5.2.2 jdolecek *
98 1.1.1.5.2.2 jdolecek * PARAMETERS: ParseOpcode - Parser keyword ID
99 1.1.1.5.2.2 jdolecek *
100 1.1.1.5.2.2 jdolecek * RETURN: Pointer to the opcode name
101 1.1.1.5.2.2 jdolecek *
102 1.1.1.5.2.2 jdolecek * DESCRIPTION: Get the ascii name of the parse opcode
103 1.1.1.5.2.2 jdolecek *
104 1.1.1.5.2.2 jdolecek ******************************************************************************/
105 1.1.1.5.2.2 jdolecek
106 1.1.1.5.2.2 jdolecek char *
107 1.1.1.5.2.2 jdolecek UtGetOpName (
108 1.1.1.5.2.2 jdolecek UINT32 ParseOpcode)
109 1.1.1.5.2.2 jdolecek {
110 1.1.1.5.2.2 jdolecek #ifdef ASL_YYTNAME_START
111 1.1.1.5.2.2 jdolecek /*
112 1.1.1.5.2.2 jdolecek * First entries (ASL_YYTNAME_START) in yytname are special reserved names.
113 1.1.1.5.2.2 jdolecek * Ignore first 8 characters of the name
114 1.1.1.5.2.2 jdolecek */
115 1.1.1.5.2.2 jdolecek return ((char *) yytname
116 1.1.1.5.2.2 jdolecek [(ParseOpcode - ASL_FIRST_PARSE_OPCODE) + ASL_YYTNAME_START] + 8);
117 1.1.1.5.2.2 jdolecek #else
118 1.1.1.5.2.2 jdolecek return ("[Unknown parser generator]");
119 1.1.1.5.2.2 jdolecek #endif
120 1.1.1.5.2.2 jdolecek }
121