From 10941401e8c040ade7456b0f49ab21c6306791fd Mon Sep 17 00:00:00 2001 From: "Ronald G. Minnich" Date: Thu, 25 Sep 2003 23:03:18 +0000 Subject: allow default settings in the mainboard file git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1137 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- util/newconfig/config.g | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'util') diff --git a/util/newconfig/config.g b/util/newconfig/config.g index 4b8a27f096..6ff9c8a97a 100644 --- a/util/newconfig/config.g +++ b/util/newconfig/config.g @@ -1135,7 +1135,10 @@ def part(type, path, file, name): if (type == 'cpu'): cpudir(path) else: - doconfigfile(srcdir, partdir, file) + if (type == 'mainboard'): + doconfigfile(srcdir, partdir, file, 'mainboard_cfgfile') + else: + doconfigfile(srcdir, partdir, file, 'cfgfile') def partpop(): global dirstack, partstack @@ -1163,7 +1166,7 @@ def dodir(path, file): fullpath = dirstack.tos() debug.info(debug.statement, "DODIR: path %s, fullpath %s" % (path, fullpath)) dirstack.push(os.path.join(fullpath, path)) - doconfigfile(fullpath, path, file) + doconfigfile(fullpath, path, file, 'cfgfile') dirstack.pop() def lookup(name): @@ -1195,12 +1198,12 @@ def setarch(my_arch): setoption('ARCH', my_arch) part('arch', my_arch, 'Config.lb', 0) -def doconfigfile(path, confdir, file): +def doconfigfile(path, confdir, file, rule): rname = os.path.join(confdir, file) loc.push(rname) fullpath = os.path.join(path, rname) fp = safe_open(fullpath, 'r') - if (not parse('cfgfile', fp.read())): + if (not parse(rule, fp.read())): fatal("Could not parse file") exitiferrors() loc.pop() @@ -1482,6 +1485,12 @@ parser Config: rule cfgfile: (uses<<1>>)* (stmt<<1>>)* EOF {{ return 1 }} + #mainboard config files are special, in that they can also have + # default values. + rule mainboard_cfgfile: (uses<<1>>)* + (defstmts<<1>>)* + (stmt<<1>>)* + EOF {{ return 1 }} rule usesid<>: ID {{ if (C): usesoption(ID) }} -- cgit v1.2.3