Changeset 944b15c in mainline


Ignore:
Timestamp:
2005-12-08T16:15:20Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b00fdde
Parents:
ac0cb2a
Message:

Configuration tweaks, now supports both CNF and DNF in config.file.

Files:
6 edited

Legend:

Unmodified
Added
Removed
  • Makefile

    rac0cb2a r944b15c  
    7272ifeq ($(CONFIG_USERSPACE),y)
    7373        DEFS += -DCONFIG_USERSPACE
     74endif
     75ifeq ($(CONFIG_FPU_LAZY),y)
     76        DEFS += -DCONFIG_FPU_LAZY
    7477endif
    7578
  • arch/amd64/Makefile.inc

    rac0cb2a r944b15c  
    6868        DEFS += -DCONFIG_HT
    6969endif
    70 ifeq ($(CONFIG_FPU_LAZY),y)
    71         DEFS += -DCONFIG_FPU_LAZY
    72 endif
    7370
    7471ARCH_SOURCES = \
  • arch/ia32/Makefile.inc

    rac0cb2a r944b15c  
    8787        DEFS += -DCONFIG_HT
    8888endif
    89 ifeq ($(CONFIG_FPU_LAZY),y)
    90         DEFS += -DCONFIG_FPU_LAZY
    91 endif
    9289
    9390ARCH_SOURCES = \
  • arch/mips32/Makefile.inc

    rac0cb2a r944b15c  
    7474        CFLAGS += -EB -DBIG_ENDIAN -DHAVE_FPU -mips3
    7575endif
    76 ifeq ($(MIPS_MACHINE),msim4kc)
    77         # MSIM needs lwl/swl patch & 4kc instruction patch to work
    78         # otherwise add -mmemcpy -mips3
    79        
    80         BFD_NAME = elf32-tradlittlemips
    81         BFD = binary
    82         CFLAGS += -mhard-float -march=4kc
    83 endif
    8476ifeq ($(MIPS_MACHINE),simics)
    8577        # SIMICS 4kc emulation is broken, although for instructions
     
    9688endif
    9789
    98 ## Accepted configuration directives
    99 #
    100 
    101 ifeq ($(CONFIG_FPU_LAZY),y)
    102         DEFS += -DCONFIG_FPU_LAZY
    103 endif
    10490
    10591ARCH_SOURCES = \
  • kernel.config

    rac0cb2a r944b15c  
    3737! [ARCH=ia32] IA32_CPU (choice)
    3838
     39# MIPS Machine Type
     40@ "msim" MSIM Simulator
     41@ "simics" Virtutech Simics simulator
     42@ "lgxemul" GXEmul Little Endian
     43@ "bgxemul" GXEmul Big Endian
     44@ "indy" SGI Indy
     45! [ARCH=mips32] MIPS_MACHINE (choice)
     46
    3947# Support for SMP
    40 ! CONFIG_SMP (y/n)
     48! [ARCH=ia32|ARCH=amd64] CONFIG_SMP (y/n)
    4149
    4250# Improved support for hyperthreading
     
    4452
    4553# Lazy FPU context switching
    46 ! CONFIG_FPU_LAZY (y/n)
    47 
    48 # MIPS Machine Type
    49 @ "msim" MSIM Simulator
    50 @ "msim4kc" MSIM Simulator with 4kc instruction set
    51 @ "simics" Virtutech Simics simulator
    52 @ "lgxemul" GXEmul Little Endian
    53 @ "bgxemul" GXEmul Big Endian
    54 @ "indy" SGI Indy
    55 ! [ARCH=mips32] MIPS_MACHINE (choice)
     54! [(ARCH=mips32&MIPS_MACHINE!=msim)|ARCH=amd64|ARCH=ia32] CONFIG_FPU_LAZY (y/n)
    5655
    5756## Debugging configuration directives
     
    7978@ [ARCH=ia32|ARCH=amd64] "fpu/fpu1" Intel fpu test 1
    8079@ [ARCH=ia32|ARCH=amd64] "fpu/sse1" Intel Sse test 1
    81 @ [ARCH=mips32&MIPS_MACHINE!=msim&MIPS_MACHINE!=msim4kc] "fpu/mips1" Mips FPU test 1
     80@ [ARCH=mips32&MIPS_MACHINE!=msim] "fpu/mips1" Mips FPU test 1
    8281@ "print/print1" Printf test 1
    8382@ "thread/trhead1" Thread test 1
  • tools/config.py

    rac0cb2a r944b15c  
    231231    f.close()
    232232
    233 def check_condition(text, defaults):
    234     result = True
    235     conds = text.split('&')
     233def check_condition(text, defaults, asked_names):
     234    seen_vars = [ x[0] for x in asked_names ]
     235    ctype = 'cnf'
     236    if ')|' in text or '|(' in text:
     237        ctype = 'dnf'
     238   
     239    if ctype == 'cnf':
     240        conds = text.split('&')
     241    else:
     242        conds = text.split('|')
     243
    236244    for cond in conds:
    237245        if cond.startswith('(') and cond.endswith(')'):
    238246            cond = cond[1:-1]
    239         if not check_dnf(cond, defaults):
     247           
     248        inside = check_inside(cond, defaults, ctype, seen_vars)
     249       
     250        if ctype == 'cnf' and not inside:
    240251            return False
    241     return True
    242 
    243 def check_dnf(text, defaults):
     252        if ctype == 'dnf' and inside:
     253            return True
     254
     255    if ctype == 'cnf':
     256        return True
     257    return False
     258
     259def check_inside(text, defaults, ctype, seen_vars):
    244260    """
    245261    Check that the condition specified on input line is True
     
    247263    only CNF is supported
    248264    """
    249     conds = text.split('|')
     265    if ctype == 'cnf':
     266        conds = text.split('|')
     267    else:
     268        conds = text.split('&')
    250269    for cond in conds:
    251270        res = re.match(r'^(.*?)(!?=)(.*)$', cond)
     
    255274        oper = res.group(2)
    256275        condval = res.group(3)
     276        if condname not in seen_vars:
     277            raise RuntimeError("Variable %s not defined before being asked." %\
     278                               condname)
    257279        if not defaults.has_key(condname):
    258280            raise RuntimeError("Condition var %s does not exist: %s" % \
    259281                               (condname,text))
    260282
    261         if oper=='=' and  condval == defaults[condname]:
    262             return True
    263         if oper == '!=' and condval != defaults[condname]:
    264             return True
    265     return False
     283        if ctype == 'cnf':
     284            if oper == '=' and  condval == defaults[condname]:
     285                return True
     286            if oper == '!=' and condval != defaults[condname]:
     287                return True
     288        else:
     289            if oper== '=' and condval != defaults[condname]:
     290                return False
     291            if oper== '!=' and condval == defaults[condname]:
     292                print 2
     293                return False
     294    if ctype=='cnf':
     295        return False
     296    return True
    266297
    267298def parse_config(input, output, dlg, defaults={}, askonly=None):
     
    305336                raise RuntimeError('Invalid command: %s' % line)
    306337            if res.group(1):
    307                 if not check_condition(res.group(1), defaults):
     338                if not check_condition(res.group(1), defaults,
     339                                       asked_names):
    308340                    continue
    309341            args = res.group(2).strip().split(' ')
     
    335367           
    336368            if res.group(1):
    337                 if not check_condition(res.group(1), defaults):
     369                if not check_condition(res.group(1), defaults,
     370                                       asked_names):
    338371                    if default is not None:
    339372                        outf.write('#!# %s = %s\n' % (varname, default))
     
    366399                raise RuntimeError("Bad line: %s" % line)
    367400            if res.group(1):
    368                 if not check_condition(res.group(1),defaults):
     401                if not check_condition(res.group(1),defaults,
     402                                       asked_names):
    369403                    continue
    370404            choices.append((res.group(2), res.group(3)))
     
    434468   
    435469    if not defmode and dlg.yesno('Rebuild kernel?') == 'y':
    436         os.execlp('make','make','clean','all')
     470        os.execlp('make','make','clean','build')
    437471
    438472if __name__ == '__main__':
Note: See TracChangeset for help on using the changeset viewer.