Add configurable ramstage support for minimal PCI scanning

This CL has changes that allow us to enable a configurable
ramstage, and one change that allows us to minimize PCI
scanning. Minimal scanning is a frequently requested feature.

To enable it, we add two new variables to src/Kconfig
CONFIGURABLE_RAMSTAGE
is the overall variable controlling other options for minimizing the
ramstage.

MINIMAL_PCI_SCANNING is how we indicate we wish to enable minimal
PCI scanning.

Some devices must be scanned in all cases, such as 0:0.0.

To indicate which devices we must scan, we add a new mandatory
keyword to sconfig

It is used in place of on, off, or hidden, and indicates
a device is enabled and mandatory. Mandatory
devices are always scanned. When MINIMAL_PCI_SCANNING is enabled,
ONLY mandatory devices are scanned.

We further add support in src/device/pci_device.c to manage
both MINIMAL_PCI_SCANNING and mandatory devices.

Finally, to show how this works in practice, we add mandatory
keywords to 3 devices on the qemu-q35.

TEST=
1. This is tested and working on the qemu-q35 target.
2. On CML-Hatch

Before CL:
Total Boot time: ~685ms

After CL:
Total Boot time: ~615ms

Change-Id: I2073d9f8e9297c2b02530821ebb634ea2a5c758e
Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36221
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Jeremy Soller <jeremy@system76.com>
This commit is contained in:
Ronald G. Minnich 2019-10-22 02:02:24 +00:00 committed by ron minnich
parent 91dc1e74a5
commit 466ca2c1ad
11 changed files with 387 additions and 355 deletions

View File

@ -354,6 +354,21 @@ config RAMPAYLOAD
Skip PCI enumeration logic and only allocate BAR for fixed devices Skip PCI enumeration logic and only allocate BAR for fixed devices
(bootable devices, TPM over GSPI). (bootable devices, TPM over GSPI).
config CONFIGURABLE_RAMSTAGE
bool "Enable a configurable ramstage."
default y if ARCH_X86
help
A configurable ramstage allows you to select which parts of the ramstage
to run. Currently, we can only select a minimal PCI scanning step.
The minimal PCI scanning will only check those parts that are enabled
in the devicetree.cb. By convention none of those devices should be bridges.
config MINIMAL_PCI_SCANNING
bool "Enable minimal PCI scanning"
depends on CONFIGURABLE_RAMSTAGE
help
If this option is enabled, coreboot will scan only devices
marked as mandatory in devicetree.cb
endmenu endmenu
menu "Mainboard" menu "Mainboard"

View File

