Changeset d9fae235 in mainline for uspace/srv/hw


Ignore:
Timestamp:
2010-04-17T01:28:38Z (15 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9d6bfa5
Parents:
9256ad29
Message:

sysinfo overhaul

  • cleanup (nicer data structures, use of SLAB allocator)
  • add support for storing arbitrary binary data
  • properly reimplement non-constant values (generated by functions)
  • add support for non-constant subtrees (generated by functions)
  • syscall ABI change, libc API change
  • reflect changes in user code

libc: task_spawn() can now return error code

  • reflect change in user code, print error strings after failed task_spawn()

uspace cleanup

  • more use of string and other constants
  • more use of str_error()
  • unify error reporting in init
Location:
uspace/srv/hw
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hw/bus/cuda_adb/cuda_adb.c

    r9256ad29 rd9fae235  
    254254static int cuda_init(void)
    255255{
     256        if (sysinfo_get_value("cuda.address.physical", &(instance->cuda_physical)) != EOK)
     257                return -1;
     258       
     259        if (sysinfo_get_value("cuda.address.kernel", &(instance->cuda_kernel)) != EOK)
     260                return -1;
     261       
    256262        void *vaddr;
    257 
    258         instance->cuda_physical = sysinfo_value("cuda.address.physical");
    259         instance->cuda_kernel = sysinfo_value("cuda.address.kernel");
    260 
    261263        if (pio_enable((void *) instance->cuda_physical, sizeof(cuda_t), &vaddr) != 0)
    262264                return -1;
     265       
    263266        dev = vaddr;
    264267
  • uspace/srv/hw/char/i8042/i8042.c

    r9256ad29 rd9fae235  
    164164static int i8042_init(void)
    165165{
     166        if (sysinfo_get_value("i8042.address.physical", &i8042_physical) != EOK)
     167                return -1;
     168       
     169        if (sysinfo_get_value("i8042.address.kernel", &i8042_kernel) != EOK)
     170                return -1;
     171       
    166172        void *vaddr;
    167 
    168         i8042_physical = sysinfo_value("i8042.address.physical");
    169         i8042_kernel = sysinfo_value("i8042.address.kernel");
    170173        if (pio_enable((void *) i8042_physical, sizeof(i8042_t), &vaddr) != 0)
    171174                return -1;
     175       
    172176        i8042 = vaddr;
    173 
     177       
     178        sysarg_t inr_a;
     179        sysarg_t inr_b;
     180       
     181        if (sysinfo_get_value("i8042.inr_a", &inr_a) != EOK)
     182                return -1;
     183       
     184        if (sysinfo_get_value("i8042.inr_b", &inr_b) != EOK)
     185                return -1;
     186       
    174187        async_set_interrupt_received(i8042_irq_handler);
    175 
     188       
    176189        /* Disable kbd and aux */
    177190        wait_ready();
     
    186199        i8042_kbd.cmds[0].addr = (void *) &((i8042_t *) i8042_kernel)->status;
    187200        i8042_kbd.cmds[3].addr = (void *) &((i8042_t *) i8042_kernel)->data;
    188         ipc_register_irq(sysinfo_value("i8042.inr_a"), device_assign_devno(), 0, &i8042_kbd);
    189         ipc_register_irq(sysinfo_value("i8042.inr_b"), device_assign_devno(), 0, &i8042_kbd);
    190         printf("i8042: registered for interrupts %d and %d\n",
    191             sysinfo_value("i8042.inr_a"), sysinfo_value("i8042.inr_b"));
     201        ipc_register_irq(inr_a, device_assign_devno(), 0, &i8042_kbd);
     202        ipc_register_irq(inr_b, device_assign_devno(), 0, &i8042_kbd);
     203        printf("%s: registered for interrupts %d and %d\n", NAME, inr_a, inr_b);
    192204
    193205        wait_ready();
  • uspace/srv/hw/cir/fhc/fhc.c

    r9256ad29 rd9fae235  
    109109static bool fhc_init(void)
    110110{
    111         ipcarg_t phonead;
     111        sysarg_t paddr;
    112112
    113         fhc_uart_size = sysinfo_value("fhc.uart.size");
    114         fhc_uart_phys = (void *) sysinfo_value("fhc.uart.physical");
    115        
    116         if (!fhc_uart_size) {
     113        if ((sysinfo_get_value("fhc.uart.physical", &paddr) != EOK)
     114            || (sysinfo_get_value("fhc.uart.size", &fhc_uart_size) != EOK)) {
    117115                printf(NAME ": no FHC UART registers found\n");
    118116                return false;
    119117        }
    120 
     118       
     119        fhc_uart_phys = (void *) paddr;
    121120        fhc_uart_virt = as_get_mappable_page(fhc_uart_size);
    122121       
     
    132131        printf(NAME ": FHC UART registers at %p, %d bytes\n", fhc_uart_phys,
    133132            fhc_uart_size);
    134 
     133       
    135134        async_set_client_connection(fhc_connection);
     135        ipcarg_t phonead;
    136136        ipc_connect_to_me(PHONE_NS, SERVICE_FHC, 0, 0, &phonead);
    137137       
  • uspace/srv/hw/cir/obio/obio.c

    r9256ad29 rd9fae235  
    112112static bool obio_init(void)
    113113{
    114         ipcarg_t phonead;
    115 
    116         base_phys = (void *) sysinfo_value("obio.base.physical");
     114        sysarg_t paddr;
    117115       
    118         if (!base_phys) {
     116        if (sysinfo_get_value("obio.base.physical", &paddr) != EOK) {
    119117                printf(NAME ": no OBIO registers found\n");
    120118                return false;
    121119        }
    122 
     120       
     121        base_phys = (void *) paddr;
    123122        base_virt = as_get_mappable_page(OBIO_SIZE);
    124123       
     
    133132       
    134133        printf(NAME ": OBIO registers with base at %p\n", base_phys);
    135 
     134       
    136135        async_set_client_connection(obio_connection);
     136        ipcarg_t phonead;
    137137        ipc_connect_to_me(PHONE_NS, SERVICE_OBIO, 0, 0, &phonead);
    138138       
Note: See TracChangeset for help on using the changeset viewer.