Changeset b446b02 in mainline for uspace/drv/bus/isa/isa.c


Ignore:
Timestamp:
2017-10-17T17:47:11Z (7 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b1efe3e
Parents:
a416d070
Message:

Enumerate APIC and i8259 via DDF.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/isa/isa.c

    ra416d070 rb446b02  
    453453}
    454454
     455static void isa_fun_add_mem_range(isa_fun_t *fun, uintptr_t addr, size_t len)
     456{
     457        size_t count = fun->hw_resources.count;
     458        hw_resource_t *resources = fun->hw_resources.resources;
     459
     460        isa_bus_t *isa = isa_bus(ddf_fun_get_dev(fun->fnode));
     461
     462        if (count < ISA_MAX_HW_RES) {
     463                resources[count].type = MEM_RANGE;
     464                resources[count].res.mem_range.address = addr;
     465                resources[count].res.mem_range.address += isa->pio_win.mem.base;
     466                resources[count].res.mem_range.size = len;
     467                resources[count].res.mem_range.relative = true;
     468                resources[count].res.mem_range.endianness = LITTLE_ENDIAN;
     469
     470                fun->hw_resources.count++;
     471
     472                ddf_msg(LVL_NOTE, "Added mem range (addr=0x%zx, size=0x%x) to "
     473                    "function %s", (uintptr_t) addr, (unsigned int) len,
     474                    ddf_fun_get_name(fun->fnode));
     475        }
     476}
     477
    455478static void fun_parse_irq(isa_fun_t *fun, const char *val)
    456479{
     
    496519}
    497520
     521static void fun_parse_mem_range(isa_fun_t *fun, const char *val)
     522{
     523        uintptr_t addr;
     524        size_t len;
     525        char *end = NULL;
     526
     527        val = skip_spaces(val);
     528        addr = strtoul(val, &end, 0x10);
     529
     530        if (val == end)
     531                return;
     532
     533        val = skip_spaces(end);
     534        len = strtol(val, &end, 0x10);
     535
     536        if (val == end)
     537                return;
     538
     539        isa_fun_add_mem_range(fun, addr, len);
     540}
     541
    498542static void get_match_id(char **id, const char *val)
    499543{
     
    564608
    565609        if (!prop_parse(fun, line, "io_range", &fun_parse_io_range) &&
     610            !prop_parse(fun, line, "mem_range", &fun_parse_mem_range) &&
    566611            !prop_parse(fun, line, "irq", &fun_parse_irq) &&
    567612            !prop_parse(fun, line, "dma", &fun_parse_dma) &&
Note: See TracChangeset for help on using the changeset viewer.