svn commit: r220680 - in vendor-sys/acpica/dist: compiler
generate/unix
Jung-uk Kim
jkim at FreeBSD.org
Fri Apr 15 21:33:46 UTC 2011
Author: jkim
Date: Fri Apr 15 21:33:45 2011
New Revision: 220680
URL: http://svn.freebsd.org/changeset/base/220680
Log:
Redo r220658. More extensive patch was committed by Intel:
http://git.moblin.org/cgit.cgi/acpica/commit/?id=16c9bbd6a3d8da88664d769ceec2f1757964fc7a
Obtained from: ACPICA
Modified:
vendor-sys/acpica/dist/compiler/Makefile
vendor-sys/acpica/dist/compiler/aslcompiler.y
vendor-sys/acpica/dist/compiler/asldefine.h
vendor-sys/acpica/dist/compiler/aslutils.c
vendor-sys/acpica/dist/compiler/dtparser.y
vendor-sys/acpica/dist/generate/unix/Makefile.config
Modified: vendor-sys/acpica/dist/compiler/Makefile
==============================================================================
--- vendor-sys/acpica/dist/compiler/Makefile Fri Apr 15 20:42:27 2011 (r220679)
+++ vendor-sys/acpica/dist/compiler/Makefile Fri Apr 15 21:33:45 2011 (r220680)
@@ -166,11 +166,15 @@ OBJS = \
INTERMEDIATES = \
aslcompilerlex.c \
- aslcompilerparse.c
+ aslcompilerparse.c \
+ dtparserlex.c \
+ dtparserparse.c
MISC = \
aslcompiler.y.h \
- aslcompilerparse.output
+ aslcompilerparse.output \
+ dtparser.y.h \
+ dtparserparse.output
#
Modified: vendor-sys/acpica/dist/compiler/aslcompiler.y
==============================================================================
--- vendor-sys/acpica/dist/compiler/aslcompiler.y Fri Apr 15 20:42:27 2011 (r220679)
+++ vendor-sys/acpica/dist/compiler/aslcompiler.y Fri Apr 15 21:33:45 2011 (r220680)
@@ -43,14 +43,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define YYDEBUG 1
-#define YYERROR_VERBOSE 1
-
-/*
- * State stack - compiler will fault if it overflows. (Default was 200)
- */
-#define YYINITDEPTH 600
-
#include "aslcompiler.h"
#include <stdio.h>
#include <stdlib.h>
@@ -74,45 +66,40 @@
* ResourceMacroList, and FieldUnitList
*/
+void * AslLocalAllocate (unsigned int Size);
+
+/* Bison/yacc configuration */
-/*
- * Next statement is important - this makes everything public so that
- * we can access some of the parser tables from other modules
- */
#define static
#undef alloca
-#define alloca AslLocalAllocate
-#define YYERROR_VERBOSE 1
+#define alloca AslLocalAllocate
+#define yytname AslCompilername
-void *
-AslLocalAllocate (unsigned int Size);
+#define YYINITDEPTH 600 /* State stack depth */
+#define YYDEBUG 1 /* Enable debug output */
+#define YYERROR_VERBOSE 1 /* Verbose error messages */
/*
* The windows version of bison defines this incorrectly as "32768" (Not negative).
- * Using a custom (edited binary) version of bison that defines YYFLAG as YYFBAD
- * instead (#define YYFBAD 32768), so we can define it correctly here.
+ * We use a custom (edited binary) version of bison that defines YYFLAG as YYFBAD
+ * instead (#define YYFBAD 32768), so we can define it correctly here.
*
* The problem is that if YYFLAG is positive, the extended syntax error messages
* are disabled.
*/
-
#define YYFLAG -32768
-
%}
-
/*
* Declare the type of values in the grammar
*/
-
%union {
UINT64 i;
char *s;
ACPI_PARSE_OBJECT *n;
}
-
/*! [Begin] no source code translation */
/*
@@ -121,14 +108,12 @@ AslLocalAllocate (unsigned int Size);
*/
%expect 60
-
/*
* Token types: These are returned by the lexer
*
* NOTE: This list MUST match the AslKeywordMapping table found
* in aslmap.c EXACTLY! Double check any changes!
*/
-
%token <i> PARSEOP_ACCESSAS
%token <i> PARSEOP_ACCESSATTRIB_BLOCK
%token <i> PARSEOP_ACCESSATTRIB_BLOCK_CALL
@@ -3138,3 +3123,32 @@ AslDoError (void)
return (TrCreateLeafNode (PARSEOP_ERRORNODE));
}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: UtGetOpName
+ *
+ * PARAMETERS: ParseOpcode - Parser keyword ID
+ *
+ * RETURN: Pointer to the opcode name
+ *
+ * DESCRIPTION: Get the ascii name of the parse opcode
+ *
+ ******************************************************************************/
+
+char *
+UtGetOpName (
+ UINT32 ParseOpcode)
+{
+#ifdef ASL_YYTNAME_START
+ /*
+ * First entries (ASL_YYTNAME_START) in yytname are special reserved names.
+ * Ignore first 8 characters of the name
+ */
+ return ((char *) yytname
+ [(ParseOpcode - ASL_FIRST_PARSE_OPCODE) + ASL_YYTNAME_START] + 8);
+#else
+ return ("[Unknown parser generator]");
+#endif
+}
Modified: vendor-sys/acpica/dist/compiler/asldefine.h
==============================================================================
--- vendor-sys/acpica/dist/compiler/asldefine.h Fri Apr 15 20:42:27 2011 (r220679)
+++ vendor-sys/acpica/dist/compiler/asldefine.h Fri Apr 15 21:33:45 2011 (r220680)
@@ -66,12 +66,23 @@
#define ASL_STRING_CACHE_SIZE 32768
#define ASL_FIRST_PARSE_OPCODE PARSEOP_ACCESSAS
-#define ASL_YYTNAME_START 3
-
#define ASL_PARSE_OPCODE_BASE PARSEOP_ACCESSAS /* First Lex type */
/*
+ * Per-parser-generator configuration. These values are used to cheat and
+ * directly access the bison/yacc token name table (yyname or yytname).
+ * Note: These values are the index in yyname for the first lex token
+ * (PARSEOP_ACCCESSAS).
+ */
+#if defined (YYBISON)
+#define ASL_YYTNAME_START 3 /* Bison */
+#elif defined (YYBYACC)
+#define ASL_YYTNAME_START 257 /* Berkeley yacc */
+#endif
+
+
+/*
* Macros
*/
#define ASL_RESDESC_OFFSET(m) ACPI_OFFSET (AML_RESOURCE, m)
@@ -97,6 +108,7 @@
/* filename suffixes for output files */
+#define FILE_SUFFIX_PREPROCESSOR "i"
#define FILE_SUFFIX_AML_CODE "aml"
#define FILE_SUFFIX_LISTING "lst"
#define FILE_SUFFIX_HEX_DUMP "hex"
Modified: vendor-sys/acpica/dist/compiler/aslutils.c
==============================================================================
--- vendor-sys/acpica/dist/compiler/aslutils.c Fri Apr 15 20:42:27 2011 (r220679)
+++ vendor-sys/acpica/dist/compiler/aslutils.c Fri Apr 15 21:33:45 2011 (r220680)
@@ -53,13 +53,6 @@
#define _COMPONENT ACPI_COMPILER
ACPI_MODULE_NAME ("aslutils")
-#ifdef _USE_BERKELEY_YACC
-extern const char * const AslCompilername[];
-static const char * const *yytname = &AslCompilername[254];
-#else
-extern const char * const yytname[];
-#endif
-
char AslHexLookup[] =
{
'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'
@@ -444,32 +437,6 @@ UtSetParseOpName (
/*******************************************************************************
*
- * FUNCTION: UtGetOpName
- *
- * PARAMETERS: ParseOpcode - Parser keyword ID
- *
- * RETURN: Pointer to the opcode name
- *
- * DESCRIPTION: Get the ascii name of the parse opcode
- *
- ******************************************************************************/
-
-char *
-UtGetOpName (
- UINT32 ParseOpcode)
-{
-
- /*
- * First entries (ASL_YYTNAME_START) in yytname are special reserved names.
- * Ignore first 8 characters of the name
- */
- return ((char *) yytname
- [(ParseOpcode - ASL_FIRST_PARSE_OPCODE) + ASL_YYTNAME_START] + 8);
-}
-
-
-/*******************************************************************************
- *
* FUNCTION: UtDisplaySummary
*
* PARAMETERS: FileID - ID of outpout file
Modified: vendor-sys/acpica/dist/compiler/dtparser.y
==============================================================================
--- vendor-sys/acpica/dist/compiler/dtparser.y Fri Apr 15 20:42:27 2011 (r220679)
+++ vendor-sys/acpica/dist/compiler/dtparser.y Fri Apr 15 21:33:45 2011 (r220680)
@@ -42,22 +42,26 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define YYDEBUG 1
-#define YYERROR_VERBOSE 1
-
#include "aslcompiler.h"
#include "dtcompiler.h"
-#define _COMPONENT ACPI_COMPILER
+#define _COMPONENT DT_COMPILER
ACPI_MODULE_NAME ("dtparser")
-UINT64 DtParserResult; /* Global for expression return value */
-
-int DtParserlex (void);
-int DtParserparse (void);
-extern char* DtParsertext;
-extern void DtParsererror (char const * msg);
-#define YYFLAG -32768
+int DtParserlex (void);
+int DtParserparse (void);
+void DtParsererror (char const *msg);
+extern char *DtParsertext;
+extern DT_FIELD *Gbl_CurrentField;
+
+UINT64 DtParserResult; /* Expression return value */
+
+/* Bison/yacc configuration */
+
+#define yytname DtParsername
+#define YYDEBUG 1 /* Enable debug output */
+#define YYERROR_VERBOSE 1 /* Verbose error messages */
+#define YYFLAG -32768
%}
@@ -67,6 +71,8 @@ extern void DtParsererror (c
UINT32 op;
}
+/*! [Begin] no source code translation */
+
%type <value> Expression
%token <op> EXPOP_EOF
@@ -164,17 +170,14 @@ Expression
;
%%
+/*! [End] no source code translation !*/
+
/*
* Local support functions, including parser entry point
*/
-extern DT_FIELD *Gbl_CurrentField;
#define PR_FIRST_PARSE_OPCODE EXPOP_EOF
#define PR_YYTNAME_START 3
-#ifdef _USE_BERKELEY_YACC
-#define yytname DtParsername
-#endif
-
/******************************************************************************
*
@@ -213,13 +216,16 @@ char *
DtGetOpName (
UINT32 ParseOpcode)
{
-
+#ifdef ASL_YYTNAME_START
/*
* First entries (PR_YYTNAME_START) in yytname are special reserved names.
* Ignore first 6 characters of name (EXPOP_)
*/
return ((char *) yytname
[(ParseOpcode - PR_FIRST_PARSE_OPCODE) + PR_YYTNAME_START] + 6);
+#else
+ return ("[Unknown parser generator]");
+#endif
}
Modified: vendor-sys/acpica/dist/generate/unix/Makefile.config
==============================================================================
--- vendor-sys/acpica/dist/generate/unix/Makefile.config Fri Apr 15 20:42:27 2011 (r220679)
+++ vendor-sys/acpica/dist/generate/unix/Makefile.config Fri Apr 15 21:33:45 2011 (r220680)
@@ -77,6 +77,18 @@ CWARNINGFLAGS+= \
#
# Bison/Flex configuration
#
+# -v: verbose, produces a .output file
+# -d: produces the defines header file
+# -y: act like yacc
+#
+# -i: generate case insensitive scanner
+# -s: suppress default rule, abort on unknown input
+#
+# Berkeley yacc configuration
+#
+#YACC= byacc
+#YFLAGS+= -v -d
+#
YACC= bison
YFLAGS+= -v -d -y
More information about the svn-src-all
mailing list