sconfig: add cpu device type

In order to enumerate CPU devices that are non-x86 (read: no lapic)
provide a generic 'cpu' device.

Upstream patch: http://review.coreboot.org/#/c/6824/

BUG=chrome-os-partner:31761
BRANCH=None
TEST=Built a device tree with 'cpu' entries.

Change-Id: Ic3aa09970e5dd3d175048d698f74e2cce790dff0
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/216424
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
This commit is contained in:
Aaron Durbin 2014-09-03 13:31:33 -05:00 committed by chrome-internal-fetch
commit c6f5fd1a11
6 changed files with 262 additions and 255 deletions

View file

@ -8,7 +8,7 @@
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5
#define YY_FLEX_SUBMINOR_VERSION 35
#define YY_FLEX_SUBMINOR_VERSION 37
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif
@ -141,15 +141,7 @@ typedef unsigned int flex_uint32_t;
/* Size of default input buffer. */
#ifndef YY_BUF_SIZE
#ifdef __ia64__
/* On IA-64, the buffer size is 16k, not 8k.
* Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
* Ditto for the __ia64__ case accordingly.
*/
#define YY_BUF_SIZE 32768
#else
#define YY_BUF_SIZE 16384
#endif /* __ia64__ */
#endif
/* The state buf must be large enough to hold one state per character in the main buffer.
@ -161,7 +153,12 @@ typedef unsigned int flex_uint32_t;
typedef struct yy_buffer_state *YY_BUFFER_STATE;
#endif
extern int yyleng;
#ifndef YY_TYPEDEF_YY_SIZE_T
#define YY_TYPEDEF_YY_SIZE_T
typedef size_t yy_size_t;
#endif
extern yy_size_t yyleng;
extern FILE *yyin, *yyout;
@ -187,11 +184,6 @@ extern FILE *yyin, *yyout;
#define unput(c) yyunput( c, (yytext_ptr) )
#ifndef YY_TYPEDEF_YY_SIZE_T
#define YY_TYPEDEF_YY_SIZE_T
typedef size_t yy_size_t;
#endif
#ifndef YY_STRUCT_YY_BUFFER_STATE
#define YY_STRUCT_YY_BUFFER_STATE
struct yy_buffer_state
@ -209,7 +201,7 @@ struct yy_buffer_state
/* Number of characters read into yy_ch_buf, not including EOB
* characters.
*/
int yy_n_chars;
yy_size_t yy_n_chars;
/* Whether we "own" the buffer - i.e., we know we created it,
* and can realloc() it to grow it, and should free() it to
@ -279,8 +271,8 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
/* yy_hold_char holds the character lost when yytext is formed. */
static char yy_hold_char;
static int yy_n_chars; /* number of characters read into yy_ch_buf */
int yyleng;
static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */
yy_size_t yyleng;
/* Points to current character in buffer. */
static char *yy_c_buf_p = (char *) 0;
@ -308,7 +300,7 @@ static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );
YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len );
void *yyalloc (yy_size_t );
void *yyrealloc (void *,yy_size_t );
@ -368,8 +360,8 @@ static void yy_fatal_error (yyconst char msg[] );
*yy_cp = '\0'; \
(yy_c_buf_p) = yy_cp;
#define YY_NUM_RULES 30
#define YY_END_OF_BUFFER 31
#define YY_NUM_RULES 31
#define YY_END_OF_BUFFER 32
/* This struct is not used in this scanner,
but its presence is necessary. */
struct yy_trans_info
@ -379,19 +371,19 @@ struct yy_trans_info
};
static yyconst flex_int16_t yy_accept[116] =
{ 0,
0, 0, 31, 29, 1, 3, 29, 29, 29, 25,
25, 23, 26, 29, 26, 26, 26, 29, 29, 29,
29, 29, 29, 29, 1, 3, 29, 0, 29, 0,
2, 25, 26, 29, 29, 29, 29, 26, 29, 29,
29, 29, 29, 18, 29, 29, 29, 7, 29, 29,
29, 29, 28, 28, 24, 29, 29, 29, 29, 29,
17, 22, 12, 29, 29, 16, 29, 8, 9, 11,
29, 29, 27, 4, 29, 29, 29, 29, 29, 29,
29, 29, 29, 29, 29, 29, 29, 13, 29, 29,
29, 5, 15, 29, 10, 29, 29, 29, 20, 29,
0, 0, 32, 30, 1, 3, 30, 30, 30, 26,
26, 24, 27, 30, 27, 27, 27, 30, 30, 30,
30, 30, 30, 30, 1, 3, 30, 0, 30, 0,
2, 26, 27, 30, 30, 30, 30, 27, 30, 30,
30, 30, 30, 19, 30, 30, 30, 7, 30, 30,
30, 30, 29, 29, 25, 30, 30, 15, 30, 30,
18, 23, 12, 30, 30, 17, 30, 8, 9, 11,
30, 30, 28, 4, 30, 30, 30, 30, 30, 30,
30, 30, 30, 30, 30, 30, 30, 13, 30, 30,
30, 5, 16, 30, 10, 30, 30, 30, 21, 30,
29, 29, 29, 29, 6, 29, 29, 29, 29, 29,
19, 29, 14, 21, 0
30, 30, 30, 30, 6, 30, 30, 30, 30, 30,
20, 30, 14, 22, 0
} ;
static yyconst flex_int32_t yy_ec[256] =
@ -599,7 +591,7 @@ FILE *yyget_out (void );
void yyset_out (FILE * out_str );
int yyget_leng (void );
yy_size_t yyget_leng (void );
char *yyget_text (void );
@ -641,12 +633,7 @@ static int input (void );
/* Amount of stuff to slurp up with each read. */
#ifndef YY_READ_BUF_SIZE
#ifdef __ia64__
/* On IA-64, the buffer size is 16k, not 8k */
#define YY_READ_BUF_SIZE 16384
#else
#define YY_READ_BUF_SIZE 8192
#endif /* __ia64__ */
#endif
/* Copy whatever the last rule matched to the standard output. */
@ -888,43 +875,43 @@ YY_RULE_SETUP
YY_BREAK
case 15:
YY_RULE_SETUP
{yylval.number=DOMAIN; return(BUS);}
{yylval.number=CPU; return(BUS);}
YY_BREAK
case 16:
YY_RULE_SETUP
{yylval.number=IRQ; return(RESOURCE);}
{yylval.number=DOMAIN; return(BUS);}
YY_BREAK
case 17:
YY_RULE_SETUP
{yylval.number=DRQ; return(RESOURCE);}
{yylval.number=IRQ; return(RESOURCE);}
YY_BREAK
case 18:
YY_RULE_SETUP
{yylval.number=IO; return(RESOURCE);}
{yylval.number=DRQ; return(RESOURCE);}
YY_BREAK
case 19:
YY_RULE_SETUP
{return(IOAPIC_IRQ);}
{yylval.number=IO; return(RESOURCE);}
YY_BREAK
case 20:
YY_RULE_SETUP
{return(INHERIT);}
{return(IOAPIC_IRQ);}
YY_BREAK
case 21:
YY_RULE_SETUP
{return(SUBSYSTEMID);}
{return(INHERIT);}
YY_BREAK
case 22:
YY_RULE_SETUP
{return(END);}
{return(SUBSYSTEMID);}
YY_BREAK
case 23:
YY_RULE_SETUP
{return(EQUALS);}
{return(END);}
YY_BREAK
case 24:
YY_RULE_SETUP
{yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(NUMBER);}
{return(EQUALS);}
YY_BREAK
case 25:
YY_RULE_SETUP
@ -936,18 +923,22 @@ YY_RULE_SETUP
YY_BREAK
case 27:
YY_RULE_SETUP
{yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(PCIINT);}
{yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(NUMBER);}
YY_BREAK
case 28:
/* rule 28 can match eol */
YY_RULE_SETUP
{yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(PCIINT);}
YY_BREAK
case 29:
/* rule 29 can match eol */
YY_RULE_SETUP
{yylval.string = malloc(yyleng-1); strncpy(yylval.string, yytext+1, yyleng-2); yylval.string[yyleng-2]='\0'; return(STRING);}
YY_BREAK
case 29:
case 30:
YY_RULE_SETUP
{yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(STRING);}
YY_BREAK
case 30:
case 31:
YY_RULE_SETUP
ECHO;
YY_BREAK
@ -1136,21 +1127,21 @@ static int yy_get_next_buffer (void)
else
{
int num_to_read =
yy_size_t num_to_read =
YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
while ( num_to_read <= 0 )
{ /* Not enough room in the buffer - grow it. */
/* just a shorter name for the current buffer */
YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
int yy_c_buf_p_offset =
(int) ((yy_c_buf_p) - b->yy_ch_buf);
if ( b->yy_is_our_buffer )
{
int new_size = b->yy_buf_size * 2;
yy_size_t new_size = b->yy_buf_size * 2;
if ( new_size <= 0 )
b->yy_buf_size += b->yy_buf_size / 8;
@ -1181,7 +1172,7 @@ static int yy_get_next_buffer (void)
/* Read in more data. */
YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
(yy_n_chars), (size_t) num_to_read );
(yy_n_chars), num_to_read );
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
}
@ -1276,7 +1267,7 @@ static int yy_get_next_buffer (void)
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
yy_is_jam = (yy_current_state == 115);
return yy_is_jam ? 0 : yy_current_state;
return yy_is_jam ? 0 : yy_current_state;
}
static void yyunput (int c, register char * yy_bp )
@ -1291,7 +1282,7 @@ static int yy_get_next_buffer (void)
if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
{ /* need to shift things up to make room */
/* +2 for EOB chars. */
register int number_to_move = (yy_n_chars) + 2;
register yy_size_t number_to_move = (yy_n_chars) + 2;
register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
register char *source =
@ -1340,7 +1331,7 @@ static int yy_get_next_buffer (void)
else
{ /* need more input */
int offset = (yy_c_buf_p) - (yytext_ptr);
yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
++(yy_c_buf_p);
switch ( yy_get_next_buffer( ) )
@ -1500,10 +1491,6 @@ static void yy_load_buffer_state (void)
yyfree((void *) b );
}
#ifndef __cplusplus
extern int isatty (int );
#endif /* __cplusplus */
/* Initializes or reinitializes a buffer.
* This function is sometimes called more than once on the same buffer,
* such as during a yyrestart() or at EOF.
@ -1616,7 +1603,7 @@ void yypop_buffer_state (void)
*/
static void yyensure_buffer_stack (void)
{
int num_to_alloc;
yy_size_t num_to_alloc;
if (!(yy_buffer_stack)) {
@ -1713,7 +1700,7 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
*
* @return the newly allocated buffer state object.
*/
YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len )
{
YY_BUFFER_STATE b;
char *buf;
@ -1800,7 +1787,7 @@ FILE *yyget_out (void)
/** Get the length of the current token.
*
*/
int yyget_leng (void)
yy_size_t yyget_leng (void)
{
return yyleng;
}

View file

@ -266,6 +266,10 @@ struct device *new_device(struct device *parent, struct device *busdev, const in
new_d->path = ".type=DEVICE_PATH_CPU_CLUSTER,{.cpu_cluster={ .cluster = 0x%x }}";
break;
case CPU:
new_d->path = ".type=DEVICE_PATH_CPU,{.cpu={ .id = 0x%x }}";
break;
case DOMAIN:
new_d->path = ".type=DEVICE_PATH_DOMAIN,{.domain={ .domain = 0x%x }}";
break;

View file

@ -39,6 +39,7 @@ pnp {yylval.number=PNP; return(BUS);}
i2c {yylval.number=I2C; return(BUS);}
lapic {yylval.number=APIC; return(BUS);}
cpu_cluster {yylval.number=CPU_CLUSTER; return(BUS);}
cpu {yylval.number=CPU; return(BUS);}
domain {yylval.number=DOMAIN; return(BUS);}
irq {yylval.number=IRQ; return(RESOURCE);}
drq {yylval.number=DRQ; return(RESOURCE);}

View file

@ -1,8 +1,8 @@
/* A Bison parser, made by GNU Bison 2.5. */
/* A Bison parser, made by GNU Bison 2.7.12-4996. */
/* Bison implementation for Yacc-like parsers in C
Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -44,7 +44,7 @@
#define YYBISON 1
/* Bison version. */
#define YYBISON_VERSION "2.5"
#define YYBISON_VERSION "2.7.12-4996"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
@ -58,8 +58,6 @@
/* Pull parsers. */
#define YYPULL 1
/* Using locations. */
#define YYLSP_NEEDED 0
@ -93,10 +91,13 @@ static struct device *cur_parent, *cur_bus;
/* Enabling traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
#endif
# ifndef YY_NULL
# if defined __cplusplus && 201103L <= __cplusplus
# define YY_NULL nullptr
# else
# define YY_NULL 0
# endif
# endif
/* Enabling verbose error messages. */
#ifdef YYERROR_VERBOSE
@ -106,11 +107,17 @@ static struct device *cur_parent, *cur_bus;
# define YYERROR_VERBOSE 0
#endif
/* Enabling the token table. */
#ifndef YYTOKEN_TABLE
# define YYTOKEN_TABLE 0
/* In a future release of Bison, this section will be replaced
by #include "sconfig.tab.h_shipped". */
#ifndef YY_YY_BUILD_RAMBI_TMP_PORTAGE_SYS_BOOT_COREBOOT_9999_WORK_COREBOOT_9999_UTIL_SCONFIG_SCONFIG_TAB_H_SHIPPED_INCLUDED
# define YY_YY_BUILD_RAMBI_TMP_PORTAGE_SYS_BOOT_COREBOOT_9999_WORK_COREBOOT_9999_UTIL_SCONFIG_SCONFIG_TAB_H_SHIPPED_INCLUDED
/* Enabling traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
#endif
#if YYDEBUG
extern int yydebug;
#endif
/* Tokens. */
#ifndef YYTOKENTYPE
@ -133,21 +140,21 @@ static struct device *cur_parent, *cur_bus;
I2C = 270,
APIC = 271,
CPU_CLUSTER = 272,
DOMAIN = 273,
IRQ = 274,
DRQ = 275,
IO = 276,
NUMBER = 277,
SUBSYSTEMID = 278,
INHERIT = 279,
IOAPIC_IRQ = 280,
IOAPIC = 281,
PCIINT = 282
CPU = 273,
DOMAIN = 274,
IRQ = 275,
DRQ = 276,
IO = 277,
NUMBER = 278,
SUBSYSTEMID = 279,
INHERIT = 280,
IOAPIC_IRQ = 281,
IOAPIC = 282,
PCIINT = 283
};
#endif
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
{
@ -165,6 +172,23 @@ typedef union YYSTYPE
# define YYSTYPE_IS_DECLARED 1
#endif
extern YYSTYPE yylval;
#ifdef YYPARSE_PARAM
#if defined __STDC__ || defined __cplusplus
int yyparse (void *YYPARSE_PARAM);
#else
int yyparse ();
#endif
#else /* ! YYPARSE_PARAM */
#if defined __STDC__ || defined __cplusplus
int yyparse (void);
#else
int yyparse ();
#endif
#endif /* ! YYPARSE_PARAM */
#endif /* !YY_YY_BUILD_RAMBI_TMP_PORTAGE_SYS_BOOT_COREBOOT_9999_WORK_COREBOOT_9999_UTIL_SCONFIG_SCONFIG_TAB_H_SHIPPED_INCLUDED */
/* Copy the second part of user declarations. */
@ -221,24 +245,33 @@ typedef short int yytype_int16;
# if defined YYENABLE_NLS && YYENABLE_NLS
# if ENABLE_NLS
# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
# define YY_(msgid) dgettext ("bison-runtime", msgid)
# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
# endif
# endif
# ifndef YY_
# define YY_(msgid) msgid
# define YY_(Msgid) Msgid
# endif
#endif
#ifndef __attribute__
/* This feature is available in gcc versions 2.5 and later. */
# if (! defined __GNUC__ || __GNUC__ < 2 \
|| (__GNUC__ == 2 && __GNUC_MINOR__ < 5))
# define __attribute__(Spec) /* empty */
# endif
#endif
/* Suppress unused-variable warnings by "using" E. */
#if ! defined lint || defined __GNUC__
# define YYUSE(e) ((void) (e))
# define YYUSE(E) ((void) (E))
#else
# define YYUSE(e) /* empty */
# define YYUSE(E) /* empty */
#endif
/* Identity function, used to suppress warnings about constant conditions. */
#ifndef lint
# define YYID(n) (n)
# define YYID(N) (N)
#else
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
@ -274,6 +307,7 @@ YYID (yyi)
# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
/* Use EXIT_SUCCESS as a witness for stdlib.h. */
# ifndef EXIT_SUCCESS
# define EXIT_SUCCESS 0
# endif
@ -365,20 +399,20 @@ union yyalloc
#endif
#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
/* Copy COUNT objects from FROM to TO. The source and destination do
/* Copy COUNT objects from SRC to DST. The source and destination do
not overlap. */
# ifndef YYCOPY
# if defined __GNUC__ && 1 < __GNUC__
# define YYCOPY(To, From, Count) \
__builtin_memcpy (To, From, (Count) * sizeof (*(From)))
# define YYCOPY(Dst, Src, Count) \
__builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
# else
# define YYCOPY(To, From, Count) \
do \
{ \
YYSIZE_T yyi; \
for (yyi = 0; yyi < (Count); yyi++) \
(To)[yyi] = (From)[yyi]; \
} \
# define YYCOPY(Dst, Src, Count) \
do \
{ \
YYSIZE_T yyi; \
for (yyi = 0; yyi < (Count); yyi++) \
(Dst)[yyi] = (Src)[yyi]; \
} \
while (YYID (0))
# endif
# endif
@ -387,10 +421,10 @@ union yyalloc
/* YYFINAL -- State number of the termination state. */
#define YYFINAL 3
/* YYLAST -- Last index in YYTABLE. */
#define YYLAST 37
#define YYLAST 39
/* YYNTOKENS -- Number of terminals. */
#define YYNTOKENS 28
#define YYNTOKENS 29
/* YYNNTS -- Number of nonterminals. */
#define YYNNTS 13
/* YYNRULES -- Number of rules. */
@ -400,7 +434,7 @@ union yyalloc
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
#define YYUNDEFTOK 2
#define YYMAXUTOK 282
#define YYMAXUTOK 283
#define YYTRANSLATE(YYX) \
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
@ -436,7 +470,7 @@ static const yytype_uint8 yytranslate[] =
2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
25, 26, 27
25, 26, 27, 28
};
#if YYDEBUG
@ -452,14 +486,14 @@ static const yytype_uint8 yyprhs[] =
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
static const yytype_int8 yyrhs[] =
{
29, 0, -1, -1, 30, 33, -1, 31, 35, -1,
31, 33, -1, 31, 38, -1, -1, 32, 35, -1,
32, 33, -1, 32, 37, -1, 32, 39, -1, 32,
40, -1, -1, -1, 3, 12, 34, 31, 9, -1,
-1, 4, 7, 22, 6, 36, 32, 9, -1, 8,
22, 10, 22, -1, 5, 12, 10, 12, -1, 23,
22, 22, -1, 23, 22, 22, 24, -1, 25, 22,
27, 22, -1
30, 0, -1, -1, 31, 34, -1, 32, 36, -1,
32, 34, -1, 32, 39, -1, -1, 33, 36, -1,
33, 34, -1, 33, 38, -1, 33, 40, -1, 33,
41, -1, -1, -1, 3, 12, 35, 32, 9, -1,
-1, 4, 7, 23, 6, 37, 33, 9, -1, 8,
23, 10, 23, -1, 5, 12, 10, 12, -1, 24,
23, 23, -1, 24, 23, 23, 25, -1, 26, 23,
28, 23, -1
};
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
@ -471,17 +505,17 @@ static const yytype_uint8 yyrline[] =
};
#endif
#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
#if YYDEBUG || YYERROR_VERBOSE || 0
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
First, the terminals, then, starting at YYNTOKENS, nonterminals. */
static const char *const yytname[] =
{
"$end", "error", "$undefined", "CHIP", "DEVICE", "REGISTER", "BOOL",
"BUS", "RESOURCE", "END", "EQUALS", "HEX", "STRING", "PCI", "PNP", "I2C",
"APIC", "CPU_CLUSTER", "DOMAIN", "IRQ", "DRQ", "IO", "NUMBER",
"APIC", "CPU_CLUSTER", "CPU", "DOMAIN", "IRQ", "DRQ", "IO", "NUMBER",
"SUBSYSTEMID", "INHERIT", "IOAPIC_IRQ", "IOAPIC", "PCIINT", "$accept",
"devtree", "$@1", "chipchildren", "devicechildren", "chip", "@2",
"device", "@3", "resource", "registers", "subsystemid", "ioapic_irq", 0
"device", "@3", "resource", "registers", "subsystemid", "ioapic_irq", YY_NULL
};
#endif
@ -492,16 +526,16 @@ static const yytype_uint16 yytoknum[] =
{
0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
275, 276, 277, 278, 279, 280, 281, 282
275, 276, 277, 278, 279, 280, 281, 282, 283
};
# endif
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
static const yytype_uint8 yyr1[] =
{
0, 28, 30, 29, 31, 31, 31, 31, 32, 32,
32, 32, 32, 32, 34, 33, 36, 35, 37, 38,
39, 39, 40
0, 29, 31, 30, 32, 32, 32, 32, 33, 33,
33, 33, 33, 33, 35, 34, 37, 36, 38, 39,
40, 40, 41
};
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
@ -533,21 +567,21 @@ static const yytype_int8 yydefgoto[] =
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
STATE-NUM. */
#define YYPACT_NINF -9
#define YYPACT_NINF -10
static const yytype_int8 yypact[] =
{
-9, 3, 1, -9, -2, -9, -9, -9, 4, 5,
-1, -9, -9, -9, -9, -8, 7, 9, 6, -9,
-9, -9, -3, 2, -9, 8, 10, -9, -9, -9,
-9, -9, 11, 12, -4, 13, -5, 14, -9, -9,
-9
-10, 3, 1, -10, -2, -10, -10, -10, 4, 5,
-1, -10, -10, -10, -10, -9, 7, 9, 6, -10,
-10, -10, -3, -4, -10, 2, 8, -10, -10, -10,
-10, -10, 10, 11, 0, 12, 13, 14, -10, -10,
-10
};
/* YYPGOTO[NTERM-NUM]. */
static const yytype_int8 yypgoto[] =
{
-9, -9, -9, -9, -9, -6, -9, 15, -9, -9,
-9, -9, -9
-10, -10, -10, -10, -10, -6, -10, 17, -10, -10,
-10, -10, -10
};
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
@ -557,34 +591,34 @@ static const yytype_int8 yypgoto[] =
static const yytype_uint8 yytable[] =
{
4, 9, 12, 3, 4, 23, 24, 4, 9, 10,
6, 16, 15, 11, 17, 19, 27, 18, 20, 39,
25, 35, 26, 37, 32, 0, 0, 0, 0, 0,
33, 0, 34, 0, 36, 38, 40, 28
6, 16, 15, 11, 17, 19, 27, 18, 20, 32,
35, 25, 0, 26, 0, 33, 0, 0, 37, 0,
0, 34, 0, 0, 36, 38, 0, 40, 39, 28
};
#define yypact_value_is_default(yystate) \
((yystate) == (-9))
#define yypact_value_is_default(Yystate) \
(!!((Yystate) == (-10)))
#define yytable_value_is_error(yytable_value) \
#define yytable_value_is_error(Yytable_value) \
YYID (0)
static const yytype_int8 yycheck[] =
{
3, 4, 8, 0, 3, 8, 9, 3, 4, 5,
12, 12, 7, 9, 22, 6, 22, 10, 12, 24,
23, 10, 25, 27, 22, -1, -1, -1, -1, -1,
22, -1, 22, -1, 22, 22, 22, 22
12, 12, 7, 9, 23, 6, 22, 10, 12, 23,
10, 24, -1, 26, -1, 23, -1, -1, 28, -1,
-1, 23, -1, -1, 23, 23, -1, 23, 25, 22
};
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
symbol of state STATE-NUM. */
static const yytype_uint8 yystos[] =
{
0, 29, 30, 0, 3, 33, 12, 34, 31, 4,
5, 9, 33, 35, 38, 7, 12, 22, 10, 6,
12, 36, 32, 8, 9, 23, 25, 33, 35, 37,
39, 40, 22, 22, 22, 10, 22, 27, 22, 24,
22
0, 30, 31, 0, 3, 34, 12, 35, 32, 4,
5, 9, 34, 36, 39, 7, 12, 23, 10, 6,
12, 37, 33, 8, 9, 24, 26, 34, 36, 38,
40, 41, 23, 23, 23, 10, 23, 28, 23, 25,
23
};
#define yyerrok (yyerrstatus = 0)
@ -614,62 +648,35 @@ static const yytype_uint8 yystos[] =
#define YYRECOVERING() (!!yyerrstatus)
#define YYBACKUP(Token, Value) \
do \
if (yychar == YYEMPTY && yylen == 1) \
{ \
yychar = (Token); \
yylval = (Value); \
YYPOPSTACK (1); \
goto yybackup; \
} \
else \
{ \
#define YYBACKUP(Token, Value) \
do \
if (yychar == YYEMPTY) \
{ \
yychar = (Token); \
yylval = (Value); \
YYPOPSTACK (yylen); \
yystate = *yyssp; \
goto yybackup; \
} \
else \
{ \
yyerror (YY_("syntax error: cannot back up")); \
YYERROR; \
} \
while (YYID (0))
/* Error token number */
#define YYTERROR 1
#define YYERRCODE 256
/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
If N is 0, then set CURRENT to the empty location which ends
the previous symbol: RHS[0] (always defined). */
#define YYRHSLOC(Rhs, K) ((Rhs)[K])
#ifndef YYLLOC_DEFAULT
# define YYLLOC_DEFAULT(Current, Rhs, N) \
do \
if (YYID (N)) \
{ \
(Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
(Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
(Current).last_line = YYRHSLOC (Rhs, N).last_line; \
(Current).last_column = YYRHSLOC (Rhs, N).last_column; \
} \
else \
{ \
(Current).first_line = (Current).last_line = \
YYRHSLOC (Rhs, 0).last_line; \
(Current).first_column = (Current).last_column = \
YYRHSLOC (Rhs, 0).last_column; \
} \
while (YYID (0))
#endif
/* This macro is provided for backward compatibility. */
#ifndef YY_LOCATION_PRINT
# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
#endif
/* YYLEX -- calling `yylex' with the right arguments. */
#ifdef YYLEX_PARAM
# define YYLEX yylex (YYLEX_PARAM)
#else
@ -719,6 +726,8 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep)
YYSTYPE const * const yyvaluep;
#endif
{
FILE *yyo = yyoutput;
YYUSE (yyo);
if (!yyvaluep)
return;
# ifdef YYPRINT
@ -727,11 +736,7 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep)
# else
YYUSE (yyoutput);
# endif
switch (yytype)
{
default:
break;
}
YYUSE (yytype);
}
@ -970,12 +975,11 @@ static int
yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
yytype_int16 *yyssp, int yytoken)
{
YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]);
YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
YYSIZE_T yysize = yysize0;
YYSIZE_T yysize1;
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
/* Internationalized format string. */
const char *yyformat = 0;
const char *yyformat = YY_NULL;
/* Arguments of yyformat. */
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
/* Number of reported tokens (one for the "unexpected", one per
@ -1035,11 +1039,13 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
break;
}
yyarg[yycount++] = yytname[yyx];
yysize1 = yysize + yytnamerr (0, yytname[yyx]);
if (! (yysize <= yysize1
&& yysize1 <= YYSTACK_ALLOC_MAXIMUM))
return 2;
yysize = yysize1;
{
YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
if (! (yysize <= yysize1
&& yysize1 <= YYSTACK_ALLOC_MAXIMUM))
return 2;
yysize = yysize1;
}
}
}
}
@ -1059,10 +1065,12 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
# undef YYCASE_
}
yysize1 = yysize + yystrlen (yyformat);
if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
return 2;
yysize = yysize1;
{
YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
return 2;
yysize = yysize1;
}
if (*yymsg_alloc < yysize)
{
@ -1118,36 +1126,26 @@ yydestruct (yymsg, yytype, yyvaluep)
yymsg = "Deleting";
YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
switch (yytype)
{
default:
break;
}
YYUSE (yytype);
}
/* Prevent warnings from -Wmissing-prototypes. */
#ifdef YYPARSE_PARAM
#if defined __STDC__ || defined __cplusplus
int yyparse (void *YYPARSE_PARAM);
#else
int yyparse ();
#endif
#else /* ! YYPARSE_PARAM */
#if defined __STDC__ || defined __cplusplus
int yyparse (void);
#else
int yyparse ();
#endif
#endif /* ! YYPARSE_PARAM */
/* The lookahead symbol. */
int yychar;
#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
# define YY_IGNORE_MAYBE_UNINITIALIZED_END
#endif
#ifndef YY_INITIAL_VALUE
# define YY_INITIAL_VALUE(Value) /* Nothing. */
#endif
/* The semantic value of the lookahead symbol. */
YYSTYPE yylval;
YYSTYPE yylval YY_INITIAL_VALUE(yyval_default);
/* Number of syntax errors so far. */
int yynerrs;
@ -1187,7 +1185,7 @@ yyparse ()
`yyss': related to states.
`yyvs': related to semantic values.
Refer to the stacks thru separate pointers, to allow yyoverflow
Refer to the stacks through separate pointers, to allow yyoverflow
to reallocate them elsewhere. */
/* The state stack. */
@ -1205,7 +1203,7 @@ yyparse ()
int yyn;
int yyresult;
/* Lookahead token as an internal (translated) token number. */
int yytoken;
int yytoken = 0;
/* The variables used to return semantic value and location from the
action routines. */
YYSTYPE yyval;
@ -1223,9 +1221,8 @@ yyparse ()
Keep to zero when no symbol should be popped. */
int yylen = 0;
yytoken = 0;
yyss = yyssa;
yyvs = yyvsa;
yyssp = yyss = yyssa;
yyvsp = yyvs = yyvsa;
yystacksize = YYINITDEPTH;
YYDPRINTF ((stderr, "Starting parse\n"));
@ -1234,14 +1231,6 @@ yyparse ()
yyerrstatus = 0;
yynerrs = 0;
yychar = YYEMPTY; /* Cause a token to be read. */
/* Initialize stack pointers.
Waste one element of value and location stack
so that they stay on the same level as the state stack.
The wasted elements are never initialized. */
yyssp = yyss;
yyvsp = yyvs;
goto yysetstate;
/*------------------------------------------------------------.
@ -1382,7 +1371,9 @@ yybackup:
yychar = YYEMPTY;
yystate = yyn;
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
*++yyvsp = yylval;
YY_IGNORE_MAYBE_UNINITIALIZED_END
goto yynewstate;
@ -1653,7 +1644,9 @@ yyerrlab1:
YY_STACK_PRINT (yyss, yyssp);
}
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
*++yyvsp = yylval;
YY_IGNORE_MAYBE_UNINITIALIZED_END
/* Shift the error token. */
@ -1677,7 +1670,7 @@ yyabortlab:
yyresult = 1;
goto yyreturn;
#if !defined(yyoverflow) || YYERROR_VERBOSE
#if !defined yyoverflow || YYERROR_VERBOSE
/*-------------------------------------------------.
| yyexhaustedlab -- memory exhaustion comes here. |
`-------------------------------------------------*/
@ -1721,4 +1714,3 @@ yyreturn:

View file

@ -1,8 +1,8 @@
/* A Bison parser, made by GNU Bison 2.5. */
/* A Bison parser, made by GNU Bison 2.7.12-4996. */
/* Bison interface for Yacc-like parsers in C
Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -30,6 +30,15 @@
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
#ifndef YY_YY_BUILD_RAMBI_TMP_PORTAGE_SYS_BOOT_COREBOOT_9999_WORK_COREBOOT_9999_UTIL_SCONFIG_SCONFIG_TAB_H_SHIPPED_INCLUDED
# define YY_YY_BUILD_RAMBI_TMP_PORTAGE_SYS_BOOT_COREBOOT_9999_WORK_COREBOOT_9999_UTIL_SCONFIG_SCONFIG_TAB_H_SHIPPED_INCLUDED
/* Enabling traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
#endif
#if YYDEBUG
extern int yydebug;
#endif
/* Tokens. */
#ifndef YYTOKENTYPE
@ -52,21 +61,21 @@
I2C = 270,
APIC = 271,
CPU_CLUSTER = 272,
DOMAIN = 273,
IRQ = 274,
DRQ = 275,
IO = 276,
NUMBER = 277,
SUBSYSTEMID = 278,
INHERIT = 279,
IOAPIC_IRQ = 280,
IOAPIC = 281,
PCIINT = 282
CPU = 273,
DOMAIN = 274,
IRQ = 275,
DRQ = 276,
IO = 277,
NUMBER = 278,
SUBSYSTEMID = 279,
INHERIT = 280,
IOAPIC_IRQ = 281,
IOAPIC = 282,
PCIINT = 283
};
#endif
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
{
@ -86,4 +95,18 @@ typedef union YYSTYPE
extern YYSTYPE yylval;
#ifdef YYPARSE_PARAM
#if defined __STDC__ || defined __cplusplus
int yyparse (void *YYPARSE_PARAM);
#else
int yyparse ();
#endif
#else /* ! YYPARSE_PARAM */
#if defined __STDC__ || defined __cplusplus
int yyparse (void);
#else
int yyparse ();
#endif
#endif /* ! YYPARSE_PARAM */
#endif /* !YY_YY_BUILD_RAMBI_TMP_PORTAGE_SYS_BOOT_COREBOOT_9999_WORK_COREBOOT_9999_UTIL_SCONFIG_SCONFIG_TAB_H_SHIPPED_INCLUDED */

View file

@ -30,7 +30,7 @@ static struct device *cur_parent, *cur_bus;
int number;
}
%token CHIP DEVICE REGISTER BOOL BUS RESOURCE END EQUALS HEX STRING PCI PNP I2C APIC CPU_CLUSTER DOMAIN IRQ DRQ IO NUMBER SUBSYSTEMID INHERIT IOAPIC_IRQ IOAPIC PCIINT
%token CHIP DEVICE REGISTER BOOL BUS RESOURCE END EQUALS HEX STRING PCI PNP I2C APIC CPU_CLUSTER CPU DOMAIN IRQ DRQ IO NUMBER SUBSYSTEMID INHERIT IOAPIC_IRQ IOAPIC PCIINT
%%
devtree: { cur_parent = cur_bus = head; } chip { postprocess_devtree(); } ;