Changes in / [c2f4b6b:b38dfd8] in mainline


Ignore:
Files:
2 added
16 deleted
11 edited

Legend:

Unmodified
Added
Removed
  • Makefile

    rc2f4b6b rb38dfd8  
    4141CONFIG_HEADER = config.h
    4242
    43 .PHONY: all precheck cscope autotool config_default config distclean clean
     43.PHONY: all precheck cscope autotool config_auto config_default config distclean clean
    4444
    4545all: $(COMMON_MAKEFILE) $(COMMON_HEADER) $(CONFIG_MAKEFILE) $(CONFIG_HEADER)
     
    6666
    6767config_default: $(CONFIG_RULES)
    68         $(CONFIG) $< default
     68ifeq ($(HANDS_OFF),y)
     69        $(CONFIG) $< hands-off $(PROFILE)
     70else
     71        $(CONFIG) $< default $(PROFILE)
     72endif
    6973
    7074config: $(CONFIG_RULES)
  • boot/arch/mips32/src/Makefile

    rc2f4b6b rb38dfd8  
    3232.PHONY: all clean
    3333
    34 all: ../../../../version ../../../../Makefile.config ../../../../config.h ../../../../config.defs
     34all: ../../../../version ../../../../Makefile.common ../../../../Makefile.config ../../../../config.h
    3535        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
    3636        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
    3737
    3838clean:
     39        rm -f $(USPACEDIR)/dist/srv/*
     40        rm -f $(USPACEDIR)/dist/app/*
     41        rm -f $(USPACEDIR)/dist/cfg/net/*
     42
    3943        for file in $(RD_SRVS) ; do \
    4044                rm -f $(USPACEDIR)/dist/srv/`basename $$file` ; \
     
    4347                rm -f $(USPACEDIR)/dist/app/`basename $$file` ; \
    4448        done
     49        for file in $(NET_CFG) ; do \
     50                rm -f $(USPACEDIR)/dist/cfg/net/`basename $$file` ; \
     51        done
    4552        rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(RAW) $(COMPS).h $(COMPS).c $(LINK) $(INITRD).img $(INITRD).fs
    4653        find . -name '*.o' -follow -exec rm \{\} \;
  • boot/arch/mips32/src/Makefile.build

    rc2f4b6b rb38dfd8  
    3232
    3333include ../../../../version
     34include ../../../../Makefile.common
    3435include ../../../../Makefile.config
    35 include ../../../../config.defs
    3636include Makefile.common
    3737include Makefile.toolchain
     
    7777
    7878$(DEPEND):
     79        rm -f $(USPACEDIR)/dist/srv/*
     80        rm -f $(USPACEDIR)/dist/app/*
     81        rm -f $(USPACEDIR)/dist/cfg/net/*
     82
    7983        for file in $(RD_SRVS) ; do \
    8084                cp $$file $(USPACEDIR)/dist/srv/ ; \
     
    8286        for file in $(RD_APPS) ; do \
    8387                cp $$file $(USPACEDIR)/dist/app/ ; \
     88        done
     89        for file in $(NET_CFG) ; do \
     90                cp $$file $(USPACEDIR)/dist/cfg/net/ ; \
    8491        done
    8592ifeq ($(RDFMT),tmpfs)
  • boot/arch/mips32/src/Makefile.toolchain

    rc2f4b6b rb38dfd8  
    2727#
    2828
    29 ## Toolchain configuration
    30 #
    31 
    32 ifndef CROSS_PREFIX
    33         CROSS_PREFIX = /usr/local
    34 endif
    35 
    3629BFD_ARCH = mips
    37 TARGET = mipsel-linux-gnu
    38 TOOLCHAIN_DIR = $(CROSS_PREFIX)/mips32/bin
    3930
    4031JOBFILE = ../../../../tools/jobfile.py
     
    4839        BFD_NAME = elf32-tradbigmips
    4940        BFD = ecoff-bigmips
    50         TOOLCHAIN_DIR = $(CROSS_PREFIX)/mips32eb/bin
    51         TARGET = mips-linux-gnu
    5241endif
    5342
     
    5544        BFD_NAME = elf32-tradlittlemips
    5645        BFD = binary
    57 endif
    58 
    59 ifeq ($(COMPILER),gcc_native)
    60         CC = gcc
    61         AS = as
    62         LD = ld
    63         OBJCOPY = objcopy
    64         OBJDUMP = objdump
    65 endif
    66 
    67 ifeq ($(COMPILER),gcc_cross)
    68         CC = $(TOOLCHAIN_DIR)/$(TARGET)-gcc
    69         AS = $(TOOLCHAIN_DIR)/$(TARGET)-as
    70         LD = $(TOOLCHAIN_DIR)/$(TARGET)-ld
    71         OBJCOPY = $(TOOLCHAIN_DIR)/$(TARGET)-objcopy
    72         OBJDUMP = $(TOOLCHAIN_DIR)/$(TARGET)-objdump
    7346endif
    7447
  • tools/config.py

    rc2f4b6b rb38dfd8  
    33# Copyright (c) 2006 Ondrej Palkovsky
    44# Copyright (c) 2009 Martin Decky
     5# Copyright (c) 2010 Jiri Svoboda
    56# All rights reserved.
    67#
     
    4041import xtui
    4142
    42 INPUT = sys.argv[1]
     43RULES_FILE = sys.argv[1]
    4344MAKEFILE = 'Makefile.config'
    4445MACROS = 'config.h'
    45 PRECONF = 'defaults'
    46 
    47 def read_defaults(fname, defaults):
    48         "Read saved values from last configuration run"
     46PRESETS_DIR = 'defaults'
     47
     48def read_config(fname, config):
     49        "Read saved values from last configuration run or a preset file"
    4950       
    5051        inf = open(fname, 'r')
     
    5253        for line in inf:
    5354                res = re.match(r'^(?:#!# )?([^#]\w*)\s*=\s*(.*?)\s*$', line)
    54                 if (res):
    55                         defaults[res.group(1)] = res.group(2)
     55                if res:
     56                        config[res.group(1)] = res.group(2)
    5657       
    5758        inf.close()
    5859
    59 def check_condition(text, defaults, ask_names):
     60def check_condition(text, config, rules):
    6061        "Check that the condition specified on input line is True (only CNF and DNF is supported)"
    6162       
    6263        ctype = 'cnf'
    6364       
    64         if ((')|' in text) or ('|(' in text)):
     65        if (')|' in text) or ('|(' in text):
    6566                ctype = 'dnf'
    6667       
    67         if (ctype == 'cnf'):
     68        if ctype == 'cnf':
    6869                conds = text.split('&')
    6970        else:
     
    7172       
    7273        for cond in conds:
    73                 if (cond.startswith('(')) and (cond.endswith(')')):
     74                if cond.startswith('(') and cond.endswith(')'):
    7475                        cond = cond[1:-1]
    7576               
    76                 inside = check_inside(cond, defaults, ctype)
     77                inside = check_inside(cond, config, ctype)
    7778               
    7879                if (ctype == 'cnf') and (not inside):
    7980                        return False
    8081               
    81                 if (ctype == 'dnf') and (inside):
     82                if (ctype == 'dnf') and inside:
    8283                        return True
    8384       
    84         if (ctype == 'cnf'):
     85        if ctype == 'cnf':
    8586                return True
    8687        return False
    8788
    88 def check_inside(text, defaults, ctype):
     89def check_inside(text, config, ctype):
    8990        "Check for condition"
    9091       
    91         if (ctype == 'cnf'):
     92        if ctype == 'cnf':
    9293                conds = text.split('|')
    9394        else:
     
    9697        for cond in conds:
    9798                res = re.match(r'^(.*?)(!?=)(.*)$', cond)
    98                 if (not res):
     99                if not res:
    99100                        raise RuntimeError("Invalid condition: %s" % cond)
    100101               
     
    103104                condval = res.group(3)
    104105               
    105                 if (not condname in defaults):
     106                if not condname in config:
    106107                        varval = ''
    107108                else:
    108                         varval = defaults[condname]
     109                        varval = config[condname]
    109110                        if (varval == '*'):
    110111                                varval = 'y'
    111112               
    112                 if (ctype == 'cnf'):
     113                if ctype == 'cnf':
    113114                        if (oper == '=') and (condval == varval):
    114115                                return True
     
    123124                                return False
    124125       
    125         if (ctype == 'cnf'):
     126        if ctype == 'cnf':
    126127                return False
    127128       
    128129        return True
    129130
    130 def parse_config(fname, ask_names):
    131         "Parse configuration file"
     131def parse_rules(fname, rules):
     132        "Parse rules file"
    132133       
    133134        inf = open(fname, 'r')
     
    138139        for line in inf:
    139140               
    140                 if (line.startswith('!')):
     141                if line.startswith('!'):
    141142                        # Ask a question
    142143                        res = re.search(r'!\s*(?:\[(.*?)\])?\s*([^\s]+)\s*\((.*)\)\s*$', line)
    143144                       
    144                         if (not res):
     145                        if not res:
    145146                                raise RuntimeError("Weird line: %s" % line)
    146147                       
     
    149150                        vartype = res.group(3)
    150151                       
    151                         ask_names.append((varname, vartype, name, choices, cond))
     152                        rules.append((varname, vartype, name, choices, cond))
    152153                        name = ''
    153154                        choices = []
    154155                        continue
    155156               
    156                 if (line.startswith('@')):
     157                if line.startswith('@'):
    157158                        # Add new line into the 'choices' array
    158159                        res = re.match(r'@\s*(?:\[(.*?)\])?\s*"(.*?)"\s*(.*)$', line)
     
    164165                        continue
    165166               
    166                 if (line.startswith('%')):
     167                if line.startswith('%'):
    167168                        # Name of the option
    168169                        name = line[1:].strip()
    169170                        continue
    170171               
    171                 if ((line.startswith('#')) or (line == '\n')):
     172                if line.startswith('#') or (line == '\n'):
    172173                        # Comment or empty line
    173174                        continue
     
    181182        "Return '*' if yes, ' ' if no"
    182183       
    183         if (default == 'y'):
     184        if default == 'y':
    184185                return '*'
    185186       
     
    199200        cnt = 0
    200201        for key, val in choices:
    201                 if ((default) and (key == default)):
     202                if (default) and (key == default):
    202203                        position = cnt
    203204               
     
    207208        (button, value) = xtui.choice_window(screen, name, 'Choose value', options, position)
    208209       
    209         if (button == 'cancel'):
     210        if button == 'cancel':
    210211                return None
    211212       
    212213        return choices[value][0]
    213214
    214 def check_choices(defaults, ask_names):
    215         "Check whether all accessible variables have a default"
    216        
    217         for varname, vartype, name, choices, cond in ask_names:
    218                 if ((cond) and (not check_condition(cond, defaults, ask_names))):
     215## Infer and verify configuration values.
     216#
     217# Augment @a config with values that can be inferred, purge invalid ones
     218# and verify that all variables have a value (previously specified or inferred).
     219#
     220# @param config Configuration to work on
     221# @param rules  Rules
     222#
     223# @return True if configuration is complete and valid, False
     224#         otherwise.
     225#
     226def infer_verify_choices(config, rules):
     227        "Infer and verify configuration values."
     228       
     229        for rule in rules:
     230                varname, vartype, name, choices, cond = rule
     231               
     232                if cond and (not check_condition(cond, config, rules)):
    219233                        continue
    220234               
    221                 if (not varname in defaults):
     235                if not varname in config:
     236                        value = None
     237                else:
     238                        value = config[varname]
     239               
     240                if not validate_rule_value(rule, value):
     241                        value = None
     242               
     243                default = get_default_rule(rule)
     244                if default != None:
     245                        config[varname] = default
     246               
     247                if not varname in config:
    222248                        return False
    223249       
    224250        return True
    225251
    226 def create_output(mkname, mcname, defaults, ask_names):
     252## Get default value from a rule.
     253def get_default_rule(rule):
     254        varname, vartype, name, choices, cond = rule
     255       
     256        default = None
     257       
     258        if vartype == 'choice':
     259                # If there is just one option, use it
     260                if len(choices) == 1:
     261                        default = choices[0][0]
     262        elif vartype == 'y':
     263                default = '*'
     264        elif vartype == 'n':
     265                default = 'n'
     266        elif vartype == 'y/n':
     267                default = 'y'
     268        elif vartype == 'n/y':
     269                default = 'n'
     270        else:
     271                raise RuntimeError("Unknown variable type: %s" % vartype)
     272       
     273        return default
     274
     275## Get option from a rule.
     276#
     277# @param rule  Rule for a variable
     278# @param value Current value of the variable
     279#
     280# @return Option (string) to ask or None which means not to ask.
     281#
     282def get_rule_option(rule, value):
     283        varname, vartype, name, choices, cond = rule
     284       
     285        option = None
     286       
     287        if vartype == 'choice':
     288                # If there is just one option, don't ask
     289                if len(choices) != 1:
     290                        if (value == None):
     291                                option = "?     %s --> " % name
     292                        else:
     293                                option = "      %s [%s] --> " % (name, value)
     294        elif vartype == 'y':
     295                pass
     296        elif vartype == 'n':
     297                pass
     298        elif vartype == 'y/n':
     299                option = "  <%s> %s " % (yes_no(value), name)
     300        elif vartype == 'n/y':
     301                option ="  <%s> %s " % (yes_no(value), name)
     302        else:
     303                raise RuntimeError("Unknown variable type: %s" % vartype)
     304       
     305        return option
     306
     307## Check if variable value is valid.
     308#
     309# @param rule  Rule for the variable
     310# @param value Value of the variable
     311#
     312# @return True if valid, False if not valid.
     313#
     314def validate_rule_value(rule, value):
     315        varname, vartype, name, choices, cond = rule
     316       
     317        if value == None:
     318                return True
     319       
     320        if vartype == 'choice':
     321                if not value in [choice[0] for choice in choices]:
     322                        return False
     323        elif vartype == 'y':
     324                if value != 'y':
     325                        return False
     326        elif vartype == 'n':
     327                if value != 'n':
     328                        return False
     329        elif vartype == 'y/n':
     330                if not value in ['y', 'n']:
     331                        return False
     332        elif vartype == 'n/y':
     333                if not value in ['y', 'n']:
     334                        return False
     335        else:
     336                raise RuntimeError("Unknown variable type: %s" % vartype)
     337       
     338        return True
     339
     340def create_output(mkname, mcname, config, rules):
    227341        "Create output configuration"
    228342       
     
    238352                sys.stderr.write("failed\n")
    239353       
    240         if (len(version) == 3):
     354        if len(version) == 3:
    241355                revision = version[1]
    242                 if (version[0] != 1):
     356                if version[0] != 1:
    243357                        revision += 'M'
    244358                revision += ' (%s)' % version[2]
     
    259373        defs = 'CONFIG_DEFS ='
    260374       
    261         for varname, vartype, name, choices, cond in ask_names:
    262                 if ((cond) and (not check_condition(cond, defaults, ask_names))):
     375        for varname, vartype, name, choices, cond in rules:
     376                if cond and (not check_condition(cond, config, rules)):
    263377                        continue
    264378               
    265                 if (not varname in defaults):
    266                         default = ''
     379                if not varname in config:
     380                        value = ''
    267381                else:
    268                         default = defaults[varname]
    269                         if (default == '*'):
    270                                 default = 'y'
    271                
    272                 outmk.write('# %s\n%s = %s\n\n' % (name, varname, default))
    273                
    274                 if ((vartype == "y") or (vartype == "n") or (vartype == "y/n") or (vartype == "n/y")):
    275                         if (default == "y"):
     382                        value = config[varname]
     383                        if (value == '*'):
     384                                value = 'y'
     385               
     386                outmk.write('# %s\n%s = %s\n\n' % (name, varname, value))
     387               
     388                if vartype in ["y", "n", "y/n", "n/y"]:
     389                        if value == "y":
    276390                                outmc.write('/* %s */\n#define %s\n\n' % (name, varname))
    277391                                defs += ' -D%s' % varname
    278392                else:
    279                         outmc.write('/* %s */\n#define %s %s\n#define %s_%s\n\n' % (name, varname, default, varname, default))
    280                         defs += ' -D%s=%s -D%s_%s' % (varname, default, varname, default)
    281        
    282         if (revision is not None):
     393                        outmc.write('/* %s */\n#define %s %s\n#define %s_%s\n\n' % (name, varname, value, varname, value))
     394                        defs += ' -D%s=%s -D%s_%s' % (varname, value, varname, value)
     395       
     396        if revision is not None:
    283397                outmk.write('REVISION = %s\n' % revision)
    284398                outmc.write('#define REVISION %s\n' % revision)
     
    299413        return list
    300414
    301 def read_preconfigured(root, fname, screen, defaults):
     415## Ask user to choose a configuration profile.
     416#
     417def choose_profile(root, fname, screen, config):
    302418        options = []
    303419        opt2path = {}
     
    309425                canon = os.path.join(path, fname)
    310426               
    311                 if ((os.path.isdir(path)) and (os.path.exists(canon)) and (os.path.isfile(canon))):
     427                if os.path.isdir(path) and os.path.exists(canon) and os.path.isfile(canon):
    312428                        subprofile = False
    313429                       
     
    317433                                subcanon = os.path.join(subpath, fname)
    318434                               
    319                                 if ((os.path.isdir(subpath)) and (os.path.exists(subcanon)) and (os.path.isfile(subcanon))):
     435                                if os.path.isdir(subpath) and os.path.exists(subcanon) and os.path.isfile(subcanon):
    320436                                        subprofile = True
    321437                                        options.append("%s (%s)" % (name, subname))
    322                                         opt2path[cnt] = (canon, subcanon)
     438                                        opt2path[cnt] = [name, subname]
    323439                                        cnt += 1
    324440                       
    325                         if (not subprofile):
     441                        if not subprofile:
    326442                                options.append(name)
    327                                 opt2path[cnt] = (canon, None)
     443                                opt2path[cnt] = [name]
    328444                                cnt += 1
    329445       
    330446        (button, value) = xtui.choice_window(screen, 'Load preconfigured defaults', 'Choose configuration profile', options, None)
    331447       
    332         if (button == 'cancel'):
     448        if button == 'cancel':
    333449                return None
    334450       
    335         read_defaults(opt2path[value][0], defaults)
    336         if (opt2path[value][1] != None):
    337                 read_defaults(opt2path[value][1], defaults)
     451        return opt2path[value]
     452
     453## Read presets from a configuration profile.
     454#
     455# @param profile Profile to load from (a list of string components)
     456# @param config  Output configuration
     457#
     458def read_presets(profile, config):
     459        path = os.path.join(PRESETS_DIR, profile[0], MAKEFILE)
     460        read_config(path, config)
     461       
     462        if len(profile) > 1:
     463                path = os.path.join(PRESETS_DIR, profile[0], profile[1], MAKEFILE)
     464                read_config(path, config)
     465
     466## Parse profile name (relative OS path) into a list of components.
     467#
     468# @param profile_name Relative path (using OS separator)
     469# @return             List of components
     470#
     471def parse_profile_name(profile_name):
     472        profile = []
     473       
     474        head, tail = os.path.split(profile_name)
     475        if head != '':
     476                profile.append(head)
     477       
     478        profile.append(tail)
     479        return profile
    338480
    339481def main():
    340         defaults = {}
    341         ask_names = []
    342        
    343         # Parse configuration file
    344         parse_config(INPUT, ask_names)
    345        
    346         # Read defaults from previous run
    347         if os.path.exists(MAKEFILE):
    348                 read_defaults(MAKEFILE, defaults)
    349        
    350         # Default mode: only check defaults and regenerate configuration
    351         if ((len(sys.argv) >= 3) and (sys.argv[2] == 'default')):
    352                 if (check_choices(defaults, ask_names)):
    353                         create_output(MAKEFILE, MACROS, defaults, ask_names)
     482        profile = None
     483        config = {}
     484        rules = []
     485       
     486        # Parse rules file
     487        parse_rules(RULES_FILE, rules)
     488       
     489        # Input configuration file can be specified on command line
     490        # otherwise configuration from previous run is used.
     491        if len(sys.argv) >= 4:
     492                profile = parse_profile_name(sys.argv[3])
     493                read_presets(profile, config)
     494        elif os.path.exists(MAKEFILE):
     495                read_config(MAKEFILE, config)
     496       
     497        # Default mode: check values and regenerate configuration files
     498        if (len(sys.argv) >= 3) and (sys.argv[2] == 'default'):
     499                if (infer_verify_choices(config, rules)):
     500                        create_output(MAKEFILE, MACROS, config, rules)
    354501                        return 0
    355502       
    356         # Check mode: only check defaults
    357         if ((len(sys.argv) >= 3) and (sys.argv[2] == 'check')):
    358                 if (check_choices(defaults, ask_names)):
     503        # Hands-off mode: check values and regenerate configuration files,
     504        # but no interactive fallback
     505        if (len(sys.argv) >= 3) and (sys.argv[2] == 'hands-off'):
     506                # We deliberately test sys.argv >= 4 because we do not want
     507                # to read implicitly any possible previous run configuration
     508                if len(sys.argv) < 4:
     509                        sys.stderr.write("Configuration error: No presets specified\n")
     510                        return 2
     511               
     512                if (infer_verify_choices(config, rules)):
     513                        create_output(MAKEFILE, MACROS, config, rules)
     514                        return 0
     515               
     516                sys.stderr.write("Configuration error: The presets are ambiguous\n")
     517                return 1
     518       
     519        # Check mode: only check configuration
     520        if (len(sys.argv) >= 3) and (sys.argv[2] == 'check'):
     521                if infer_verify_choices(config, rules):
    359522                        return 0
    360523                return 1
     
    366529                while True:
    367530                       
    368                         # Cancel out all defaults which have to be deduced
    369                         for varname, vartype, name, choices, cond in ask_names:
    370                                 if ((vartype == 'y') and (varname in defaults) and (defaults[varname] == '*')):
    371                                         defaults[varname] = None
     531                        # Cancel out all values which have to be deduced
     532                        for varname, vartype, name, choices, cond in rules:
     533                                if (vartype == 'y') and (varname in config) and (config[varname] == '*'):
     534                                        config[varname] = None
    372535                       
    373536                        options = []
     
    377540                        options.append("  --- Load preconfigured defaults ... ")
    378541                       
    379                         for varname, vartype, name, choices, cond in ask_names:
    380                                
    381                                 if ((cond) and (not check_condition(cond, defaults, ask_names))):
     542                        for rule in rules:
     543                                varname, vartype, name, choices, cond = rule
     544                               
     545                                if cond and (not check_condition(cond, config, rules)):
    382546                                        continue
    383547                               
    384                                 if (varname == selname):
     548                                if varname == selname:
    385549                                        position = cnt
    386550                               
    387                                 if (not varname in defaults):
    388                                         default = None
     551                                if not varname in config:
     552                                        value = None
    389553                                else:
    390                                         default = defaults[varname]
    391                                
    392                                 if (vartype == 'choice'):
    393                                         # Check if the default is an acceptable value
    394                                         if ((default) and (not default in [choice[0] for choice in choices])):
    395                                                 default = None
    396                                                 defaults.pop(varname)
    397                                        
    398                                         # If there is just one option, use it
    399                                         if (len(choices) == 1):
    400                                                 defaults[varname] = choices[0][0]
    401                                                 continue
    402                                        
    403                                         if (default == None):
    404                                                 options.append("?     %s --> " % name)
    405                                         else:
    406                                                 options.append("      %s [%s] --> " % (name, default))
    407                                 elif (vartype == 'y'):
    408                                         defaults[varname] = '*'
     554                                        value = config[varname]
     555                               
     556                                if not validate_rule_value(rule, value):
     557                                        value = None
     558                               
     559                                default = get_default_rule(rule)
     560                                if default != None:
     561                                        if value == None:
     562                                                value = default
     563                                        config[varname] = value
     564                               
     565                                option = get_rule_option(rule, value)
     566                                if option != None:
     567                                        options.append(option)
     568                                else:
    409569                                        continue
    410                                 elif (vartype == 'n'):
    411                                         defaults[varname] = 'n'
    412                                         continue
    413                                 elif (vartype == 'y/n'):
    414                                         if (default == None):
    415                                                 default = 'y'
    416                                                 defaults[varname] = default
    417                                         options.append("  <%s> %s " % (yes_no(default), name))
    418                                 elif (vartype == 'n/y'):
    419                                         if (default == None):
    420                                                 default = 'n'
    421                                                 defaults[varname] = default
    422                                         options.append("  <%s> %s " % (yes_no(default), name))
    423                                 else:
    424                                         raise RuntimeError("Unknown variable type: %s" % vartype)
    425570                               
    426571                                opt2row[cnt] = (varname, vartype, name, choices)
     
    433578                        (button, value) = xtui.choice_window(screen, 'HelenOS configuration', 'Choose configuration option', options, position)
    434579                       
    435                         if (button == 'cancel'):
     580                        if button == 'cancel':
    436581                                return 'Configuration canceled'
    437582                       
    438                         if (button == 'done'):
    439                                 if (check_choices(defaults, ask_names)):
     583                        if button == 'done':
     584                                if (infer_verify_choices(config, rules)):
    440585                                        break
    441586                                else:
     
    443588                                        continue
    444589                       
    445                         if (value == 0):
    446                                 read_preconfigured(PRECONF, MAKEFILE, screen, defaults)
     590                        if value == 0:
     591                                profile = choose_profile(PRESETS_DIR, MAKEFILE, screen, config)
     592                                if profile != None:
     593                                        read_presets(profile, config)
    447594                                position = 1
    448595                                continue
    449596                       
    450597                        position = None
    451                         if (not value in opt2row):
     598                        if not value in opt2row:
    452599                                raise RuntimeError("Error selecting value: %s" % value)
    453600                       
    454601                        (selname, seltype, name, choices) = opt2row[value]
    455602                       
    456                         if (not selname in defaults):
    457                                         default = None
     603                        if not selname in config:
     604                                value = None
    458605                        else:
    459                                 default = defaults[selname]
    460                        
    461                         if (seltype == 'choice'):
    462                                 defaults[selname] = subchoice(screen, name, choices, default)
    463                         elif ((seltype == 'y/n') or (seltype == 'n/y')):
    464                                 if (defaults[selname] == 'y'):
    465                                         defaults[selname] = 'n'
     606                                value = config[selname]
     607                       
     608                        if seltype == 'choice':
     609                                config[selname] = subchoice(screen, name, choices, value)
     610                        elif (seltype == 'y/n') or (seltype == 'n/y'):
     611                                if config[selname] == 'y':
     612                                        config[selname] = 'n'
    466613                                else:
    467                                         defaults[selname] = 'y'
     614                                        config[selname] = 'y'
    468615        finally:
    469616                xtui.screen_done(screen)
    470617       
    471         create_output(MAKEFILE, MACROS, defaults, ask_names)
     618        create_output(MAKEFILE, MACROS, config, rules)
    472619        return 0
    473620
  • uspace/app/netecho/print_error.c

    rc2f4b6b rb38dfd8  
    164164        case EDESTADDRREQ:
    165165                fprintf(output, "Destination address required (%d) error", error_code);
    166         case TRY_AGAIN:
     166        case EAGAIN:
    167167                fprintf(output, "Try again (%d) error", error_code);
    168168        default:
  • uspace/lib/c/generic/adt/char_map.c

    rc2f4b6b rb38dfd8  
    9090        }
    9191
    92         map->items[map->next]->c = * identifier;
    93         ++ identifier;
    94         ++ map->next;
    95         if ((length > 1) || ((length == 0) && (*identifier))) {
     92        map->items[map->next]->c = *identifier;
     93        identifier++;
     94        map->next++;
     95        if ((length > 1) || ((length == 0) && *identifier)) {
    9696                map->items[map->next - 1]->value = CHAR_MAP_NULL;
    9797                return char_map_add_item(map->items[map->next - 1], identifier,
     
    142142    const int value)
    143143{
    144         if (char_map_is_valid(map) && (identifier) &&
    145             ((length) || (*identifier))) {
     144        if (char_map_is_valid(map) && identifier && (length || *identifier)) {
    146145                int index;
    147146
    148                 for (index = 0; index < map->next; ++ index) {
     147                for (index = 0; index < map->next; index++) {
    149148                        if (map->items[index]->c != *identifier)
    150149                                continue;
    151150                               
    152                         ++ identifier;
    153                         if((length > 1) || ((length == 0) && (*identifier))) {
     151                        identifier++;
     152                        if((length > 1) || ((length == 0) && *identifier)) {
    154153                                return char_map_add(map->items[index],
    155154                                    identifier, length ? length - 1 : 0, value);
     
    178177
    179178                map->magic = 0;
    180                 for (index = 0; index < map->next; ++index)
     179                for (index = 0; index < map->next; index++)
    181180                        char_map_destroy(map->items[index]);
    182181
     
    207206                return NULL;
    208207
    209         if (length || (*identifier)) {
     208        if (length || *identifier) {
    210209                int index;
    211210
    212                 for (index = 0; index < map->next; ++index) {
     211                for (index = 0; index < map->next; index++) {
    213212                        if (map->items[index]->c == *identifier) {
    214                                 ++identifier;
     213                                identifier++;
    215214                                if (length == 1)
    216215                                        return map->items[index];
  • uspace/lib/c/include/adt/generic_field.h

    rc2f4b6b rb38dfd8  
    9191                        } \
    9292                        field->items[field->next] = value; \
    93                         ++field->next; \
     93                        field->next++; \
    9494                        field->items[field->next] = NULL; \
    9595                        return field->next - 1; \
     
    108108                        int index; \
    109109                        field->magic = 0; \
    110                         for (index = 0; index < field->next; ++ index) { \
     110                        for (index = 0; index < field->next; index++) { \
    111111                                if (field->items[index]) \
    112112                                        free(field->items[index]); \
  • uspace/lib/c/include/errno.h

    rc2f4b6b rb38dfd8  
    8383#define ENOTCONN        (-10057)
    8484
    85 /** The requested operation was not performed.
    86  *  Try again later.
    87  */
    88 #define TRY_AGAIN       (-11002)
     85/** The requested operation was not performed. Try again later. */
     86#define EAGAIN          (-11002)
    8987
    9088/** No data.
  • uspace/srv/net/il/arp/arp.c

    rc2f4b6b rb38dfd8  
    7272#define NAME  "arp"
    7373
     74/** Number of microseconds to wait for an ARP reply. */
     75#define ARP_TRANS_WAIT  1000000
     76
    7477/** ARP global data. */
    7578arp_globals_t arp_globals;
     
    7780DEVICE_MAP_IMPLEMENT(arp_cache, arp_device_t);
    7881INT_MAP_IMPLEMENT(arp_protos, arp_proto_t);
    79 GENERIC_CHAR_MAP_IMPLEMENT(arp_addr, measured_string_t);
     82GENERIC_CHAR_MAP_IMPLEMENT(arp_addr, arp_trans_t);
     83
     84static void arp_clear_trans(arp_trans_t *trans)
     85{
     86        if (trans->hw_addr) {
     87                free(trans->hw_addr);
     88                trans->hw_addr = NULL;
     89        }
     90        fibril_condvar_broadcast(&trans->cv);
     91}
     92
     93static void arp_clear_addr(arp_addr_t *addresses)
     94{
     95        int count;
     96        arp_trans_t *trans;
     97
     98        for (count = arp_addr_count(addresses) - 1; count >= 0; count--) {
     99                trans = arp_addr_items_get_index(&addresses->values, count);
     100                if (trans)
     101                        arp_clear_trans(trans);
     102        }
     103}
     104
    80105
    81106/** Clears the device specific data.
     
    96121                        if (proto->addr_data)
    97122                                free(proto->addr_data);
     123                        arp_clear_addr(&proto->addresses);
    98124                        arp_addr_destroy(&proto->addresses);
    99125                }
     
    107133        arp_device_t *device;
    108134
    109         fibril_rwlock_write_lock(&arp_globals.lock);
     135        fibril_mutex_lock(&arp_globals.lock);
    110136        for (count = arp_cache_count(&arp_globals.cache) - 1; count >= 0;
    111137            count--) {
     
    120146        }
    121147        arp_cache_clear(&arp_globals.cache);
    122         fibril_rwlock_write_unlock(&arp_globals.lock);
     148        fibril_mutex_unlock(&arp_globals.lock);
    123149        printf("Cache cleaned\n");
    124150        return EOK;
     
    130156        arp_device_t *device;
    131157        arp_proto_t *proto;
    132 
    133         fibril_rwlock_write_lock(&arp_globals.lock);
     158        arp_trans_t *trans;
     159
     160        fibril_mutex_lock(&arp_globals.lock);
    134161        device = arp_cache_find(&arp_globals.cache, device_id);
    135162        if (!device) {
    136                 fibril_rwlock_write_unlock(&arp_globals.lock);
     163                fibril_mutex_unlock(&arp_globals.lock);
    137164                return ENOENT;
    138165        }
    139166        proto = arp_protos_find(&device->protos, protocol);
    140167        if (!proto) {
    141                 fibril_rwlock_write_unlock(&arp_globals.lock);
     168                fibril_mutex_unlock(&arp_globals.lock);
    142169                return ENOENT;
    143170        }
     171        trans = arp_addr_find(&proto->addresses, address->value, address->length);
     172        if (trans)
     173                arp_clear_trans(trans);
    144174        arp_addr_exclude(&proto->addresses, address->value, address->length);
    145         fibril_rwlock_write_unlock(&arp_globals.lock);
     175        fibril_mutex_unlock(&arp_globals.lock);
    146176        return EOK;
    147177}
     
    152182        arp_device_t *device;
    153183
    154         fibril_rwlock_write_lock(&arp_globals.lock);
     184        fibril_mutex_lock(&arp_globals.lock);
    155185        device = arp_cache_find(&arp_globals.cache, device_id);
    156186        if (!device) {
    157                 fibril_rwlock_write_unlock(&arp_globals.lock);
     187                fibril_mutex_unlock(&arp_globals.lock);
    158188                return ENOENT;
    159189        }
    160190        arp_clear_device(device);
    161191        printf("Device %d cleared\n", device_id);
    162         fibril_rwlock_write_unlock(&arp_globals.lock);
     192        fibril_mutex_unlock(&arp_globals.lock);
    163193        return EOK;
    164194}
     
    221251        int rc;
    222252
    223         fibril_rwlock_write_lock(&arp_globals.lock);
     253        fibril_mutex_lock(&arp_globals.lock);
    224254
    225255        /* An existing device? */
     
    229259                if (device->service != service) {
    230260                        printf("Device %d already exists\n", device->device_id);
    231                         fibril_rwlock_write_unlock(&arp_globals.lock);
     261                        fibril_mutex_unlock(&arp_globals.lock);
    232262                        return EEXIST;
    233263                }
     
    241271                        rc = arp_proto_create(&proto, protocol, address);
    242272                        if (rc != EOK) {
    243                                 fibril_rwlock_write_unlock(&arp_globals.lock);
     273                                fibril_mutex_unlock(&arp_globals.lock);
    244274                                return rc;
    245275                        }
     
    247277                            proto);
    248278                        if (index < 0) {
    249                                 fibril_rwlock_write_unlock(&arp_globals.lock);
     279                                fibril_mutex_unlock(&arp_globals.lock);
    250280                                free(proto);
    251281                                return index;
     
    262292                device = (arp_device_t *) malloc(sizeof(arp_device_t));
    263293                if (!device) {
    264                         fibril_rwlock_write_unlock(&arp_globals.lock);
     294                        fibril_mutex_unlock(&arp_globals.lock);
    265295                        return ENOMEM;
    266296                }
     
    269299                rc = arp_protos_initialize(&device->protos);
    270300                if (rc != EOK) {
    271                         fibril_rwlock_write_unlock(&arp_globals.lock);
     301                        fibril_mutex_unlock(&arp_globals.lock);
    272302                        free(device);
    273303                        return rc;
     
    275305                rc = arp_proto_create(&proto, protocol, address);
    276306                if (rc != EOK) {
    277                         fibril_rwlock_write_unlock(&arp_globals.lock);
     307                        fibril_mutex_unlock(&arp_globals.lock);
    278308                        free(device);
    279309                        return rc;
     
    281311                index = arp_protos_add(&device->protos, proto->service, proto);
    282312                if (index < 0) {
    283                         fibril_rwlock_write_unlock(&arp_globals.lock);
     313                        fibril_mutex_unlock(&arp_globals.lock);
    284314                        arp_protos_destroy(&device->protos);
    285315                        free(device);
     
    293323                    arp_globals.client_connection);
    294324                if (device->phone < 0) {
    295                         fibril_rwlock_write_unlock(&arp_globals.lock);
     325                        fibril_mutex_unlock(&arp_globals.lock);
    296326                        arp_protos_destroy(&device->protos);
    297327                        free(device);
     
    303333                    &device->packet_dimension);
    304334                if (rc != EOK) {
    305                         fibril_rwlock_write_unlock(&arp_globals.lock);
     335                        fibril_mutex_unlock(&arp_globals.lock);
    306336                        arp_protos_destroy(&device->protos);
    307337                        free(device);
     
    313343                    &device->addr_data);
    314344                if (rc != EOK) {
    315                         fibril_rwlock_write_unlock(&arp_globals.lock);
     345                        fibril_mutex_unlock(&arp_globals.lock);
    316346                        arp_protos_destroy(&device->protos);
    317347                        free(device);
     
    323353                    &device->broadcast_addr, &device->broadcast_data);
    324354                if (rc != EOK) {
    325                         fibril_rwlock_write_unlock(&arp_globals.lock);
     355                        fibril_mutex_unlock(&arp_globals.lock);
    326356                        free(device->addr);
    327357                        free(device->addr_data);
     
    334364                    device);
    335365                if (rc != EOK) {
    336                         fibril_rwlock_write_unlock(&arp_globals.lock);
     366                        fibril_mutex_unlock(&arp_globals.lock);
    337367                        free(device->addr);
    338368                        free(device->addr_data);
     
    347377                    device->service, protocol);
    348378        }
    349         fibril_rwlock_write_unlock(&arp_globals.lock);
     379        fibril_mutex_unlock(&arp_globals.lock);
    350380       
    351381        return EOK;
     
    363393        int rc;
    364394
    365         fibril_rwlock_initialize(&arp_globals.lock);
    366         fibril_rwlock_write_lock(&arp_globals.lock);
     395        fibril_mutex_initialize(&arp_globals.lock);
     396        fibril_mutex_lock(&arp_globals.lock);
    367397        arp_globals.client_connection = client_connection;
    368398        rc = arp_cache_initialize(&arp_globals.cache);
    369         fibril_rwlock_write_unlock(&arp_globals.lock);
     399        fibril_mutex_unlock(&arp_globals.lock);
    370400       
    371401        return rc;
     
    383413        arp_device_t *device;
    384414
    385         fibril_rwlock_write_lock(&arp_globals.lock);
     415        fibril_mutex_lock(&arp_globals.lock);
    386416        device = arp_cache_find(&arp_globals.cache, device_id);
    387417        if (!device) {
    388                 fibril_rwlock_write_unlock(&arp_globals.lock);
     418                fibril_mutex_unlock(&arp_globals.lock);
    389419                return ENOENT;
    390420        }
    391421        device->packet_dimension.content = mtu;
    392         fibril_rwlock_write_unlock(&arp_globals.lock);
     422        fibril_mutex_unlock(&arp_globals.lock);
    393423        printf("arp - device %d changed mtu to %zu\n\n", device_id, mtu);
    394424        return EOK;
     
    421451        arp_device_t *device;
    422452        arp_proto_t *proto;
    423         measured_string_t *hw_source;
     453        arp_trans_t *trans;
    424454        uint8_t *src_hw;
    425455        uint8_t *src_proto;
     
    452482        des_hw = src_proto + header->protocol_length;
    453483        des_proto = des_hw + header->hardware_length;
    454         hw_source = arp_addr_find(&proto->addresses, (char *) src_proto,
     484        trans = arp_addr_find(&proto->addresses, (char *) src_proto,
    455485            CONVERT_SIZE(uint8_t, char, header->protocol_length));
    456486        /* Exists? */
    457         if (hw_source) {
    458                 if (hw_source->length != CONVERT_SIZE(uint8_t, char,
     487        if (trans && trans->hw_addr) {
     488                if (trans->hw_addr->length != CONVERT_SIZE(uint8_t, char,
    459489                    header->hardware_length)) {
    460490                        return EINVAL;
    461491                }
    462                 memcpy(hw_source->value, src_hw, hw_source->length);
     492                memcpy(trans->hw_addr->value, src_hw, trans->hw_addr->length);
    463493        }
    464494        /* Is my protocol address? */
     
    470500            proto->addr->length)) {
    471501                /* Not already updated? */
    472                 if (!hw_source) {
    473                         hw_source = measured_string_create_bulk((char *) src_hw,
    474                             CONVERT_SIZE(uint8_t, char,
     502                if (!trans) {
     503                        trans = (arp_trans_t *) malloc(sizeof(arp_trans_t));
     504                        if (!trans)
     505                                return ENOMEM;
     506                        trans->hw_addr = NULL;
     507                        fibril_condvar_initialize(&trans->cv);
     508                        rc = arp_addr_add(&proto->addresses, (char *) src_proto,
     509                            CONVERT_SIZE(uint8_t, char, header->protocol_length),
     510                            trans);
     511                        if (rc != EOK) {
     512                                /* The generic char map has already freed trans! */
     513                                return rc;
     514                        }
     515                }
     516                if (!trans->hw_addr) {
     517                        trans->hw_addr = measured_string_create_bulk(
     518                            (char *) src_hw, CONVERT_SIZE(uint8_t, char,
    475519                            header->hardware_length));
    476                         if (!hw_source)
     520                        if (!trans->hw_addr)
    477521                                return ENOMEM;
    478522
    479                         rc = arp_addr_add(&proto->addresses, (char *) src_proto,
    480                             CONVERT_SIZE(uint8_t, char,
    481                             header->protocol_length), hw_source);
    482                         if (rc != EOK)
    483                                 return rc;
     523                        /* Notify the fibrils that wait for the translation. */
     524                        fibril_condvar_broadcast(&trans->cv);
    484525                }
    485526                if (ntohs(header->operation) == ARPOP_REQUEST) {
     
    490531                        memcpy(src_hw, device->addr->value,
    491532                            device->packet_dimension.addr_len);
    492                         memcpy(des_hw, hw_source->value,
     533                        memcpy(des_hw, trans->hw_addr->value,
    493534                            header->hardware_length);
    494535                       
     
    516557 * @param[in] protocol  The protocol service.
    517558 * @param[in] target    The target protocol address.
    518  * @return              The hardware address of the target.
    519  * @return              NULL if the target parameter is NULL.
    520  * @return              NULL if the device is not found.
    521  * @return              NULL if the device packet is too small to send a
    522  *                      request.
    523  * @return              NULL if the hardware address is not found in the cache.
    524  */
    525 static measured_string_t *
     559 * @param[out] translation Where the hardware address of the target is stored.
     560 * @return              EOK on success.
     561 * @return              EAGAIN if the caller should try again.
     562 * @return              Other error codes in case of error.
     563 */
     564static int
    526565arp_translate_message(device_id_t device_id, services_t protocol,
    527     measured_string_t *target)
     566    measured_string_t *target, measured_string_t **translation)
    528567{
    529568        arp_device_t *device;
    530569        arp_proto_t *proto;
    531         measured_string_t *addr;
     570        arp_trans_t *trans;
    532571        size_t length;
    533572        packet_t *packet;
    534573        arp_header_t *header;
    535 
    536         if (!target)
    537                 return NULL;
     574        bool retry = false;
     575        int rc;
     576
     577restart:
     578        if (!target || !translation)
     579                return EBADMEM;
    538580
    539581        device = arp_cache_find(&arp_globals.cache, device_id);
    540582        if (!device)
    541                 return NULL;
     583                return ENOENT;
    542584
    543585        proto = arp_protos_find(&device->protos, protocol);
    544586        if (!proto || (proto->addr->length != target->length))
    545                 return NULL;
    546 
    547         addr = arp_addr_find(&proto->addresses, target->value, target->length);
    548         if (addr)
    549                 return addr;
     587                return ENOENT;
     588
     589        trans = arp_addr_find(&proto->addresses, target->value, target->length);
     590        if (trans) {
     591                if (trans->hw_addr) {
     592                        *translation = trans->hw_addr;
     593                        return EOK;
     594                }
     595                if (retry)
     596                        return EAGAIN;
     597                rc = fibril_condvar_wait_timeout(&trans->cv, &arp_globals.lock,
     598                    ARP_TRANS_WAIT);
     599                if (rc == ETIMEOUT)
     600                        return ENOENT;
     601                retry = true;
     602                goto restart;
     603        }
     604        if (retry)
     605                return EAGAIN;
    550606
    551607        /* ARP packet content size = header + (address + translation) * 2 */
     
    553609            CONVERT_SIZE(char, uint8_t, device->addr->length));
    554610        if (length > device->packet_dimension.content)
    555                 return NULL;
     611                return ELIMIT;
    556612
    557613        packet = packet_get_4_remote(arp_globals.net_phone,
     
    559615            length, device->packet_dimension.suffix);
    560616        if (!packet)
    561                 return NULL;
     617                return ENOMEM;
    562618
    563619        header = (arp_header_t *) packet_suffix(packet, length);
    564620        if (!header) {
    565621                pq_release_remote(arp_globals.net_phone, packet_get_id(packet));
    566                 return NULL;
     622                return ENOMEM;
    567623        }
    568624
     
    583639        memcpy(((uint8_t *) header) + length, target->value, target->length);
    584640
    585         if (packet_set_addr(packet, (uint8_t *) device->addr->value,
     641        rc = packet_set_addr(packet, (uint8_t *) device->addr->value,
    586642            (uint8_t *) device->broadcast_addr->value,
    587             CONVERT_SIZE(char, uint8_t, device->addr->length)) != EOK) {
     643            CONVERT_SIZE(char, uint8_t, device->addr->length));
     644        if (rc != EOK) {
    588645                pq_release_remote(arp_globals.net_phone, packet_get_id(packet));
    589                 return NULL;
     646                return rc;
    590647        }
    591648
    592649        nil_send_msg(device->phone, device_id, packet, SERVICE_ARP);
    593         return NULL;
     650
     651        trans = (arp_trans_t *) malloc(sizeof(arp_trans_t));
     652        if (!trans)
     653                return ENOMEM;
     654        trans->hw_addr = NULL;
     655        fibril_condvar_initialize(&trans->cv);
     656        rc = arp_addr_add(&proto->addresses, target->value, target->length,
     657            trans);
     658        if (rc != EOK) {
     659                /* The generic char map has already freed trans! */
     660                return rc;
     661        }
     662       
     663        rc = fibril_condvar_wait_timeout(&trans->cv, &arp_globals.lock,
     664            ARP_TRANS_WAIT);
     665        if (rc == ETIMEOUT)
     666                return ENOENT;
     667        retry = true;
     668        goto restart;
    594669}
    595670
     
    642717                        return rc;
    643718               
    644                 fibril_rwlock_read_lock(&arp_globals.lock);
    645                 translation = arp_translate_message(IPC_GET_DEVICE(call),
    646                     IPC_GET_SERVICE(call), address);
     719                fibril_mutex_lock(&arp_globals.lock);
     720                rc = arp_translate_message(IPC_GET_DEVICE(call),
     721                    IPC_GET_SERVICE(call), address, &translation);
    647722                free(address);
    648723                free(data);
     724                if (rc != EOK) {
     725                        fibril_mutex_unlock(&arp_globals.lock);
     726                        return rc;
     727                }
    649728                if (!translation) {
    650                         fibril_rwlock_read_unlock(&arp_globals.lock);
     729                        fibril_mutex_unlock(&arp_globals.lock);
    651730                        return ENOENT;
    652731                }
    653732                rc = measured_strings_reply(translation, 1);
    654                 fibril_rwlock_read_unlock(&arp_globals.lock);
     733                fibril_mutex_unlock(&arp_globals.lock);
    655734                return rc;
    656735
     
    682761                        return rc;
    683762               
    684                 fibril_rwlock_read_lock(&arp_globals.lock);
     763                fibril_mutex_lock(&arp_globals.lock);
    685764                do {
    686765                        next = pq_detach(packet);
     
    692771                        packet = next;
    693772                } while (packet);
    694                 fibril_rwlock_read_unlock(&arp_globals.lock);
     773                fibril_mutex_unlock(&arp_globals.lock);
    695774               
    696775                return EOK;
  • uspace/srv/net/il/arp/arp.h

    rc2f4b6b rb38dfd8  
    6565typedef struct arp_proto arp_proto_t;
    6666
     67/** Type definition of the ARP address translation record.
     68 * @see arp_trans
     69 */
     70typedef struct arp_trans arp_trans_t;
     71
    6772/** ARP address map.
    6873 *
     
    7075 * @see generic_char_map.h
    7176 */
    72 GENERIC_CHAR_MAP_DECLARE(arp_addr, measured_string_t);
     77GENERIC_CHAR_MAP_DECLARE(arp_addr, arp_trans_t);
    7378
    7479/** ARP address cache.
     
    8994struct arp_device {
    9095        /** Actual device hardware address. */
    91         measured_string_t * addr;
     96        measured_string_t *addr;
    9297        /** Actual device hardware address data. */
    9398        char *addr_data;
    9499        /** Broadcast device hardware address. */
    95         measured_string_t * broadcast_addr;
     100        measured_string_t *broadcast_addr;
    96101        /** Broadcast device hardware address data. */
    97102        char *broadcast_data;
     
    129134        int net_phone;
    130135        /** Safety lock. */
    131         fibril_rwlock_t lock;
     136        fibril_mutex_t lock;
    132137};
    133138
     
    144149};
    145150
     151/** ARP address translation record. */
     152struct arp_trans {
     153        /**
     154         * Hardware address for the translation. NULL denotes an incomplete
     155         * record with possible waiters.
     156         */
     157        measured_string_t *hw_addr;
     158        /** Condition variable used for waiting for completion of the record. */
     159        fibril_condvar_t cv;
     160};
     161
    146162#endif
    147163
    148164/** @}
    149165 */
     166
Note: See TracChangeset for help on using the changeset viewer.