@ -1195,6 +1195,12 @@ void pci_scan_bus(struct bus *bus, unsigned int min_devfn,
* non-existence and single function devices. * non-existence and single function devices.
*/ */
for (devfn = min_devfn; devfn <= max_devfn; devfn++) { for (devfn = min_devfn; devfn <= max_devfn; devfn++) {
if (CONFIG(MINIMAL_PCI_SCANNING)) {
dev = pcidev_path_behind(bus, devfn);
if (!dev || !dev->mandatory)
continue;
}
/* First thing setup the device structure. */ /* First thing setup the device structure. */
dev = pci_scan_get_dev(bus, devfn); dev = pci_scan_get_dev(bus, devfn);

View File

@ -119,7 +119,10 @@ struct device {
unsigned int initialized : 1; /* 1 if we have initialized the device */ unsigned int initialized : 1; /* 1 if we have initialized the device */
unsigned int on_mainboard : 1; unsigned int on_mainboard : 1;
unsigned int disable_pcie_aspm : 1; unsigned int disable_pcie_aspm : 1;
unsigned int hidden : 1; /* set if we should hide from UI */ /* set if we should hide from UI */
unsigned int hidden : 1;
/* set if this device is used even in minimum PCI cases */
unsigned int mandatory : 1;
u8 command; u8 command;
uint16_t hotplug_buses; /* Number of hotplug buses to allocate */ uint16_t hotplug_buses; /* Number of hotplug buses to allocate */

View File

@ -5,10 +5,10 @@ chip mainboard/emulation/qemu-q35
end end
end end
device domain 0 on device domain 0 on
device pci 0.0 on end # northbridge (q35) device pci 0.0 mandatory end # northbridge (q35)
chip southbridge/intel/i82801ix chip southbridge/intel/i82801ix
# present unconditionally # present unconditionally
device pci 1f.0 on end # LPC device pci 1f.0 mandatory end # LPC
device pci 1f.2 on end # SATA device pci 1f.2 on end # SATA
device pci 1f.3 on end # SMBus device pci 1f.3 on end # SMBus

View File

@ -6,7 +6,7 @@
#define FLEX_SCANNER #define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 6 #define YY_FLEX_MINOR_VERSION 6
#define YY_FLEX_SUBMINOR_VERSION 1 #define YY_FLEX_SUBMINOR_VERSION 4
#if YY_FLEX_SUBMINOR_VERSION > 0 #if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA #define FLEX_BETA
#endif #endif
@ -81,10 +81,16 @@ typedef unsigned int flex_uint32_t;
#define UINT32_MAX (4294967295U) #define UINT32_MAX (4294967295U)
#endif #endif
#ifndef SIZE_MAX
#define SIZE_MAX (~(size_t)0)
#endif
#endif /* ! C99 */ #endif /* ! C99 */
#endif /* ! FLEXINT_H */ #endif /* ! FLEXINT_H */
/* begin standard C++ headers. */
/* TODO: this is always defined, so inline it */ /* TODO: this is always defined, so inline it */
#define yyconst const #define yyconst const
@ -97,32 +103,26 @@ typedef unsigned int flex_uint32_t;
/* Returned upon end-of-file. */ /* Returned upon end-of-file. */
#define YY_NULL 0 #define YY_NULL 0
/* Promotes a possibly negative, possibly signed char to an unsigned /* Promotes a possibly negative, possibly signed char to an
* integer for use as an array index. If the signed char is negative, * integer in range [0..255] for use as an array index.
* we want to instead treat it as an 8-bit unsigned char, hence the
* double cast.
*/ */
#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) #define YY_SC_TO_UI(c) ((YY_CHAR) (c))
/* Enter a start condition. This macro really ought to take a parameter, /* Enter a start condition. This macro really ought to take a parameter,
* but we do it the disgusting crufty way forced on us by the ()-less * but we do it the disgusting crufty way forced on us by the ()-less
* definition of BEGIN. * definition of BEGIN.
*/ */
#define BEGIN (yy_start) = 1 + 2 * #define BEGIN (yy_start) = 1 + 2 *
/* Translate the current start state into a value that can be later handed /* Translate the current start state into a value that can be later handed
* to BEGIN to return to the state. The YYSTATE alias is for lex * to BEGIN to return to the state. The YYSTATE alias is for lex
* compatibility. * compatibility.
*/ */
#define YY_START (((yy_start) - 1) / 2) #define YY_START (((yy_start) - 1) / 2)
#define YYSTATE YY_START #define YYSTATE YY_START
/* Action number for EOF rule of a given start state. */ /* Action number for EOF rule of a given start state. */
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
/* Special action meaning "start processing a new file". */ /* Special action meaning "start processing a new file". */
#define YY_NEW_FILE yyrestart(yyin ) #define YY_NEW_FILE yyrestart( yyin )
#define YY_END_OF_BUFFER_CHAR 0 #define YY_END_OF_BUFFER_CHAR 0
/* Size of default input buffer. */ /* Size of default input buffer. */
@ -159,16 +159,14 @@ extern FILE *yyin, *yyout;
#define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_CONTINUE_SCAN 0
#define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_END_OF_FILE 1
#define EOB_ACT_LAST_MATCH 2 #define EOB_ACT_LAST_MATCH 2
#define YY_LESS_LINENO(n) #define YY_LESS_LINENO(n)
#define YY_LINENO_REWIND_TO(ptr) #define YY_LINENO_REWIND_TO(ptr)
/* Return all but the first "n" matched characters back to the input stream. */ /* Return all but the first "n" matched characters back to the input stream. */
#define yyless(n) \ #define yyless(n) \
do \ do \
{ \ { \
/* Undo effects of setting up yytext. */ \ /* Undo effects of setting up yytext. */ \
yy_size_t yyless_macro_arg = (n); \ int yyless_macro_arg = (n); \
YY_LESS_LINENO(yyless_macro_arg);\ YY_LESS_LINENO(yyless_macro_arg);\
*yy_cp = (yy_hold_char); \ *yy_cp = (yy_hold_char); \
YY_RESTORE_YY_MORE_OFFSET \ YY_RESTORE_YY_MORE_OFFSET \
@ -176,7 +174,6 @@ extern FILE *yyin, *yyout;
YY_DO_BEFORE_ACTION; /* set up yytext again */ \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \
} \ } \
while ( 0 ) while ( 0 )
#define unput(c) yyunput( c, (yytext_ptr) ) #define unput(c) yyunput( c, (yytext_ptr) )
#ifndef YY_STRUCT_YY_BUFFER_STATE #ifndef YY_STRUCT_YY_BUFFER_STATE
@ -258,7 +255,6 @@ static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */
#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
? (yy_buffer_stack)[(yy_buffer_stack_top)] \ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
: NULL) : NULL)
/* Same as previous macro, but useful when we know that the buffer stack is not /* Same as previous macro, but useful when we know that the buffer stack is not
* NULL or when we need an lvalue. For internal use only. * NULL or when we need an lvalue. For internal use only.
*/ */
@ -279,62 +275,56 @@ static int yy_start = 0; /* start state number */
*/ */
static int yy_did_buffer_switch_on_eof; static int yy_did_buffer_switch_on_eof;
void yyrestart (FILE *input_file ); void yyrestart ( FILE *input_file );
void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer );
YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size );
void yy_delete_buffer (YY_BUFFER_STATE b ); void yy_delete_buffer ( YY_BUFFER_STATE b );
void yy_flush_buffer (YY_BUFFER_STATE b ); void yy_flush_buffer ( YY_BUFFER_STATE b );
void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); void yypush_buffer_state ( YY_BUFFER_STATE new_buffer );
void yypop_buffer_state (void ); void yypop_buffer_state ( void );
static void yyensure_buffer_stack (void ); static void yyensure_buffer_stack ( void );
static void yy_load_buffer_state (void ); static void yy_load_buffer_state ( void );
static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file );
#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER )
#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size );
YY_BUFFER_STATE yy_scan_string ( const char *yy_str );
YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len );
YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); void *yyalloc ( yy_size_t );
YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); void *yyrealloc ( void *, yy_size_t );
YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ); void yyfree ( void * );
void *yyalloc (yy_size_t );
void *yyrealloc (void *,yy_size_t );
void yyfree (void * );
#define yy_new_buffer yy_create_buffer #define yy_new_buffer yy_create_buffer
#define yy_set_interactive(is_interactive) \ #define yy_set_interactive(is_interactive) \
{ \ { \
if ( ! YY_CURRENT_BUFFER ){ \ if ( ! YY_CURRENT_BUFFER ){ \
yyensure_buffer_stack (); \ yyensure_buffer_stack (); \
YY_CURRENT_BUFFER_LVALUE = \ YY_CURRENT_BUFFER_LVALUE = \
yy_create_buffer(yyin,YY_BUF_SIZE ); \ yy_create_buffer( yyin, YY_BUF_SIZE ); \
} \ } \
YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
} }
#define yy_set_bol(at_bol) \ #define yy_set_bol(at_bol) \
{ \ { \
if ( ! YY_CURRENT_BUFFER ){\ if ( ! YY_CURRENT_BUFFER ){\
yyensure_buffer_stack (); \ yyensure_buffer_stack (); \
YY_CURRENT_BUFFER_LVALUE = \ YY_CURRENT_BUFFER_LVALUE = \
yy_create_buffer(yyin,YY_BUF_SIZE ); \ yy_create_buffer( yyin, YY_BUF_SIZE ); \
} \ } \
YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
} }
#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
/* Begin user sect3 */ /* Begin user sect3 */
typedef flex_uint8_t YY_CHAR;
typedef unsigned char YY_CHAR;
FILE *yyin = NULL, *yyout = NULL; FILE *yyin = NULL, *yyout = NULL;
typedef int yy_state_type; typedef int yy_state_type;
extern int yylineno; extern int yylineno;
int yylineno = 1; int yylineno = 1;
extern char *yytext; extern char *yytext;
@ -343,10 +333,10 @@ extern char *yytext;
#endif #endif
#define yytext_ptr yytext #define yytext_ptr yytext
static yy_state_type yy_get_previous_state (void ); static yy_state_type yy_get_previous_state ( void );
static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); static yy_state_type yy_try_NUL_trans ( yy_state_type current_state );
static int yy_get_next_buffer (void ); static int yy_get_next_buffer ( void );
static void yynoreturn yy_fatal_error (yyconst char* msg ); static void yynoreturn yy_fatal_error ( const char* msg );
/* Done after the current pattern has been matched and before the /* Done after the current pattern has been matched and before the
* corresponding action - sets up yytext. * corresponding action - sets up yytext.
@ -357,9 +347,8 @@ static void yynoreturn yy_fatal_error (yyconst char* msg );
(yy_hold_char) = *yy_cp; \ (yy_hold_char) = *yy_cp; \
*yy_cp = '\0'; \ *yy_cp = '\0'; \
(yy_c_buf_p) = yy_cp; (yy_c_buf_p) = yy_cp;
#define YY_NUM_RULES 39
#define YY_NUM_RULES 38 #define YY_END_OF_BUFFER 40
#define YY_END_OF_BUFFER 39
/* This struct is not used in this scanner, /* This struct is not used in this scanner,
but its presence is necessary. */ but its presence is necessary. */
struct yy_trans_info struct yy_trans_info
@ -367,28 +356,29 @@ struct yy_trans_info
flex_int32_t yy_verify; flex_int32_t yy_verify;
flex_int32_t yy_nxt; flex_int32_t yy_nxt;
}; };
static yyconst flex_int16_t yy_accept[160] = static const flex_int16_t yy_accept[168] =
{ 0, { 0,
0, 0, 39, 37, 1, 3, 37, 37, 37, 32, 0, 0, 40, 38, 1, 3, 38, 38, 38, 33,
32, 30, 33, 37, 33, 33, 33, 37, 37, 37, 33, 31, 34, 38, 34, 34, 34, 38, 38, 38,
37, 37, 37, 37, 37, 37, 37, 37, 1, 3, 38, 38, 38, 38, 38, 38, 38, 38, 1, 3,
37, 0, 37, 37, 0, 2, 32, 33, 37, 37, 38, 0, 38, 38, 0, 2, 33, 34, 38, 38,
37, 37, 33, 37, 37, 37, 37, 37, 37, 37, 38, 38, 34, 38, 38, 38, 38, 38, 38, 38,
24, 37, 37, 37, 37, 7, 37, 37, 37, 37, 25, 38, 38, 38, 38, 38, 7, 38, 38, 38,
37, 37, 37, 36, 36, 37, 0, 31, 37, 37, 38, 38, 38, 38, 37, 37, 38, 0, 32, 38,
16, 37, 37, 23, 28, 37, 37, 13, 37, 37, 38, 17, 38, 38, 24, 29, 38, 38, 14, 38,
22, 37, 37, 8, 10, 12, 37, 37, 20, 37, 38, 23, 38, 38, 38, 8, 11, 13, 38, 38,
21, 37, 0, 34, 4, 37, 37, 37, 37, 37, 21, 38, 22, 38, 0, 35, 4, 38, 38, 38,
37, 37, 37, 19, 37, 37, 37, 35, 35, 37, 38, 38, 38, 38, 38, 38, 20, 38, 38, 38,
37, 37, 37, 37, 37, 37, 14, 37, 37, 37, 36, 36, 38, 38, 38, 38, 38, 38, 38, 15,
37, 5, 17, 37, 9, 37, 11, 37, 37, 37, 38, 38, 38, 38, 38, 5, 18, 38, 9, 38,
37, 18, 26, 37, 37, 37, 37, 37, 37, 6, 12, 38, 38, 38, 38, 38, 19, 27, 38, 38,
37, 37, 37, 37, 37, 37, 37, 25, 37, 37, 38, 38, 38, 38, 38, 38, 6, 38, 38, 38,
15, 37, 27, 37, 37, 37, 37, 29, 0 38, 10, 38, 38, 38, 26, 38, 38, 16, 38,
28, 38, 38, 38, 38, 30, 0
} ; } ;
static yyconst YY_CHAR yy_ec[256] = static const YY_CHAR yy_ec[256] =
{ 0, { 0,
1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
@ -420,7 +410,7 @@ static yyconst YY_CHAR yy_ec[256] =
1, 1, 1, 1, 1 1, 1, 1, 1, 1
} ; } ;
static yyconst YY_CHAR yy_meta[39] = static const YY_CHAR yy_meta[39] =
{ 0, { 0,
1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@ -428,114 +418,118 @@ static yyconst YY_CHAR yy_meta[39] =
1, 1, 1, 1, 1, 1, 1, 1 1, 1, 1, 1, 1, 1, 1, 1
} ; } ;
static yyconst flex_uint16_t yy_base[167] = static const flex_int16_t yy_base[175] =
{ 0, { 0,
0, 0, 227, 0, 224, 228, 222, 37, 41, 38, 0, 0, 235, 0, 232, 236, 230, 37, 41, 38,
187, 0, 44, 209, 54, 78, 60, 201, 196, 45, 195, 0, 44, 217, 54, 78, 60, 209, 204, 45,
203, 192, 42, 47, 197, 62, 184, 0, 214, 228, 211, 48, 42, 52, 206, 62, 193, 0, 223, 236,
77, 210, 88, 69, 211, 228, 0, 87, 104, 198, 88, 219, 93, 79, 220, 236, 0, 93, 104, 207,
187, 176, 93, 183, 178, 188, 179, 186, 186, 180, 196, 185, 96, 192, 187, 197, 188, 195, 195, 189,
186, 171, 171, 175, 177, 0, 173, 167, 173, 177, 195, 180, 180, 181, 183, 185, 0, 181, 175, 181,
169, 175, 174, 0, 228, 101, 186, 0, 179, 159, 185, 177, 183, 182, 0, 236, 115, 194, 0, 187,
172, 162, 169, 0, 0, 164, 164, 0, 162, 152, 167, 180, 170, 177, 0, 0, 172, 172, 0, 170,
0, 156, 151, 0, 0, 0, 154, 153, 0, 144, 160, 0, 164, 168, 158, 0, 0, 0, 161, 160,
0, 171, 170, 0, 0, 155, 154, 147, 139, 149, 0, 151, 0, 178, 177, 0, 0, 162, 161, 154,
137, 143, 148, 0, 133, 136, 126, 0, 228, 137, 146, 156, 144, 150, 155, 156, 0, 139, 142, 132,
141, 133, 135, 131, 133, 138, 0, 122, 122, 121, 0, 236, 143, 147, 139, 141, 137, 139, 144, 0,
118, 0, 0, 133, 0, 117, 134, 128, 132, 113, 128, 127, 127, 126, 123, 0, 0, 138, 0, 122,
113, 0, 0, 120, 112, 110, 121, 94, 95, 0, 139, 125, 132, 136, 117, 117, 0, 0, 124, 116,
94, 92, 97, 86, 85, 84, 76, 0, 71, 78, 115, 113, 124, 97, 98, 91, 0, 102, 100, 98,
0, 67, 0, 61, 55, 32, 29, 0, 228, 40, 83, 0, 80, 83, 74, 0, 60, 63, 0, 63,
129, 131, 133, 135, 137, 139 0, 56, 51, 33, 29, 0, 236, 40, 132, 134,
136, 138, 140, 142
} ; } ;
static yyconst flex_int16_t yy_def[167] = static const flex_int16_t yy_def[175] =
{ 0, { 0,
159, 1, 159, 160, 159, 159, 160, 161, 162, 160, 167, 1, 167, 168, 167, 167, 168, 169, 170, 168,
10, 160, 10, 160, 10, 10, 10, 160, 160, 160, 10, 168, 10, 168, 10, 10, 10, 168, 168, 168,
160, 160, 160, 160, 160, 160, 160, 160, 159, 159, 168, 168, 168, 168, 168, 168, 168, 168, 167, 167,
161, 163, 164, 162, 165, 159, 10, 10, 10, 160, 169, 171, 172, 170, 173, 167, 10, 10, 10, 168,
160, 160, 10, 160, 160, 160, 160, 160, 160, 160, 168, 168, 10, 168, 168, 168, 168, 168, 168, 168,
160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
160, 160, 160, 160, 159, 164, 166, 39, 160, 160, 168, 168, 168, 168, 168, 167, 172, 174, 39, 168,
160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
160, 160, 159, 160, 160, 160, 160, 160, 160, 160, 168, 168, 168, 168, 167, 168, 168, 168, 168, 168,
160, 160, 160, 160, 160, 160, 160, 160, 159, 160, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 168, 167, 168, 168, 168, 168, 168, 168, 168, 168,
160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
160, 160, 160, 160, 160, 160, 160, 160, 0, 159, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
159, 159, 159, 159, 159, 159 168, 168, 168, 168, 168, 168, 0, 167, 167, 167,
167, 167, 167, 167
} ; } ;
static yyconst flex_uint16_t yy_nxt[267] = static const flex_int16_t yy_nxt[275] =
{ 0, { 0,
4, 5, 6, 7, 8, 9, 10, 11, 10, 12, 4, 5, 6, 7, 8, 9, 10, 11, 10, 12,
13, 13, 14, 4, 4, 4, 13, 13, 15, 16, 13, 13, 14, 4, 4, 4, 13, 13, 15, 16,
17, 13, 18, 19, 20, 21, 22, 4, 23, 24, 17, 13, 18, 19, 20, 21, 22, 4, 23, 24,
4, 25, 26, 4, 27, 4, 4, 4, 32, 32, 4, 25, 26, 4, 27, 4, 4, 4, 32, 32,
28, 33, 35, 36, 37, 37, 37, 158, 38, 38, 28, 33, 35, 36, 37, 37, 37, 166, 38, 38,
38, 38, 38, 49, 38, 38, 38, 38, 38, 38, 38, 38, 38, 49, 38, 38, 38, 38, 38, 38,
38, 38, 38, 55, 157, 57, 38, 38, 38, 56, 38, 38, 38, 56, 54, 165, 38, 38, 38, 57,
35, 36, 50, 51, 58, 156, 52, 41, 32, 32, 58, 164, 50, 51, 55, 163, 52, 41, 162, 59,
155, 64, 154, 42, 38, 38, 38, 46, 60, 67, 35, 36, 161, 42, 38, 38, 38, 46, 61, 32,
67, 61, 28, 38, 38, 38, 62, 153, 43, 38, 32, 62, 65, 160, 68, 68, 63, 28, 43, 38,
38, 38, 67, 67, 152, 92, 44, 151, 150, 45, 38, 38, 38, 38, 38, 159, 44, 158, 157, 45,
68, 68, 68, 149, 68, 68, 148, 147, 146, 145, 69, 69, 69, 156, 69, 69, 68, 68, 155, 94,
68, 68, 68, 68, 68, 68, 144, 143, 72, 31, 69, 69, 69, 69, 69, 69, 154, 153, 152, 151,
31, 34, 34, 32, 32, 66, 66, 35, 35, 67, 150, 73, 31, 31, 34, 34, 32, 32, 67, 67,
67, 142, 141, 140, 139, 138, 137, 136, 135, 134, 35, 35, 68, 68, 149, 148, 147, 146, 145, 144,
143, 142, 141, 140, 139, 138, 137, 136, 135, 134,
133, 132, 131, 130, 129, 128, 127, 126, 125, 124, 133, 132, 131, 130, 129, 128, 127, 126, 125, 124,
123, 122, 121, 120, 119, 118, 117, 116, 115, 114, 123, 122, 121, 120, 119, 118, 117, 116, 115, 114,
113, 112, 111, 110, 109, 108, 107, 106, 105, 104, 113, 112, 111, 110, 109, 108, 107, 106, 105, 104,
103, 102, 101, 100, 99, 98, 97, 96, 95, 94, 103, 102, 101, 100, 99, 98, 97, 96, 95, 93,
93, 91, 90, 89, 88, 87, 86, 85, 84, 83,
82, 81, 80, 79, 78, 77, 76, 75, 74, 73, 92, 91, 90, 89, 88, 87, 86, 85, 84, 83,
71, 70, 69, 36, 65, 29, 63, 59, 54, 53, 82, 81, 80, 79, 78, 77, 76, 75, 74, 72,
48, 47, 40, 39, 30, 29, 159, 3, 159, 159, 71, 70, 36, 66, 29, 64, 60, 53, 48, 47,
159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 40, 39, 30, 29, 167, 3, 167, 167, 167, 167,
159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167,
159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167,
159, 159, 159, 159, 159, 159 167, 167, 167, 167, 167, 167, 167, 167, 167, 167,
167, 167, 167, 167
} ; } ;
static yyconst flex_int16_t yy_chk[267] = static const flex_int16_t yy_chk[275] =
{ 0, { 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 8, 8, 1, 1, 1, 1, 1, 1, 1, 1, 8, 8,
160, 8, 9, 9, 10, 10, 10, 157, 10, 10, 168, 8, 9, 9, 10, 10, 10, 165, 10, 10,
13, 13, 13, 20, 10, 10, 10, 10, 10, 10, 13, 13, 13, 20, 10, 10, 10, 10, 10, 10,
15, 15, 15, 23, 156, 24, 17, 17, 17, 23, 15, 15, 15, 23, 22, 164, 17, 17, 17, 23,
34, 34, 20, 20, 24, 155, 20, 15, 31, 31, 24, 163, 20, 20, 22, 162, 20, 15, 160, 24,
154, 31, 152, 15, 16, 16, 16, 17, 26, 33, 34, 34, 158, 15, 16, 16, 16, 17, 26, 31,
33, 26, 33, 38, 38, 38, 26, 150, 16, 43, 31, 26, 31, 157, 33, 33, 26, 33, 16, 38,
43, 43, 66, 66, 149, 66, 16, 147, 146, 16, 38, 38, 43, 43, 43, 155, 16, 154, 153, 16,
39, 39, 39, 145, 39, 39, 144, 143, 142, 141, 39, 39, 39, 151, 39, 39, 67, 67, 150, 67,
39, 39, 39, 39, 39, 39, 139, 138, 43, 161, 39, 39, 39, 39, 39, 39, 149, 148, 146, 145,
161, 162, 162, 163, 163, 164, 164, 165, 165, 166, 144, 43, 169, 169, 170, 170, 171, 171, 172, 172,
166, 137, 136, 135, 134, 131, 130, 129, 128, 127, 173, 173, 174, 174, 143, 142, 141, 140, 139, 136,
126, 124, 121, 120, 119, 118, 116, 115, 114, 113, 135, 134, 133, 132, 131, 130, 128, 125, 124, 123,
112, 111, 110, 107, 106, 105, 103, 102, 101, 100, 122, 121, 119, 118, 117, 116, 115, 114, 113, 110,
99, 98, 97, 96, 93, 92, 90, 88, 87, 83, 109, 108, 106, 105, 104, 103, 102, 101, 100, 99,
82, 80, 79, 77, 76, 73, 72, 71, 70, 69, 98, 95, 94, 92, 90, 89, 85, 84, 83, 81,
67, 63, 62, 61, 60, 59, 58, 57, 55, 54, 80, 78, 77, 74, 73, 72, 71, 70, 68, 64,
53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 63, 62, 61, 60, 59, 58, 56, 55, 54, 53,
42, 41, 40, 35, 32, 29, 27, 25, 22, 21, 52, 51, 50, 49, 48, 47, 46, 45, 44, 42,
19, 18, 14, 11, 7, 5, 3, 159, 159, 159, 41, 40, 35, 32, 29, 27, 25, 21, 19, 18,
159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 14, 11, 7, 5, 3, 167, 167, 167, 167, 167,
159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167,
159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167,
159, 159, 159, 159, 159, 159 167, 167, 167, 167, 167, 167, 167, 167, 167, 167,
167, 167, 167, 167
} ; } ;
static yy_state_type yy_last_accepting_state; static yy_state_type yy_last_accepting_state;
@ -586,36 +580,36 @@ int linenum = 0;
#define YY_EXTRA_TYPE void * #define YY_EXTRA_TYPE void *
#endif #endif
static int yy_init_globals (void ); static int yy_init_globals ( void );
/* Accessor methods to globals. /* Accessor methods to globals.
These are made visible to non-reentrant scanners for convenience. */ These are made visible to non-reentrant scanners for convenience. */
int yylex_destroy (void ); int yylex_destroy ( void );
int yyget_debug (void ); int yyget_debug ( void );
void yyset_debug (int debug_flag ); void yyset_debug ( int debug_flag );
YY_EXTRA_TYPE yyget_extra (void ); YY_EXTRA_TYPE yyget_extra ( void );
void yyset_extra (YY_EXTRA_TYPE user_defined ); void yyset_extra ( YY_EXTRA_TYPE user_defined );
FILE *yyget_in (void ); FILE *yyget_in ( void );
void yyset_in (FILE * _in_str ); void yyset_in ( FILE * _in_str );
FILE *yyget_out (void ); FILE *yyget_out ( void );
void yyset_out (FILE * _out_str ); void yyset_out ( FILE * _out_str );
int yyget_leng (void ); int yyget_leng ( void );
char *yyget_text (void ); char *yyget_text ( void );
int yyget_lineno (void ); int yyget_lineno ( void );
void yyset_lineno (int _line_number ); void yyset_lineno ( int _line_number );
/* Macros after this point can all be overridden by user definitions in /* Macros after this point can all be overridden by user definitions in
* section 1. * section 1.
@ -623,32 +617,31 @@ void yyset_lineno (int _line_number );
#ifndef YY_SKIP_YYWRAP #ifndef YY_SKIP_YYWRAP
#ifdef __cplusplus #ifdef __cplusplus
extern "C" int yywrap (void ); extern "C" int yywrap ( void );
#else #else
extern int yywrap (void ); extern int yywrap ( void );
#endif #endif
#endif #endif
#ifndef YY_NO_UNPUT #ifndef YY_NO_UNPUT
static void yyunput (int c,char *buf_ptr ); static void yyunput ( int c, char *buf_ptr );
#endif #endif
#ifndef yytext_ptr #ifndef yytext_ptr
static void yy_flex_strncpy (char *,yyconst char *,int ); static void yy_flex_strncpy ( char *, const char *, int );
#endif #endif
#ifdef YY_NEED_STRLEN #ifdef YY_NEED_STRLEN
static int yy_flex_strlen (yyconst char * ); static int yy_flex_strlen ( const char * );
#endif #endif
#ifndef YY_NO_INPUT #ifndef YY_NO_INPUT
#ifdef __cplusplus #ifdef __cplusplus
static int yyinput (void ); static int yyinput ( void );
#else #else
static int input (void ); static int input ( void );
#endif #endif
#endif #endif
@ -781,7 +774,7 @@ YY_DECL
if ( ! YY_CURRENT_BUFFER ) { if ( ! YY_CURRENT_BUFFER ) {
yyensure_buffer_stack (); yyensure_buffer_stack ();
YY_CURRENT_BUFFER_LVALUE = YY_CURRENT_BUFFER_LVALUE =
yy_create_buffer(yyin,YY_BUF_SIZE ); yy_create_buffer( yyin, YY_BUF_SIZE );
} }
yy_load_buffer_state( ); yy_load_buffer_state( );
@ -814,13 +807,13 @@ yy_match:
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{ {
yy_current_state = (int) yy_def[yy_current_state]; yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 160 ) if ( yy_current_state >= 168 )
yy_c = yy_meta[(unsigned int) yy_c]; yy_c = yy_meta[yy_c];
} }
yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c]; yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
++yy_cp; ++yy_cp;
} }
while ( yy_base[yy_current_state] != 228 ); while ( yy_base[yy_current_state] != 236 );
yy_find_action: yy_find_action:
yy_act = yy_accept[yy_current_state]; yy_act = yy_accept[yy_current_state];
@ -880,95 +873,95 @@ YY_RULE_SETUP
YY_BREAK YY_BREAK
case 9: case 9:
YY_RULE_SETUP YY_RULE_SETUP
{yylval.number=3; return(HIDDEN);} {yylval.number=3; return(STATUS);}
YY_BREAK YY_BREAK
case 10: case 10:
YY_RULE_SETUP YY_RULE_SETUP
{yylval.number=PCI; return(BUS);} {yylval.number=5; return(STATUS);}
YY_BREAK YY_BREAK
case 11: case 11:
YY_RULE_SETUP YY_RULE_SETUP
{yylval.number=IOAPIC; return(BUS);} {yylval.number=PCI; return(BUS);}
YY_BREAK YY_BREAK
case 12: case 12:
YY_RULE_SETUP YY_RULE_SETUP
{yylval.number=PNP; return(BUS);} {yylval.number=IOAPIC; return(BUS);}
YY_BREAK YY_BREAK
case 13: case 13:
YY_RULE_SETUP YY_RULE_SETUP
{yylval.number=I2C; return(BUS);} {yylval.number=PNP; return(BUS);}
YY_BREAK YY_BREAK
case 14: case 14:
YY_RULE_SETUP YY_RULE_SETUP
{yylval.number=APIC; return(BUS);} {yylval.number=I2C; return(BUS);}
YY_BREAK YY_BREAK
case 15: case 15:
YY_RULE_SETUP YY_RULE_SETUP
{yylval.number=CPU_CLUSTER; return(BUS);} {yylval.number=APIC; return(BUS);}
YY_BREAK YY_BREAK
case 16: case 16:
YY_RULE_SETUP YY_RULE_SETUP
{yylval.number=CPU; return(BUS);} {yylval.number=CPU_CLUSTER; return(BUS);}
YY_BREAK YY_BREAK
case 17: case 17:
YY_RULE_SETUP YY_RULE_SETUP
{yylval.number=DOMAIN; return(BUS);} {yylval.number=CPU; return(BUS);}
YY_BREAK YY_BREAK
case 18: case 18:
YY_RULE_SETUP YY_RULE_SETUP
{yylval.number=GENERIC; return(BUS);} {yylval.number=DOMAIN; return(BUS);}
YY_BREAK YY_BREAK
case 19: case 19:
YY_RULE_SETUP YY_RULE_SETUP
{yylval.number=MMIO; return(BUS);} {yylval.number=GENERIC; return(BUS);}
YY_BREAK YY_BREAK
case 20: case 20:
YY_RULE_SETUP YY_RULE_SETUP
{yylval.number=SPI; return(BUS);} {yylval.number=MMIO; return(BUS);}
YY_BREAK YY_BREAK
case 21: case 21:
YY_RULE_SETUP YY_RULE_SETUP
{yylval.number=USB; return(BUS);} {yylval.number=SPI; return(BUS);}
YY_BREAK YY_BREAK
case 22: case 22:
YY_RULE_SETUP YY_RULE_SETUP
{yylval.number=IRQ; return(RESOURCE);} {yylval.number=USB; return(BUS);}
YY_BREAK YY_BREAK
case 23: case 23:
YY_RULE_SETUP YY_RULE_SETUP
{yylval.number=DRQ; return(RESOURCE);} {yylval.number=IRQ; return(RESOURCE);}
YY_BREAK YY_BREAK
case 24: case 24:
YY_RULE_SETUP YY_RULE_SETUP
{yylval.number=IO; return(RESOURCE);} {yylval.number=DRQ; return(RESOURCE);}
YY_BREAK YY_BREAK
case 25: case 25:
YY_RULE_SETUP YY_RULE_SETUP
{return(IOAPIC_IRQ);} {yylval.number=IO; return(RESOURCE);}
YY_BREAK YY_BREAK
case 26: case 26:
YY_RULE_SETUP YY_RULE_SETUP
{return(INHERIT);} {return(IOAPIC_IRQ);}
YY_BREAK YY_BREAK
case 27: case 27:
YY_RULE_SETUP YY_RULE_SETUP
{return(SUBSYSTEMID);} {return(INHERIT);}
YY_BREAK YY_BREAK
case 28: case 28:
YY_RULE_SETUP YY_RULE_SETUP
{return(END);} {return(SUBSYSTEMID);}
YY_BREAK YY_BREAK
case 29: case 29:
YY_RULE_SETUP YY_RULE_SETUP
{return(SLOT_DESC);} {return(END);}
YY_BREAK YY_BREAK
case 30: case 30:
YY_RULE_SETUP YY_RULE_SETUP
{return(EQUALS);} {return(SLOT_DESC);}
YY_BREAK YY_BREAK
case 31: case 31:
YY_RULE_SETUP YY_RULE_SETUP
{yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(NUMBER);} {return(EQUALS);}
YY_BREAK YY_BREAK
case 32: case 32:
YY_RULE_SETUP YY_RULE_SETUP
@ -980,12 +973,11 @@ YY_RULE_SETUP
YY_BREAK YY_BREAK
case 34: case 34:
YY_RULE_SETUP 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 YY_BREAK
case 35: case 35:
/* rule 35 can match eol */
YY_RULE_SETUP YY_RULE_SETUP
{yylval.string = malloc(yyleng-1); strncpy(yylval.string, yytext+1, yyleng-2); yylval.string[yyleng-2]='\0'; return(STRING);} {yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(PCIINT);}
YY_BREAK YY_BREAK
case 36: case 36:
/* rule 36 can match eol */ /* rule 36 can match eol */
@ -993,10 +985,15 @@ YY_RULE_SETUP
{yylval.string = malloc(yyleng-1); strncpy(yylval.string, yytext+1, yyleng-2); yylval.string[yyleng-2]='\0'; return(STRING);} {yylval.string = malloc(yyleng-1); strncpy(yylval.string, yytext+1, yyleng-2); yylval.string[yyleng-2]='\0'; return(STRING);}
YY_BREAK YY_BREAK
case 37: case 37:
/* rule 37 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 38:
YY_RULE_SETUP YY_RULE_SETUP
{yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(STRING);} {yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(STRING);}
YY_BREAK YY_BREAK
case 38: case 39:
YY_RULE_SETUP YY_RULE_SETUP
ECHO; ECHO;
YY_BREAK YY_BREAK
@ -1144,7 +1141,7 @@ static int yy_get_next_buffer (void)
{ {
char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
char *source = (yytext_ptr); char *source = (yytext_ptr);
yy_size_t number_to_move, i; int number_to_move, i;
int ret_val; int ret_val;
if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
@ -1173,7 +1170,7 @@ static int yy_get_next_buffer (void)
/* Try to read more data. */ /* Try to read more data. */
/* First move last chars to start of buffer. */ /* First move last chars to start of buffer. */
number_to_move = (yy_size_t) ((yy_c_buf_p) - (yytext_ptr)) - 1; number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1);
for ( i = 0; i < number_to_move; ++i ) for ( i = 0; i < number_to_move; ++i )
*(dest++) = *(source++); *(dest++) = *(source++);
@ -1209,7 +1206,8 @@ static int yy_get_next_buffer (void)
b->yy_ch_buf = (char *) b->yy_ch_buf = (char *)
/* Include room in for 2 EOB chars. */ /* Include room in for 2 EOB chars. */
yyrealloc((void *) b->yy_ch_buf,(yy_size_t) (b->yy_buf_size + 2) ); yyrealloc( (void *) b->yy_ch_buf,
(yy_size_t) (b->yy_buf_size + 2) );
} }
else else
/* Can't grow it, we don't own it. */ /* Can't grow it, we don't own it. */
@ -1241,7 +1239,7 @@ static int yy_get_next_buffer (void)
if ( number_to_move == YY_MORE_ADJ ) if ( number_to_move == YY_MORE_ADJ )
{ {
ret_val = EOB_ACT_END_OF_FILE; ret_val = EOB_ACT_END_OF_FILE;
yyrestart(yyin ); yyrestart( yyin );
} }
else else
@ -1255,12 +1253,15 @@ static int yy_get_next_buffer (void)
else else
ret_val = EOB_ACT_CONTINUE_SCAN; ret_val = EOB_ACT_CONTINUE_SCAN;
if ((int) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
/* Extend the array by 50%, plus the number we really need. */ /* Extend the array by 50%, plus the number we really need. */
int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,(yy_size_t) new_size ); YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
(void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size );
if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
/* "- 2" to take care of EOB's */
YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
} }
(yy_n_chars) += number_to_move; (yy_n_chars) += number_to_move;
@ -1292,10 +1293,10 @@ static int yy_get_next_buffer (void)
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{ {
yy_current_state = (int) yy_def[yy_current_state]; yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 160 ) if ( yy_current_state >= 168 )
yy_c = yy_meta[(unsigned int) yy_c]; yy_c = yy_meta[yy_c];
} }
yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c]; yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
} }
return yy_current_state; return yy_current_state;
@ -1320,11 +1321,11 @@ static int yy_get_next_buffer (void)
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{ {
yy_current_state = (int) yy_def[yy_current_state]; yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 160 ) if ( yy_current_state >= 168 )
yy_c = yy_meta[(unsigned int) yy_c]; yy_c = yy_meta[yy_c];
} }
yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c]; yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
yy_is_jam = (yy_current_state == 159); yy_is_jam = (yy_current_state == 167);
return yy_is_jam ? 0 : yy_current_state; return yy_is_jam ? 0 : yy_current_state;
} }
@ -1394,7 +1395,7 @@ static int yy_get_next_buffer (void)
else else
{ /* need more input */ { /* need more input */
int offset = (yy_c_buf_p) - (yytext_ptr); int offset = (int) ((yy_c_buf_p) - (yytext_ptr));
++(yy_c_buf_p); ++(yy_c_buf_p);
switch ( yy_get_next_buffer( ) ) switch ( yy_get_next_buffer( ) )
@ -1411,7 +1412,7 @@ static int yy_get_next_buffer (void)
*/ */
/* Reset buffer status. */ /* Reset buffer status. */
yyrestart(yyin ); yyrestart( yyin );
/*FALLTHROUGH*/ /*FALLTHROUGH*/
@ -1455,10 +1456,10 @@ static int yy_get_next_buffer (void)
if ( ! YY_CURRENT_BUFFER ){ if ( ! YY_CURRENT_BUFFER ){
yyensure_buffer_stack (); yyensure_buffer_stack ();
YY_CURRENT_BUFFER_LVALUE = YY_CURRENT_BUFFER_LVALUE =
yy_create_buffer(yyin,YY_BUF_SIZE ); yy_create_buffer( yyin, YY_BUF_SIZE );
} }
yy_init_buffer(YY_CURRENT_BUFFER,input_file ); yy_init_buffer( YY_CURRENT_BUFFER, input_file );
yy_load_buffer_state( ); yy_load_buffer_state( );
} }
@ -1515,7 +1516,7 @@ static void yy_load_buffer_state (void)
{ {
YY_BUFFER_STATE b; YY_BUFFER_STATE b;
b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
if ( ! b ) if ( ! b )
YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
@ -1524,13 +1525,13 @@ static void yy_load_buffer_state (void)
/* yy_ch_buf has to be 2 characters longer than the size given because /* yy_ch_buf has to be 2 characters longer than the size given because
* we need to put in 2 end-of-buffer characters. * we need to put in 2 end-of-buffer characters.
*/ */
b->yy_ch_buf = (char *) yyalloc((yy_size_t) (b->yy_buf_size + 2) ); b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) );
if ( ! b->yy_ch_buf ) if ( ! b->yy_ch_buf )
YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
b->yy_is_our_buffer = 1; b->yy_is_our_buffer = 1;
yy_init_buffer(b,file ); yy_init_buffer( b, file );
return b; return b;
} }
@ -1549,9 +1550,9 @@ static void yy_load_buffer_state (void)
YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
if ( b->yy_is_our_buffer ) if ( b->yy_is_our_buffer )
yyfree((void *) b->yy_ch_buf ); yyfree( (void *) b->yy_ch_buf );
yyfree((void *) b ); yyfree( (void *) b );
} }
/* Initializes or reinitializes a buffer. /* Initializes or reinitializes a buffer.
@ -1563,7 +1564,7 @@ static void yy_load_buffer_state (void)
{ {
int oerrno = errno; int oerrno = errno;
yy_flush_buffer(b ); yy_flush_buffer( b );
b->yy_input_file = file; b->yy_input_file = file;
b->yy_fill_buffer = 1; b->yy_fill_buffer = 1;
@ -1666,7 +1667,7 @@ void yypop_buffer_state (void)
*/ */
static void yyensure_buffer_stack (void) static void yyensure_buffer_stack (void)
{ {
int num_to_alloc; yy_size_t num_to_alloc;
if (!(yy_buffer_stack)) { if (!(yy_buffer_stack)) {
@ -1723,7 +1724,7 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
/* They forgot to leave room for the EOB's. */ /* They forgot to leave room for the EOB's. */
return NULL; return NULL;
b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
if ( ! b ) if ( ! b )
YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
@ -1737,7 +1738,7 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
b->yy_fill_buffer = 0; b->yy_fill_buffer = 0;
b->yy_buffer_status = YY_BUFFER_NEW; b->yy_buffer_status = YY_BUFFER_NEW;
yy_switch_to_buffer(b ); yy_switch_to_buffer( b );
return b; return b;
} }
@ -1750,10 +1751,10 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
* @note If you want to scan bytes that may contain NUL values, then use * @note If you want to scan bytes that may contain NUL values, then use
* yy_scan_bytes() instead. * yy_scan_bytes() instead.
*/ */
YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) YY_BUFFER_STATE yy_scan_string (const char * yystr )
{ {
return yy_scan_bytes(yystr,(int) strlen(yystr) ); return yy_scan_bytes( yystr, (int) strlen(yystr) );
} }
/** Setup the input buffer state to scan the given bytes. The next call to yylex() will /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
@ -1763,7 +1764,7 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
* *
* @return the newly allocated buffer state object. * @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 (const char * yybytes, int _yybytes_len )
{ {
YY_BUFFER_STATE b; YY_BUFFER_STATE b;
char *buf; char *buf;
@ -1772,7 +1773,7 @@ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
/* Get memory for full buffer, including space for trailing EOB's. */ /* Get memory for full buffer, including space for trailing EOB's. */
n = (yy_size_t) (_yybytes_len + 2); n = (yy_size_t) (_yybytes_len + 2);
buf = (char *) yyalloc(n ); buf = (char *) yyalloc( n );
if ( ! buf ) if ( ! buf )
YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
@ -1781,7 +1782,7 @@ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
b = yy_scan_buffer(buf,n ); b = yy_scan_buffer( buf, n );
if ( ! b ) if ( ! b )
YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
@ -1797,9 +1798,9 @@ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
#define YY_EXIT_FAILURE 2 #define YY_EXIT_FAILURE 2
#endif #endif
static void yynoreturn yy_fatal_error (yyconst char* msg ) static void yynoreturn yy_fatal_error (const char* msg )
{ {
(void) fprintf( stderr, "%s\n", msg ); fprintf( stderr, "%s\n", msg );
exit( YY_EXIT_FAILURE ); exit( YY_EXIT_FAILURE );
} }
@ -1810,7 +1811,7 @@ static void yynoreturn yy_fatal_error (yyconst char* msg )
do \ do \
{ \ { \
/* Undo effects of setting up yytext. */ \ /* Undo effects of setting up yytext. */ \
yy_size_t yyless_macro_arg = (n); \ int yyless_macro_arg = (n); \
YY_LESS_LINENO(yyless_macro_arg);\ YY_LESS_LINENO(yyless_macro_arg);\
yytext[yyleng] = (yy_hold_char); \ yytext[yyleng] = (yy_hold_char); \
(yy_c_buf_p) = yytext + yyless_macro_arg; \ (yy_c_buf_p) = yytext + yyless_macro_arg; \
@ -1934,7 +1935,7 @@ int yylex_destroy (void)
/* Pop the buffer stack, destroying each element. */ /* Pop the buffer stack, destroying each element. */
while(YY_CURRENT_BUFFER){ while(YY_CURRENT_BUFFER){
yy_delete_buffer(YY_CURRENT_BUFFER ); yy_delete_buffer( YY_CURRENT_BUFFER );
YY_CURRENT_BUFFER_LVALUE = NULL; YY_CURRENT_BUFFER_LVALUE = NULL;
yypop_buffer_state(); yypop_buffer_state();
} }
@ -1955,7 +1956,7 @@ int yylex_destroy (void)
*/ */
#ifndef yytext_ptr #ifndef yytext_ptr
static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) static void yy_flex_strncpy (char* s1, const char * s2, int n )
{ {
int i; int i;
@ -1965,7 +1966,7 @@ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
#endif #endif
#ifdef YY_NEED_STRLEN #ifdef YY_NEED_STRLEN
static int yy_flex_strlen (yyconst char * s ) static int yy_flex_strlen (const char * s )
{ {
int n; int n;
for ( n = 0; s[n]; ++n ) for ( n = 0; s[n]; ++n )

View File

@ -516,6 +516,7 @@ struct device *new_device(struct bus *parent,
new_d->enabled = status & 0x01; new_d->enabled = status & 0x01;
new_d->hidden = (status >> 1) & 0x01; new_d->hidden = (status >> 1) & 0x01;
new_d->mandatory = (status >> 2) & 0x01;
new_d->chip_instance = chip_instance; new_d->chip_instance = chip_instance;
chip_instance->ref_count++; chip_instance->ref_count++;
@ -810,6 +811,7 @@ static void pass1(FILE *fil, FILE *head, struct device *ptr, struct device *next
fprintf(fil, "},\n"); fprintf(fil, "},\n");
fprintf(fil, "\t.enabled = %d,\n", ptr->enabled); fprintf(fil, "\t.enabled = %d,\n", ptr->enabled);
fprintf(fil, "\t.hidden = %d,\n", ptr->hidden); fprintf(fil, "\t.hidden = %d,\n", ptr->hidden);
fprintf(fil, "\t.mandatory = %d,\n", ptr->mandatory);
fprintf(fil, "\t.on_mainboard = 1,\n"); fprintf(fil, "\t.on_mainboard = 1,\n");
if (ptr->subsystem_vendor > 0) if (ptr->subsystem_vendor > 0)
fprintf(fil, "\t.subsystem_vendor = 0x%04x,\n", fprintf(fil, "\t.subsystem_vendor = 0x%04x,\n",

View File

@ -104,6 +104,8 @@ struct device {
/* Indicates device status (enabled / hidden or not). */ /* Indicates device status (enabled / hidden or not). */
int enabled; int enabled;
int hidden; int hidden;
/* non-zero if the device should be included in all cases */
int mandatory;
/* Subsystem IDs for the device. */ /* Subsystem IDs for the device. */
int subsystem_vendor; int subsystem_vendor;

View File

@ -29,7 +29,8 @@ device {return(DEVICE);}
register {return(REGISTER);} register {return(REGISTER);}
on {yylval.number=1; return(BOOL);} on {yylval.number=1; return(BOOL);}
off {yylval.number=0; return(BOOL);} off {yylval.number=0; return(BOOL);}
hidden {yylval.number=3; return(HIDDEN);} hidden {yylval.number=3; return(STATUS);}
mandatory {yylval.number=5; return(STATUS);}
pci {yylval.number=PCI; return(BUS);} pci {yylval.number=PCI; return(BUS);}
ioapic {yylval.number=IOAPIC; return(BUS);} ioapic {yylval.number=IOAPIC; return(BUS);}
pnp {yylval.number=PNP; return(BUS);} pnp {yylval.number=PNP; return(BUS);}

View File

@ -1,8 +1,8 @@
/* A Bison parser, made by GNU Bison 3.0.5. */ /* A Bison parser, made by GNU Bison 3.0.4. */
/* Bison implementation for Yacc-like parsers in C /* Bison implementation for Yacc-like parsers in C
Copyright (C) 1984, 1989-1990, 2000-2015, 2018 Free Software Foundation, Inc. Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -44,7 +44,7 @@
#define YYBISON 1 #define YYBISON 1
/* Bison version. */ /* Bison version. */
#define YYBISON_VERSION "3.0.5" #define YYBISON_VERSION "3.0.4"
/* Skeleton name. */ /* Skeleton name. */
#define YYSKELETON_NAME "yacc.c" #define YYSKELETON_NAME "yacc.c"
@ -109,8 +109,8 @@ static struct chip_instance *cur_chip_instance;
/* In a future release of Bison, this section will be replaced /* In a future release of Bison, this section will be replaced
by #include "sconfig.tab.h_shipped". */ by #include "sconfig.tab.h_shipped". */
#ifndef YY_YY_UTIL_SCONFIG_SCONFIG_TAB_H_SHIPPED_INCLUDED #ifndef YY_YY_HOME_RMINNICH_PROJECTS_LINUXBOOT_COREBOOTNERF_GITHUBCOREBOOT_UTIL_SCONFIG_SCONFIG_TAB_H_SHIPPED_INCLUDED
# define YY_YY_UTIL_SCONFIG_SCONFIG_TAB_H_SHIPPED_INCLUDED # define YY_YY_HOME_RMINNICH_PROJECTS_LINUXBOOT_COREBOOTNERF_GITHUBCOREBOOT_UTIL_SCONFIG_SCONFIG_TAB_H_SHIPPED_INCLUDED
/* Debug traces. */ /* Debug traces. */
#ifndef YYDEBUG #ifndef YYDEBUG
# define YYDEBUG 0 # define YYDEBUG 0
@ -128,34 +128,35 @@ extern int yydebug;
DEVICE = 259, DEVICE = 259,
REGISTER = 260, REGISTER = 260,
BOOL = 261, BOOL = 261,
HIDDEN = 262, STATUS = 262,
BUS = 263, MANDATORY = 263,
RESOURCE = 264, BUS = 264,
END = 265, RESOURCE = 265,
EQUALS = 266, END = 266,
HEX = 267, EQUALS = 267,
STRING = 268, HEX = 268,
PCI = 269, STRING = 269,
PNP = 270, PCI = 270,
I2C = 271, PNP = 271,
APIC = 272, I2C = 272,
CPU_CLUSTER = 273, APIC = 273,
CPU = 274, CPU_CLUSTER = 274,
DOMAIN = 275, CPU = 275,
IRQ = 276, DOMAIN = 276,
DRQ = 277, IRQ = 277,
SLOT_DESC = 278, DRQ = 278,
IO = 279, SLOT_DESC = 279,
NUMBER = 280, IO = 280,
SUBSYSTEMID = 281, NUMBER = 281,
INHERIT = 282, SUBSYSTEMID = 282,
IOAPIC_IRQ = 283, INHERIT = 283,
IOAPIC = 284, IOAPIC_IRQ = 284,
PCIINT = 285, IOAPIC = 285,
GENERIC = 286, PCIINT = 286,
SPI = 287, GENERIC = 287,
USB = 288, SPI = 288,
MMIO = 289 USB = 289,
MMIO = 290
}; };
#endif #endif
@ -184,7 +185,7 @@ extern YYSTYPE yylval;
int yyparse (void); int yyparse (void);
#endif /* !YY_YY_UTIL_SCONFIG_SCONFIG_TAB_H_SHIPPED_INCLUDED */ #endif /* !YY_YY_HOME_RMINNICH_PROJECTS_LINUXBOOT_COREBOOTNERF_GITHUBCOREBOOT_UTIL_SCONFIG_SCONFIG_TAB_H_SHIPPED_INCLUDED */
/* Copy the second part of user declarations. */ /* Copy the second part of user declarations. */
@ -430,10 +431,10 @@ union yyalloc
/* YYFINAL -- State number of the termination state. */ /* YYFINAL -- State number of the termination state. */
#define YYFINAL 3 #define YYFINAL 3
/* YYLAST -- Last index in YYTABLE. */ /* YYLAST -- Last index in YYTABLE. */
#define YYLAST 43 #define YYLAST 40
/* YYNTOKENS -- Number of terminals. */ /* YYNTOKENS -- Number of terminals. */
#define YYNTOKENS 35 #define YYNTOKENS 36
/* YYNNTS -- Number of nonterminals. */ /* YYNNTS -- Number of nonterminals. */
#define YYNNTS 15 #define YYNNTS 15
/* YYNRULES -- Number of rules. */ /* YYNRULES -- Number of rules. */
@ -444,7 +445,7 @@ union yyalloc
/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
by yylex, with out-of-bounds checking. */ by yylex, with out-of-bounds checking. */
#define YYUNDEFTOK 2 #define YYUNDEFTOK 2
#define YYMAXUTOK 289 #define YYMAXUTOK 290
#define YYTRANSLATE(YYX) \ #define YYTRANSLATE(YYX) \
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
@ -481,7 +482,8 @@ static const yytype_uint8 yytranslate[] =
2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
25, 26, 27, 28, 29, 30, 31, 32, 33, 34 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
35
}; };
#if YYDEBUG #if YYDEBUG
@ -500,12 +502,12 @@ static const yytype_uint8 yyrline[] =
static const char *const yytname[] = static const char *const yytname[] =
{ {
"$end", "error", "$undefined", "CHIP", "DEVICE", "REGISTER", "BOOL", "$end", "error", "$undefined", "CHIP", "DEVICE", "REGISTER", "BOOL",
"HIDDEN", "BUS", "RESOURCE", "END", "EQUALS", "HEX", "STRING", "PCI", "STATUS", "MANDATORY", "BUS", "RESOURCE", "END", "EQUALS", "HEX",
"PNP", "I2C", "APIC", "CPU_CLUSTER", "CPU", "DOMAIN", "IRQ", "DRQ", "STRING", "PCI", "PNP", "I2C", "APIC", "CPU_CLUSTER", "CPU", "DOMAIN",
"SLOT_DESC", "IO", "NUMBER", "SUBSYSTEMID", "INHERIT", "IOAPIC_IRQ", "IRQ", "DRQ", "SLOT_DESC", "IO", "NUMBER", "SUBSYSTEMID", "INHERIT",
"IOAPIC", "PCIINT", "GENERIC", "SPI", "USB", "MMIO", "$accept", "IOAPIC_IRQ", "IOAPIC", "PCIINT", "GENERIC", "SPI", "USB", "MMIO",
"devtree", "$@1", "chipchildren", "devicechildren", "chip", "@2", "$accept", "devtree", "$@1", "chipchildren", "devicechildren", "chip",
"device", "@3", "status", "resource", "registers", "subsystemid", "@2", "device", "@3", "status", "resource", "registers", "subsystemid",
"ioapic_irq", "smbios_slot_desc", YY_NULLPTR "ioapic_irq", "smbios_slot_desc", YY_NULLPTR
}; };
#endif #endif
@ -518,7 +520,7 @@ static const yytype_uint16 yytoknum[] =
0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
285, 286, 287, 288, 289 285, 286, 287, 288, 289, 290
}; };
# endif # endif
@ -536,11 +538,11 @@ static const yytype_uint16 yytoknum[] =
STATE-NUM. */ STATE-NUM. */
static const yytype_int8 yypact[] = static const yytype_int8 yypact[] =
{ {
-12, 11, 9, -12, 1, -12, -12, -12, 0, 5, -12, 6, 9, -12, -1, -12, -12, -12, 0, 5,
3, -12, -12, -12, -12, -10, 6, 2, 8, -12, 1, -12, -12, -12, -12, -10, 7, 3, 8, -12,
-12, -12, -12, -12, -3, -1, -12, 13, 4, 7, -12, -12, -12, -12, -3, -9, -12, 11, 2, 4,
-12, -12, -12, -12, -12, -12, 16, 15, 10, -11, -12, -12, -12, -12, -12, -12, 15, 17, 10, -11,
12, 17, -5, 14, -12, 18, -12, -12, -12 12, 18, -5, 13, -12, 19, -12, -12, -12
}; };
/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
@ -558,7 +560,7 @@ static const yytype_uint8 yydefact[] =
/* YYPGOTO[NTERM-NUM]. */ /* YYPGOTO[NTERM-NUM]. */
static const yytype_int8 yypgoto[] = static const yytype_int8 yypgoto[] =
{ {
-12, -12, -12, -12, -12, -6, -12, 19, -12, -12, -12, -12, -12, -12, -12, -6, -12, 16, -12, -12,
-12, -12, -12, -12, -12 -12, -12, -12, -12, -12
}; };
@ -574,39 +576,39 @@ static const yytype_int8 yydefgoto[] =
number is the opposite. If YYTABLE_NINF, syntax error. */ number is the opposite. If YYTABLE_NINF, syntax error. */
static const yytype_uint8 yytable[] = static const yytype_uint8 yytable[] =
{ {
4, 9, 12, 4, 9, 10, 25, 26, 19, 20, 4, 9, 12, 4, 9, 10, 3, 25, 26, 19,
11, 3, 4, 15, 6, 17, 16, 18, 30, 43, 20, 11, 4, 6, 15, 16, 17, 36, 30, 18,
27, 22, 46, 28, 36, 29, 37, 40, 41, 38, 43, 27, 22, 46, 28, 37, 29, 40, 38, 0,
45, 48, 39, 0, 0, 42, 0, 44, 0, 47, 39, 41, 45, 48, 0, 0, 42, 0, 44, 47,
0, 0, 0, 31 31
}; };
static const yytype_int8 yycheck[] = static const yytype_int8 yycheck[] =
{ {
3, 4, 8, 3, 4, 5, 9, 10, 6, 7, 3, 4, 8, 3, 4, 5, 0, 10, 11, 6,
10, 0, 3, 8, 13, 25, 13, 11, 24, 30, 7, 11, 3, 14, 9, 14, 26, 26, 24, 12,
23, 13, 27, 26, 25, 28, 13, 11, 13, 25, 31, 24, 14, 28, 27, 14, 29, 12, 26, -1,
13, 13, 25, -1, -1, 25, -1, 25, -1, 25, 26, 14, 14, 14, -1, -1, 26, -1, 26, 26,
-1, -1, -1, 24 24
}; };
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
symbol of state STATE-NUM. */ symbol of state STATE-NUM. */
static const yytype_uint8 yystos[] = static const yytype_uint8 yystos[] =
{ {
0, 36, 37, 0, 3, 40, 13, 41, 38, 4, 0, 37, 38, 0, 3, 41, 14, 42, 39, 4,
5, 10, 40, 42, 46, 8, 13, 25, 11, 6, 5, 11, 41, 43, 47, 9, 14, 26, 12, 6,
7, 44, 13, 43, 39, 9, 10, 23, 26, 28, 7, 45, 14, 44, 40, 10, 11, 24, 27, 29,
40, 42, 45, 47, 48, 49, 25, 13, 25, 25, 41, 43, 46, 48, 49, 50, 26, 14, 26, 26,
11, 13, 25, 30, 25, 13, 27, 25, 13 12, 14, 26, 31, 26, 14, 28, 26, 14
}; };
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
static const yytype_uint8 yyr1[] = static const yytype_uint8 yyr1[] =
{ {
0, 35, 37, 36, 38, 38, 38, 38, 39, 39, 0, 36, 38, 37, 39, 39, 39, 39, 40, 40,
39, 39, 39, 39, 39, 41, 40, 43, 42, 44, 40, 40, 40, 40, 40, 42, 41, 44, 43, 45,
44, 45, 46, 47, 47, 48, 49, 49, 49 45, 46, 47, 48, 48, 49, 50, 50, 50
}; };
/* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
@ -975,7 +977,6 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
case N: \ case N: \
yyformat = S; \ yyformat = S; \
break break
default: /* Avoid compiler warnings. */
YYCASE_(0, YY_("syntax error")); YYCASE_(0, YY_("syntax error"));
YYCASE_(1, YY_("syntax error, unexpected %s")); YYCASE_(1, YY_("syntax error, unexpected %s"));
YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));

View File

@ -1,8 +1,8 @@
/* A Bison parser, made by GNU Bison 3.0.5. */ /* A Bison parser, made by GNU Bison 3.0.4. */
/* Bison interface for Yacc-like parsers in C /* Bison interface for Yacc-like parsers in C
Copyright (C) 1984, 1989-1990, 2000-2015, 2018 Free Software Foundation, Inc. Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -30,8 +30,8 @@
This special exception was added by the Free Software Foundation in This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */ version 2.2 of Bison. */
#ifndef YY_YY_UTIL_SCONFIG_SCONFIG_TAB_H_SHIPPED_INCLUDED #ifndef YY_YY_HOME_RMINNICH_PROJECTS_LINUXBOOT_COREBOOTNERF_GITHUBCOREBOOT_UTIL_SCONFIG_SCONFIG_TAB_H_SHIPPED_INCLUDED
# define YY_YY_UTIL_SCONFIG_SCONFIG_TAB_H_SHIPPED_INCLUDED # define YY_YY_HOME_RMINNICH_PROJECTS_LINUXBOOT_COREBOOTNERF_GITHUBCOREBOOT_UTIL_SCONFIG_SCONFIG_TAB_H_SHIPPED_INCLUDED
/* Debug traces. */ /* Debug traces. */
#ifndef YYDEBUG #ifndef YYDEBUG
# define YYDEBUG 0 # define YYDEBUG 0
@ -49,34 +49,35 @@ extern int yydebug;
DEVICE = 259, DEVICE = 259,
REGISTER = 260, REGISTER = 260,
BOOL = 261, BOOL = 261,
HIDDEN = 262, STATUS = 262,
BUS = 263, MANDATORY = 263,
RESOURCE = 264, BUS = 264,
END = 265, RESOURCE = 265,
EQUALS = 266, END = 266,
HEX = 267, EQUALS = 267,
STRING = 268, HEX = 268,
PCI = 269, STRING = 269,
PNP = 270, PCI = 270,
I2C = 271, PNP = 271,
APIC = 272, I2C = 272,
CPU_CLUSTER = 273, APIC = 273,
CPU = 274, CPU_CLUSTER = 274,
DOMAIN = 275, CPU = 275,
IRQ = 276, DOMAIN = 276,
DRQ = 277, IRQ = 277,
SLOT_DESC = 278, DRQ = 278,
IO = 279, SLOT_DESC = 279,
NUMBER = 280, IO = 280,
SUBSYSTEMID = 281, NUMBER = 281,
INHERIT = 282, SUBSYSTEMID = 282,
IOAPIC_IRQ = 283, INHERIT = 283,
IOAPIC = 284, IOAPIC_IRQ = 284,
PCIINT = 285, IOAPIC = 285,
GENERIC = 286, PCIINT = 286,
SPI = 287, GENERIC = 287,
USB = 288, SPI = 288,
MMIO = 289 USB = 289,
MMIO = 290
}; };
#endif #endif
@ -105,4 +106,4 @@ extern YYSTYPE yylval;
int yyparse (void); int yyparse (void);
#endif /* !YY_YY_UTIL_SCONFIG_SCONFIG_TAB_H_SHIPPED_INCLUDED */ #endif /* !YY_YY_HOME_RMINNICH_PROJECTS_LINUXBOOT_COREBOOTNERF_GITHUBCOREBOOT_UTIL_SCONFIG_SCONFIG_TAB_H_SHIPPED_INCLUDED */

View File

@ -31,7 +31,7 @@ static struct chip_instance *cur_chip_instance;
int number; int number;
} }
%token CHIP DEVICE REGISTER BOOL HIDDEN BUS RESOURCE END EQUALS HEX STRING PCI PNP I2C APIC CPU_CLUSTER CPU DOMAIN IRQ DRQ SLOT_DESC IO NUMBER SUBSYSTEMID INHERIT IOAPIC_IRQ IOAPIC PCIINT GENERIC SPI USB MMIO %token CHIP DEVICE REGISTER BOOL STATUS MANDATORY BUS RESOURCE END EQUALS HEX STRING PCI PNP I2C APIC CPU_CLUSTER CPU DOMAIN IRQ DRQ SLOT_DESC IO NUMBER SUBSYSTEMID INHERIT IOAPIC_IRQ IOAPIC PCIINT GENERIC SPI USB MMIO
%% %%
devtree: { cur_parent = root_parent; } chip; devtree: { cur_parent = root_parent; } chip;
@ -56,7 +56,7 @@ device: DEVICE BUS NUMBER /* == devnum */ status {
cur_parent = $<dev>5->parent; cur_parent = $<dev>5->parent;
}; };
status: BOOL | HIDDEN; status: BOOL | STATUS ;
resource: RESOURCE NUMBER /* == resnum */ EQUALS NUMBER /* == resval */ resource: RESOURCE NUMBER /* == resnum */ EQUALS NUMBER /* == resval */
{ add_resource(cur_parent, $<number>1, strtol($<string>2, NULL, 0), strtol($<string>4, NULL, 0)); } ; { add_resource(cur_parent, $<number>1, strtol($<string>2, NULL, 0), strtol($<string>4, NULL, 0)); } ;