Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 568 → Rev 567

/kernel/trunk/tools/config.py
230,42 → 230,23
defaults[res.group(1)] = res.group(2)
f.close()
 
def check_condition(text, defaults, asked_names):
seen_vars = [ x[0] for x in asked_names ]
ctype = 'cnf'
if ')|' in text or '|(' in text:
ctype = 'dnf'
if ctype == 'cnf':
conds = text.split('&')
else:
conds = text.split('|')
 
def check_condition(text, defaults):
result = True
conds = text.split('&')
for cond in conds:
if cond.startswith('(') and cond.endswith(')'):
cond = cond[1:-1]
inside = check_inside(cond, defaults, ctype, seen_vars)
if ctype == 'cnf' and not inside:
if not check_dnf(cond, defaults):
return False
if ctype == 'dnf' and inside:
return True
return True
 
if ctype == 'cnf':
return True
return False
 
def check_inside(text, defaults, ctype, seen_vars):
def check_dnf(text, defaults):
"""
Check that the condition specified on input line is True
 
only CNF is supported
"""
if ctype == 'cnf':
conds = text.split('|')
else:
conds = text.split('&')
conds = text.split('|')
for cond in conds:
res = re.match(r'^(.*?)(!?=)(.*)$', cond)
if not res:
273,27 → 254,15
condname = res.group(1)
oper = res.group(2)
condval = res.group(3)
if condname not in seen_vars:
raise RuntimeError("Variable %s not defined before being asked." %\
condname)
if not defaults.has_key(condname):
raise RuntimeError("Condition var %s does not exist: %s" % \
(condname,text))
 
if ctype == 'cnf':
if oper == '=' and condval == defaults[condname]:
return True
if oper == '!=' and condval != defaults[condname]:
return True
else:
if oper== '=' and condval != defaults[condname]:
return False
if oper== '!=' and condval == defaults[condname]:
print 2
return False
if ctype=='cnf':
return False
return True
if oper=='=' and condval == defaults[condname]:
return True
if oper == '!=' and condval != defaults[condname]:
return True
return False
 
def parse_config(input, output, dlg, defaults={}, askonly=None):
"Parse configuration file and create Makefile.config on the fly"
335,8 → 304,7
if not res:
raise RuntimeError('Invalid command: %s' % line)
if res.group(1):
if not check_condition(res.group(1), defaults,
asked_names):
if not check_condition(res.group(1), defaults):
continue
args = res.group(2).strip().split(' ')
cmd = args[0].lower()
366,8 → 334,7
default = defaults.get(varname,None)
if res.group(1):
if not check_condition(res.group(1), defaults,
asked_names):
if not check_condition(res.group(1), defaults):
if default is not None:
outf.write('#!# %s = %s\n' % (varname, default))
# Clear cumulated values
398,8 → 365,7
if not res:
raise RuntimeError("Bad line: %s" % line)
if res.group(1):
if not check_condition(res.group(1),defaults,
asked_names):
if not check_condition(res.group(1),defaults):
continue
choices.append((res.group(2), res.group(3)))
continue
467,7 → 433,7
os.rename(TMPOUTPUT, OUTPUT)
if not defmode and dlg.yesno('Rebuild kernel?') == 'y':
os.execlp('make','make','clean','build')
os.execlp('make','make','clean','all')
 
if __name__ == '__main__':
main()
/kernel/trunk/arch/mips32/Makefile.inc
73,6 → 73,14
TOOLCHAIN_DIR = /usr/local/mips/bin
CFLAGS += -EB -DBIG_ENDIAN -DHAVE_FPU -mips3
endif
ifeq ($(MIPS_MACHINE),msim4kc)
# MSIM needs lwl/swl patch & 4kc instruction patch to work
# otherwise add -mmemcpy -mips3
BFD_NAME = elf32-tradlittlemips
BFD = binary
CFLAGS += -mhard-float -march=4kc
endif
ifeq ($(MIPS_MACHINE),simics)
# SIMICS 4kc emulation is broken, although for instructions
# that do not bother us
87,7 → 95,13
CFLAGS += -mhard-float -mips3
endif
 
## Accepted configuration directives
#
 
ifeq ($(CONFIG_FPU_LAZY),y)
DEFS += -DCONFIG_FPU_LAZY
endif
 
ARCH_SOURCES = \
arch/$(ARCH)/src/start.S \
arch/$(ARCH)/src/context.S \
/kernel/trunk/arch/amd64/Makefile.inc
67,6 → 67,9
ifeq ($(CONFIG_HT),y)
DEFS += -DCONFIG_HT
endif
ifeq ($(CONFIG_FPU_LAZY),y)
DEFS += -DCONFIG_FPU_LAZY
endif
 
ARCH_SOURCES = \
arch/$(ARCH)/src/dummy.s \
/kernel/trunk/arch/ia32/Makefile.inc
86,6 → 86,9
ifeq ($(CONFIG_HT),y)
DEFS += -DCONFIG_HT
endif
ifeq ($(CONFIG_FPU_LAZY),y)
DEFS += -DCONFIG_FPU_LAZY
endif
 
ARCH_SOURCES = \
arch/$(ARCH)/src/context.s \
/kernel/trunk/kernel.config
36,8 → 36,18
@ "prescott" Prescott
! [ARCH=ia32] IA32_CPU (choice)
 
# Support for SMP
! CONFIG_SMP (y/n)
 
# Improved support for hyperthreading
! [(ARCH=ia32|ARCH=amd64)&CONFIG_SMP=y] CONFIG_HT (y/n)
 
# Lazy FPU context switching
! CONFIG_FPU_LAZY (y/n)
 
# MIPS Machine Type
@ "msim" MSIM Simulator
@ "msim4kc" MSIM Simulator with 4kc instruction set
@ "simics" Virtutech Simics simulator
@ "lgxemul" GXEmul Little Endian
@ "bgxemul" GXEmul Big Endian
44,15 → 54,6
@ "indy" SGI Indy
! [ARCH=mips32] MIPS_MACHINE (choice)
 
# Support for SMP
! [ARCH=ia32|ARCH=amd64] CONFIG_SMP (y/n)
 
# Improved support for hyperthreading
! [(ARCH=ia32|ARCH=amd64)&CONFIG_SMP=y] CONFIG_HT (y/n)
 
# Lazy FPU context switching
! [(ARCH=mips32&MIPS_MACHINE!=msim)|ARCH=amd64|ARCH=ia32] CONFIG_FPU_LAZY (y/n)
 
## Debugging configuration directives
 
# General debuging and assert checking
77,7 → 78,7
@ "synch/semaphore2" Sempahore test 2
@ [ARCH=ia32|ARCH=amd64] "fpu/fpu1" Intel fpu test 1
@ [ARCH=ia32|ARCH=amd64] "fpu/sse1" Intel Sse test 1
@ [ARCH=mips32&MIPS_MACHINE!=msim] "fpu/mips1" Mips FPU test 1
@ [ARCH=mips32&MIPS_MACHINE!=msim&MIPS_MACHINE!=msim4kc] "fpu/mips1" Mips FPU test 1
@ "print/print1" Printf test 1
@ "thread/trhead1" Thread test 1
@ "mm/mapping1" Mapping test 1
/kernel/trunk/Makefile
72,9 → 72,6
ifeq ($(CONFIG_USERSPACE),y)
DEFS += -DCONFIG_USERSPACE
endif
ifeq ($(CONFIG_FPU_LAZY),y)
DEFS += -DCONFIG_FPU_LAZY
endif
 
## Toolchain configuration
#