Changeset f126c87 in mainline for uspace/lib


Ignore:
Timestamp:
2016-09-01T16:46:27Z (9 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2a2fbc8
Parents:
9befb0d (diff), bdfdc51c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge from mainline.

Location:
uspace/lib
Files:
60 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/arch/amd64/src/stacktrace_asm.S

    r9befb0d rf126c87  
    4444        ret
    4545FUNCTION_END(stacktrace_pc_get)
    46 
  • uspace/lib/c/arch/arm32/src/eabi.S

    r9befb0d rf126c87  
    9595        mov pc, lr
    9696FUNCTION_END(__aeabi_uldivmod)
    97 
  • uspace/lib/c/arch/arm32/src/stacktrace_asm.S

    r9befb0d rf126c87  
    4444        mov pc, lr
    4545FUNCTION_END(stacktrace_pc_get)
    46 
  • uspace/lib/c/arch/ia32/src/rtld/reloc.c

    r9befb0d rf126c87  
    6969        uint32_t sym_size;
    7070        char *str_tab;
    71 
     71       
    7272        elf_symbol_t *sym_def;
    7373        module_t *dest;
     
    8080
    8181        DPRINTF("address: 0x%x, entries: %d\n", (uintptr_t)rt, rt_entries);
    82 
     82       
    8383        for (i = 0; i < rt_entries; ++i) {
    8484//              DPRINTF("symbol %d: ", i);
     
    171171                        memcpy(r_ptr, (const void *)sym_addr, sym_size);
    172172                        break;
    173 
     173                       
    174174                case R_386_RELATIVE:
    175175                        DPRINTF("fixup R_386_RELATIVE (b+a)\n");
  • uspace/lib/c/arch/ia32/src/syscall.S

    r9befb0d rf126c87  
    6363FUNCTION_END(__syscall_slow)
    6464
    65 
    6665/** Syscall wrapper - SYSENTER version.
    6766 *
  • uspace/lib/c/arch/ia64/src/fibril.S

    r9befb0d rf126c87  
    338338        br.ret.sptk.many b0
    339339FUNCTION_END(context_restore)
    340 
  • uspace/lib/c/arch/ia64/src/stacktrace_asm.S

    r9befb0d rf126c87  
    4141FUNCTION_END(stacktrace_fp_get)
    4242FUNCTION_END(stacktrace_pc_get)
    43 
  • uspace/lib/c/arch/ia64/src/syscall.S

    r9befb0d rf126c87  
    4545        br.ret.sptk.many b0
    4646FUNCTION_END(__syscall)
    47 
  • uspace/lib/c/arch/mips32/src/entryjmp.S

    r9befb0d rf126c87  
    5151        addiu $sp, ABI_STACK_FRAME
    5252FUNCTION_END(entry_point_jmp)
    53 
  • uspace/lib/c/generic/async.c

    r9befb0d rf126c87  
    992992 * @param callid Hash of the incoming call.
    993993 * @param call   Data of the incoming call.
     994 *
    994995 */
    995996static void process_notification(ipc_callid_t callid, ipc_call_t *call)
     
    13171318                fibril_t *fibril = (fibril_t *) __tcb_get()->fibril_data;
    13181319                unsigned oldsw = fibril->switches;
    1319 
     1320               
    13201321                process_notification(callid, call);
    1321 
     1322               
    13221323                if (oldsw != fibril->switches) {
    13231324                        /*
     
    13351336                        fibril_switch(FIBRIL_FROM_DEAD);
    13361337                }
     1338               
    13371339                return;
    13381340        }
  • uspace/lib/c/generic/dnsr.c

    r9befb0d rf126c87  
    124124                return (int) retval;
    125125        }
    126 
     126       
    127127        size_t act_size = IPC_GET_ARG2(answer_cname);
    128128        assert(act_size <= DNSR_NAME_MAX_SIZE);
    129129       
    130130        cname_buf[act_size] = '\0';
    131 
     131       
    132132        info->cname = str_dup(cname_buf);
    133 
     133       
    134134        if (info->cname == NULL) {
    135135                free(info);
  • uspace/lib/c/generic/rtld/module.c

    r9befb0d rf126c87  
    151151                }
    152152        }
    153 
     153       
    154154        return NULL; /* Not found */
    155155}
     
    167167        module_t *m;
    168168        int rc;
    169 
     169       
    170170        m = calloc(1, sizeof(module_t));
    171171        if (m == NULL) {
     
    173173                exit(1);
    174174        }
    175 
     175       
    176176        m->rtld = rtld;
    177177        m->id = rtld_get_next_id(rtld);
     
    217217        /* Insert into the list of loaded modules */
    218218        list_append(&m->modules_link, &rtld->modules);
    219 
     219       
    220220        /* Copy TLS info */
    221221        m->tdata = info.tls.tdata;
     
    223223        m->tbss_size = info.tls.tbss_size;
    224224        m->tls_align = info.tls.tls_align;
    225 
     225       
    226226        DPRINTF("tdata at %p size %zu, tbss size %zu\n",
    227227            m->tdata, m->tdata_size, m->tbss_size);
  • uspace/lib/c/generic/tls.c

    r9befb0d rf126c87  
    7474        tcb_t *tcb;
    7575        size_t tls_size = &_tbss_end - &_tdata_start;
    76 
     76       
    7777#ifdef CONFIG_RTLD
    7878        if (runtime_env != NULL)
    7979                return rtld_tls_make(runtime_env);
    8080#endif
     81       
    8182        tcb = tls_alloc_arch(&data, tls_size);
    8283        if (!tcb)
    8384                return NULL;
    84 
     85       
    8586        /*
    8687         * Copy thread local data from the initialization image.
     
    118119        if (!tcb)
    119120                return NULL;
    120         *data = ((void *)tcb) + sizeof(tcb_t);
     121       
     122        *data = ((void *) tcb) + sizeof(tcb_t);
    121123#ifdef CONFIG_RTLD
    122124        tcb->dtv = NULL;
     
    148150{
    149151        tcb_t *tcb;
    150 
     152       
    151153        size = ALIGN_UP(size, &_tls_alignment);
    152154        *data = memalign((uintptr_t) &_tls_alignment, sizeof(tcb_t) + size);
  • uspace/lib/c/include/fibril.h

    r9befb0d rf126c87  
    7979        fibril_owner_info_t *waits_for;
    8080
    81         unsigned switches;
     81        unsigned int switches;
    8282} fibril_t;
    8383
  • uspace/lib/drv/generic/driver.c

    r9befb0d rf126c87  
    126126                return;
    127127        }
    128 
     128       
    129129        ddf_dev_t *dev = create_device();
    130130        if (!dev) {
     
    133133                return;
    134134        }
    135 
     135       
    136136        /* Add one reference that will be dropped by driver_dev_remove() */
    137137        dev_add_ref(dev);
  • uspace/lib/drv/generic/remote_ahci.c

    r9befb0d rf126c87  
    226226                return;
    227227        }       
    228 
     228       
    229229        const int ret = ahci_iface->get_sata_device_name(fun,
    230230            sata_dev_name_length, sata_dev_name);
     
    235235            (real_size == sata_dev_name_length))
    236236                async_data_read_finalize(cid, sata_dev_name, sata_dev_name_length);
    237 
     237       
    238238        free(sata_dev_name);
    239239        async_answer_0(callid, ret);
  • uspace/lib/drv/generic/remote_usb.c

    r9befb0d rf126c87  
    9191
    9292/** Tell devman handle of the usb device function.
    93  * @param[in] exch IPC communication exchange
     93 *
     94 * @param[in]  exch   IPC communication exchange
    9495 * @param[out] handle devman handle of the HC used by the target device.
     96 *
    9597 * @return Error code.
     98 *
    9699 */
    97100int usb_get_my_device_handle(async_exch_t *exch, devman_handle_t *handle)
     
    119122
    120123/** Release default USB address.
     124 *
    121125 * @param[in] exch IPC communication exchange
     126 *
    122127 * @return Error code.
     128 *
    123129 */
    124130int usb_release_default_address(async_exch_t *exch)
     
    131137
    132138/** Trigger USB device enumeration
    133  * @param[in] exch IPC communication exchange
     139 *
     140 * @param[in]  exch   IPC communication exchange
    134141 * @param[out] handle Identifier of the newly added device (if successful)
     142 *
    135143 * @return Error code.
     144 *
    136145 */
    137146int usb_device_enumerate(async_exch_t *exch, unsigned port)
     
    145154
    146155/** Trigger USB device enumeration
    147  * @param[in] exch IPC communication exchange
     156 *
     157 * @param[in] exch   IPC communication exchange
    148158 * @param[in] handle Identifier of the device
     159 *
    149160 * @return Error code.
     161 *
    150162 */
    151163int usb_device_remove(async_exch_t *exch, unsigned port)
  • uspace/lib/drv/include/usb_iface.h

    r9befb0d rf126c87  
    4444typedef async_sess_t usb_dev_session_t;
    4545
    46 usb_dev_session_t *usb_dev_connect(devman_handle_t);
    47 usb_dev_session_t *usb_dev_connect_to_self(ddf_dev_t *);
    48 void usb_dev_disconnect(usb_dev_session_t *);
     46extern usb_dev_session_t *usb_dev_connect(devman_handle_t);
     47extern usb_dev_session_t *usb_dev_connect_to_self(ddf_dev_t *);
     48extern void usb_dev_disconnect(usb_dev_session_t *);
    4949
    50 int usb_get_my_interface(async_exch_t *, int *);
    51 int usb_get_my_device_handle(async_exch_t *, devman_handle_t *);
     50extern int usb_get_my_interface(async_exch_t *, int *);
     51extern int usb_get_my_device_handle(async_exch_t *, devman_handle_t *);
    5252
    53 int usb_reserve_default_address(async_exch_t *, usb_speed_t);
    54 int usb_release_default_address(async_exch_t *);
     53extern int usb_reserve_default_address(async_exch_t *, usb_speed_t);
     54extern int usb_release_default_address(async_exch_t *);
    5555
    56 int usb_device_enumerate(async_exch_t *, unsigned port);
    57 int usb_device_remove(async_exch_t *, unsigned port);
     56extern int usb_device_enumerate(async_exch_t *, unsigned port);
     57extern int usb_device_remove(async_exch_t *, unsigned port);
    5858
    59 int usb_register_endpoint(async_exch_t *, usb_endpoint_t, usb_transfer_type_t,
    60     usb_direction_t, size_t, unsigned, unsigned);
    61 int usb_unregister_endpoint(async_exch_t *, usb_endpoint_t, usb_direction_t);
    62 int usb_read(async_exch_t *, usb_endpoint_t, uint64_t, void *, size_t, size_t *);
    63 int usb_write(async_exch_t *, usb_endpoint_t, uint64_t, const void *, size_t);
     59extern int usb_register_endpoint(async_exch_t *, usb_endpoint_t,
     60    usb_transfer_type_t, usb_direction_t, size_t, unsigned, unsigned);
     61extern int usb_unregister_endpoint(async_exch_t *, usb_endpoint_t,
     62    usb_direction_t);
     63extern int usb_read(async_exch_t *, usb_endpoint_t, uint64_t, void *, size_t,
     64    size_t *);
     65extern int usb_write(async_exch_t *, usb_endpoint_t, uint64_t, const void *,
     66    size_t);
    6467
    6568/** Callback for outgoing transfer. */
  • uspace/lib/drv/include/usbhc_iface.h

    r9befb0d rf126c87  
    4444#include <stdbool.h>
    4545
    46 int usbhc_read(async_exch_t *, usb_address_t, usb_endpoint_t,
     46extern int usbhc_read(async_exch_t *, usb_address_t, usb_endpoint_t,
    4747    uint64_t, void *, size_t, size_t *);
    48 int usbhc_write(async_exch_t *, usb_address_t, usb_endpoint_t,
     48extern int usbhc_write(async_exch_t *, usb_address_t, usb_endpoint_t,
    4949    uint64_t, const void *, size_t);
    5050
  • uspace/lib/gui/button.c

    r9befb0d rf126c87  
    147147}
    148148
    149 bool init_button(button_t *btn, widget_t *parent, const char *caption,
    150     uint16_t points, pixel_t background, pixel_t foreground, pixel_t text)
    151 {
    152         widget_init(&btn->widget, parent);
     149bool init_button(button_t *btn, widget_t *parent, const void *data,
     150    const char *caption, uint16_t points, pixel_t background,
     151    pixel_t foreground, pixel_t text)
     152{
     153        widget_init(&btn->widget, parent, data);
    153154       
    154155        btn->widget.destroy = button_destroy;
     
    191192}
    192193
    193 button_t *create_button(widget_t *parent, const char *caption, uint16_t points,
    194     pixel_t background, pixel_t foreground, pixel_t text)
     194button_t *create_button(widget_t *parent, const void *data, const char *caption,
     195    uint16_t points, pixel_t background, pixel_t foreground, pixel_t text)
    195196{
    196197        button_t *btn = (button_t *) malloc(sizeof(button_t));
     
    198199                return NULL;
    199200       
    200         if (init_button(btn, parent, caption, points, background, foreground,
     201        if (init_button(btn, parent, data, caption, points, background, foreground,
    201202            text))
    202203                return btn;
  • uspace/lib/gui/button.h

    r9befb0d rf126c87  
    5656} button_t;
    5757
    58 extern bool init_button(button_t *, widget_t *, const char *, uint16_t, pixel_t,
    59     pixel_t, pixel_t);
    60 extern button_t *create_button(widget_t *, const char *, uint16_t, pixel_t,
    61     pixel_t, pixel_t);
     58extern bool init_button(button_t *, widget_t *, const void *, const char *,
     59    uint16_t, pixel_t, pixel_t, pixel_t);
     60extern button_t *create_button(widget_t *, const void *, const char *, uint16_t,
     61    pixel_t, pixel_t, pixel_t);
    6262extern void deinit_button(button_t *);
    6363
  • uspace/lib/gui/canvas.c

    r9befb0d rf126c87  
    123123}
    124124
    125 bool init_canvas(canvas_t *canvas, widget_t *parent, sysarg_t width,
    126     sysarg_t height, surface_t *surface)
     125bool init_canvas(canvas_t *canvas, widget_t *parent, const void *data,
     126    sysarg_t width, sysarg_t height, surface_t *surface)
    127127{
    128         widget_init(&canvas->widget, parent);
     128        widget_init(&canvas->widget, parent, data);
    129129       
    130130        canvas->widget.width = width;
     
    161161}
    162162
    163 canvas_t *create_canvas(widget_t *parent, sysarg_t width, sysarg_t height,
    164     surface_t *surface)
     163canvas_t *create_canvas(widget_t *parent, const void *data, sysarg_t width,
     164    sysarg_t height, surface_t *surface)
    165165{
    166166        canvas_t *canvas = (canvas_t *) malloc(sizeof(canvas_t));
     
    168168                return NULL;
    169169       
    170         if (init_canvas(canvas, parent, width, height, surface))
     170        if (init_canvas(canvas, parent, data, width, height, surface))
    171171                return canvas;
    172172       
  • uspace/lib/gui/canvas.h

    r9befb0d rf126c87  
    5353} canvas_t;
    5454
    55 extern bool init_canvas(canvas_t *, widget_t *, sysarg_t, sysarg_t,
     55extern bool init_canvas(canvas_t *, widget_t *, const void *, sysarg_t,
     56    sysarg_t, surface_t *);
     57extern canvas_t *create_canvas(widget_t *, const void *, sysarg_t, sysarg_t,
    5658    surface_t *);
    57 extern canvas_t *create_canvas(widget_t *, sysarg_t, sysarg_t, surface_t *);
    5859extern bool update_canvas(canvas_t *, surface_t *);
    5960extern void deinit_canvas(canvas_t *);
  • uspace/lib/gui/connection.c

    r9befb0d rf126c87  
    198198        list_foreach(sig_node->slots, link, slot_node_t, cur) {
    199199                void *data_copy = NULL;
    200                 if (data != NULL) {
     200                if (data != NULL)
    201201                        data_copy = malloc(data_size);
    202                 }
    203                 if (data_copy != NULL) {
     202               
     203                if (data_copy != NULL)
    204204                        memcpy(data_copy, data, data_size);
    205                 }
     205               
    206206                window_event_t *event =
    207                         (window_event_t *) malloc(sizeof(window_event_t));
    208 
     207                    (window_event_t *) malloc(sizeof(window_event_t));
     208               
    209209                if (event) {
    210210                        link_initialize(&event->link);
     
    215215                        prodcons_produce(&cur->widget->window->events, &event->link);
    216216                } else {
    217                         if (data_copy != NULL) {
     217                        if (data_copy != NULL)
    218218                                free(data_copy);
    219                         }
    220219                }
    221220        }
  • uspace/lib/gui/grid.c

    r9befb0d rf126c87  
    363363}
    364364
    365 bool init_grid(grid_t *grid, widget_t *parent, size_t cols, size_t rows,
    366     pixel_t background)
     365bool init_grid(grid_t *grid, widget_t *parent, const void *data, size_t cols,
     366    size_t rows, pixel_t background)
    367367{
    368368        if ((cols == 0) || (rows == 0))
     
    376376        memset(grid->layout, 0, cols * rows * sizeof(grid_cell_t));
    377377       
    378         widget_init(&grid->widget, parent);
     378        widget_init(&grid->widget, parent, data);
    379379       
    380380        grid->widget.destroy = grid_destroy;
     
    393393}
    394394
    395 grid_t *create_grid(widget_t *parent, size_t cols, size_t rows, pixel_t background)
     395grid_t *create_grid(widget_t *parent, const void *data, size_t cols,
     396    size_t rows, pixel_t background)
    396397{
    397398        grid_t *grid = (grid_t *) malloc(sizeof(grid_t));
     
    399400                return NULL;
    400401       
    401         if (init_grid(grid, parent, cols, rows, background))
     402        if (init_grid(grid, parent, data, cols, rows, background))
    402403                return grid;
    403404       
  • uspace/lib/gui/grid.h

    r9befb0d rf126c87  
    5656} grid_t;
    5757
    58 extern bool init_grid(grid_t *, widget_t *, size_t, size_t, pixel_t);
    59 extern grid_t *create_grid(widget_t *, size_t, size_t, pixel_t);
     58extern bool init_grid(grid_t *, widget_t *, const void *, size_t, size_t,
     59    pixel_t);
     60extern grid_t *create_grid(widget_t *, const void *, size_t, size_t, pixel_t);
    6061extern void deinit_grid(grid_t *);
    6162
  • uspace/lib/gui/label.c

    r9befb0d rf126c87  
    140140}
    141141
    142 bool init_label(label_t *lbl, widget_t *parent, const char *caption,
    143     uint16_t points, pixel_t background, pixel_t text)
    144 {
    145         widget_init(&lbl->widget, parent);
     142bool init_label(label_t *lbl, widget_t *parent, const void *data,
     143    const char *caption, uint16_t points, pixel_t background, pixel_t text)
     144{
     145        widget_init(&lbl->widget, parent, data);
    146146       
    147147        lbl->widget.destroy = label_destroy;
     
    184184}
    185185
    186 label_t *create_label(widget_t *parent, const char *caption, uint16_t points,
    187     pixel_t background, pixel_t text)
     186label_t *create_label(widget_t *parent, const void *data, const char *caption,
     187    uint16_t points, pixel_t background, pixel_t text)
    188188{
    189189        label_t *lbl = (label_t *) malloc(sizeof(label_t));
     
    191191                return NULL;
    192192       
    193         if (init_label(lbl, parent, caption, points, background, text))
     193        if (init_label(lbl, parent, data, caption, points, background, text))
    194194                return lbl;
    195195       
  • uspace/lib/gui/label.h

    r9befb0d rf126c87  
    5555} label_t;
    5656
    57 extern bool init_label(label_t *, widget_t *, const char *, uint16_t, pixel_t,
    58     pixel_t);
    59 extern label_t *create_label(widget_t *, const char *, uint16_t, pixel_t,
    60     pixel_t);
     57extern bool init_label(label_t *, widget_t *, const void *, const char *,
     58    uint16_t, pixel_t, pixel_t);
     59extern label_t *create_label(widget_t *, const void *, const char *, uint16_t,
     60    pixel_t, pixel_t);
    6161extern void deinit_label(label_t *);
    6262
  • uspace/lib/gui/minimal.c

    r9befb0d rf126c87  
    112112}
    113113
    114 bool init_minimal(minimal_t *min, widget_t *parent, pixel_t a, pixel_t b)
     114bool init_minimal(minimal_t *min, widget_t *parent, const void *data, pixel_t a,
     115    pixel_t b)
    115116{
    116         widget_init(&min->widget, parent);
     117        widget_init(&min->widget, parent, data);
    117118
    118119        min->widget.destroy = minimal_destroy;
     
    129130}
    130131
    131 minimal_t *create_minimal(widget_t *parent, pixel_t a, pixel_t b)
     132minimal_t *create_minimal(widget_t *parent, const void *data, pixel_t a,
     133    pixel_t b)
    132134{
    133135        minimal_t *min = (minimal_t *) malloc(sizeof(minimal_t));
     
    136138        }
    137139
    138         if (init_minimal(min, parent, a, b)) {
     140        if (init_minimal(min, parent, data, a, b)) {
    139141                return min;
    140142        } else {
  • uspace/lib/gui/minimal.h

    r9befb0d rf126c87  
    4949} minimal_t;
    5050
    51 extern bool init_minimal(minimal_t *, widget_t *, pixel_t, pixel_t);
    52 extern minimal_t *create_minimal(widget_t *, pixel_t, pixel_t);
     51extern bool init_minimal(minimal_t *, widget_t *, const void *, pixel_t,
     52    pixel_t);
     53extern minimal_t *create_minimal(widget_t *, const void *, pixel_t, pixel_t);
    5354extern void deinit_minimal(minimal_t *);
    5455
     
    5758/** @}
    5859 */
    59 
  • uspace/lib/gui/terminal.c

    r9befb0d rf126c87  
    696696}
    697697
    698 bool init_terminal(terminal_t *term, widget_t *parent, sysarg_t width,
    699     sysarg_t height)
    700 {
    701         widget_init(&term->widget, parent);
     698bool init_terminal(terminal_t *term, widget_t *parent, const void *data,
     699    sysarg_t width, sysarg_t height)
     700{
     701        widget_init(&term->widget, parent, data);
    702702       
    703703        link_initialize(&term->link);
     
    771771}
    772772
    773 terminal_t *create_terminal(widget_t *parent, sysarg_t width, sysarg_t height)
     773terminal_t *create_terminal(widget_t *parent, const void *data, sysarg_t width,
     774    sysarg_t height)
    774775{
    775776        terminal_t *term = (terminal_t *) malloc(sizeof(terminal_t));
     
    777778                return NULL;
    778779       
    779         bool ret = init_terminal(term, parent, width, height);
     780        bool ret = init_terminal(term, parent, data, width, height);
    780781        if (!ret) {
    781782                free(term);
  • uspace/lib/gui/terminal.h

    r9befb0d rf126c87  
    7070} terminal_t;
    7171
    72 extern bool init_terminal(terminal_t *, widget_t *, sysarg_t, sysarg_t);
    73 extern terminal_t *create_terminal(widget_t *, sysarg_t, sysarg_t);
     72extern bool init_terminal(terminal_t *, widget_t *, const void *, sysarg_t,
     73    sysarg_t);
     74extern terminal_t *create_terminal(widget_t *, const void *, sysarg_t,
     75    sysarg_t);
    7476extern void deinit_terminal(terminal_t *);
    7577
  • uspace/lib/gui/widget.c

    r9befb0d rf126c87  
    3636#include "widget.h"
    3737
    38 void widget_init(widget_t *widget, widget_t *parent)
     38/** Link widget with parent and initialize default position and size. */
     39void widget_init(widget_t *widget, widget_t *parent, const void *data)
    3940{
    4041        link_initialize(&widget->link);
    4142        list_initialize(&widget->children);
     43       
    4244        if (parent) {
    4345                widget->parent = parent;
     
    4850                widget->window = NULL;
    4951        }
    50 
     52       
     53        widget->data = data;
     54       
    5155        widget->hpos = 0;
    5256        widget->vpos = 0;
    5357        widget->width = 0;
    5458        widget->height = 0;
    55 
     59       
    5660        widget->width_min = 0;
    5761        widget->height_min = 0;
     
    6266}
    6367
     68/** Change position and size of the widget. */
    6469void widget_modify(widget_t *widget, sysarg_t hpos, sysarg_t vpos,
    6570    sysarg_t width, sysarg_t height)
     
    7176}
    7277
     78/** Get custom client data */
     79const void *widget_get_data(widget_t *widget)
     80{
     81        return widget->data;
     82}
     83
     84/** Unlink widget from its parent. */
    7385void widget_deinit(widget_t *widget)
    7486{
    75         if (widget->parent) {
     87        if (widget->parent)
    7688                list_remove(&widget->link);
    77         }
    7889}
    7990
  • uspace/lib/gui/widget.h

    r9befb0d rf126c87  
    5353struct widget {
    5454        link_t link;
    55         widget_t *parent; /**< Parent widget of this widget. NULL for root widget. */
    56         list_t children; /**< Children widgets of this widget. */
    57         window_t *window; /**< Window into which this widget belongs. */
    58 
     55        widget_t *parent;  /**< Parent widget of this widget. NULL for root widget. */
     56        list_t children;   /**< Children widgets of this widget. */
     57        window_t *window;  /**< Window into which this widget belongs. */
     58        const void *data;  /**< Custom client data. */
     59       
    5960        sysarg_t hpos; /**< Horizontal position in window coordinates. */
    6061        sysarg_t vpos; /**< Vertical position in window coordinates. */
     
    128129 */
    129130
    130 /** Link widget with parent and initialize default position and size. */
    131 extern void widget_init(widget_t *, widget_t *);
    132 /** Just convenience function to change position and size of the widget. */
     131extern void widget_init(widget_t *, widget_t *, const void *);
    133132extern void widget_modify(widget_t *, sysarg_t, sysarg_t, sysarg_t, sysarg_t);
    134 /** Unlink widget from its parent. */
     133extern const void *widget_get_data(widget_t *);
    135134extern void widget_deinit(widget_t *);
    136135
  • uspace/lib/gui/window.c

    r9befb0d rf126c87  
    591591}
    592592
    593 window_t *window_open(const char *winreg, window_flags_t flags,
    594     const char *caption)
     593window_t *window_open(const char *winreg, const void *data,
     594    window_flags_t flags, const char *caption)
    595595{
    596596        window_t *win = (window_t *) malloc(sizeof(window_t));
     
    604604        fibril_mutex_initialize(&win->guard);
    605605       
    606         widget_init(&win->root, NULL);
     606        widget_init(&win->root, NULL, data);
    607607        win->root.window = win;
    608608        win->root.destroy = root_destroy;
  • uspace/lib/gui/window.h

    r9befb0d rf126c87  
    6767 * whole application. Note that opened window does not have any surface yet.
    6868 */
    69 extern window_t *window_open(const char *, window_flags_t, const char *);
     69extern window_t *window_open(const char *, const void *, window_flags_t,
     70    const char *);
    7071
    7172/**
  • uspace/lib/math/arch/amd64/src/sin.S

    r9befb0d rf126c87  
    7777        retq
    7878FUNCTION_END(sin_f64)
    79 
  • uspace/lib/math/arch/ia32/src/cos.S

    r9befb0d rf126c87  
    6464        ret
    6565FUNCTION_END(cos_f64)
    66 
  • uspace/lib/math/arch/ia32/src/sin.S

    r9befb0d rf126c87  
    6464        ret
    6565FUNCTION_END(sin_f64)
    66 
  • uspace/lib/math/arch/ia32/src/trunc.S

    r9befb0d rf126c87  
    6161        ret
    6262FUNCTION_END(trunc_f64)
    63 
  • uspace/lib/uri/Makefile

    r9befb0d rf126c87  
    3131SLIBRARY = liburi.so.0.0
    3232LSONAME = liburi.so.0
    33 #EXTRA_CFLAGS +=
    3433
    3534SOURCES = \
  • uspace/lib/usb/include/usb/classes/hub.h

    r9befb0d rf126c87  
    110110         */
    111111        uint8_t characteristics;
     112
    112113#define HUB_CHAR_POWER_PER_PORT_FLAG    (1 << 0)
    113114#define HUB_CHAR_NO_POWER_SWITCH_FLAG   (1 << 1)
     
    196197 */
    197198/* 7 (basic size) + 2*32 (port bitmasks) */
    198 #define USB_HUB_MAX_DESCRIPTOR_SIZE (7 + 2 * 32)
     199#define USB_HUB_MAX_DESCRIPTOR_SIZE  (7 + 2 * 32)
    199200
    200201#endif
  • uspace/lib/usb/include/usb/debug.h

    r9befb0d rf126c87  
    3838#include <sys/types.h>
    3939#include <io/log.h>
    40 
    4140
    4241void usb_dump_standard_descriptor(FILE *, const char *, const char *,
  • uspace/lib/usb/include/usb/descriptor.h

    r9befb0d rf126c87  
    4545        USB_DESCTYPE_INTERFACE = 4,
    4646        USB_DESCTYPE_ENDPOINT = 5,
    47         /* New in USB2.0 */
     47        /* New in USB 2.0 */
    4848        USB_DESCTYPE_DEVICE_QUALIFIER = 6,
    4949        USB_DESCTYPE_OTHER_SPEED_CONFIGURATION = 7,
     
    202202         * HS INT and ISO transfers. */
    203203        uint16_t max_packet_size;
     204
    204205#define ED_MPS_PACKET_SIZE_MASK  0x3ff
    205206#define ED_MPS_PACKET_SIZE_GET(value) \
     
    207208#define ED_MPS_TRANS_OPPORTUNITIES_GET(value) \
    208209        ((((value) >> 10) & 0x3) + 1)
     210
    209211        /** Polling interval in milliseconds.
    210212         * Ignored for bulk and control endpoints.
  • uspace/lib/usb/include/usb/dev.h

    r9befb0d rf126c87  
    2626 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727 */
     28
    2829/** @addtogroup libusb
    2930 * @{
    3031 */
     32
    3133/** @file
    3234 * Common USB types and functions.
    3335 */
     36
    3437#ifndef LIBUSB_DEV_H_
    3538#define LIBUSB_DEV_H_
     
    3740#include <devman.h>
    3841
    39 int usb_resolve_device_handle(const char *, devman_handle_t *);
     42extern int usb_resolve_device_handle(const char *, devman_handle_t *);
     43
    4044#endif
     45
    4146/**
    4247 * @}
  • uspace/lib/usb/include/usb/usb.h

    r9befb0d rf126c87  
    114114/** Default USB address. */
    115115#define USB_ADDRESS_DEFAULT 0
     116
    116117/** Maximum address number in USB 1.1. */
    117118#define USB11_ADDRESS_MAX 127
     
    121122 *
    122123 * @param ep USB address.
     124 *
    123125 * @return True, if value is wihtin limits, false otherwise.
     126 *
    124127 */
    125128static inline bool usb_address_is_valid(usb_address_t a)
     
    135138/** Default control endpoint */
    136139#define USB_ENDPOINT_DEFAULT_CONTROL 0
     140
    137141/** Maximum endpoint number in USB 1.1. */
    138142#define USB11_ENDPOINT_MAX 16
     
    141145 *
    142146 * @param ep USB endpoint number.
     147 *
    143148 * @return True, if value is wihtin limits, false otherwise.
     149 *
    144150 */
    145151static inline bool usb_endpoint_is_valid(usb_endpoint_t ep)
     
    160166        uint32_t packed;
    161167} usb_target_t;
    162 
    163168
    164169/** Check USB target for allowed values (address and endpoint).
  • uspace/lib/usb/src/usb.c

    r9befb0d rf126c87  
    121121 *
    122122 * @param[in] requst Setup requst data.
     123 *
    123124 * @retval -1 No endpoints need reset.
    124125 * @retval 0 All endpoints need reset.
    125126 * @retval >0 Specified endpoint needs reset.
     127 *
    126128 */
    127129int usb_request_needs_toggle_reset(
  • uspace/lib/usbdev/include/usb/dev/poll.h

    r9befb0d rf126c87  
    9494typedef void (*usb_polling_terminted_callback_t)(usb_device_t *, bool, void *);
    9595
    96 int usb_device_auto_polling(usb_device_t *, usb_endpoint_t,
     96extern int usb_device_auto_polling(usb_device_t *, usb_endpoint_t,
    9797    const usb_device_auto_polling_t *, size_t);
    9898
    99 int usb_device_auto_poll(usb_device_t *, usb_endpoint_t,
     99extern int usb_device_auto_poll(usb_device_t *, usb_endpoint_t,
    100100    usb_polling_callback_t, size_t, int, usb_polling_terminted_callback_t, void *);
    101101
    102 int usb_device_auto_polling_desc(usb_device_t *,
     102extern int usb_device_auto_polling_desc(usb_device_t *,
    103103    const usb_endpoint_description_t *, const usb_device_auto_polling_t *,
    104104    size_t);
    105105
    106 int usb_device_auto_poll_desc(usb_device_t *,
     106extern int usb_device_auto_poll_desc(usb_device_t *,
    107107    const usb_endpoint_description_t *, usb_polling_callback_t, size_t, int,
    108108    usb_polling_terminted_callback_t, void *);
  • uspace/lib/usbdev/include/usb/dev/recognise.h

    r9befb0d rf126c87  
    5050
    5151extern int usb_device_create_match_ids(usb_pipe_t *, match_id_list_t *);
     52
    5253#endif
    5354
  • uspace/lib/usbdev/src/devdrv.c

    r9befb0d rf126c87  
    2727 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2828 */
     29
    2930/** @addtogroup libusbdev
    3031 * @{
     
    5556        /** Connection to device on USB bus */
    5657        usb_dev_session_t *bus_session;
     58       
    5759        /** devman handle */
    5860        devman_handle_t handle;
     61       
    5962        /** The default control pipe. */
    6063        usb_pipe_t ctrl_pipe;
    61 
     64       
    6265        /** Other endpoint pipes.
     66         *
    6367         * This is an array of other endpoint pipes in the same order as
    6468         * in usb_driver_t.
    6569         */
    6670        usb_endpoint_mapping_t *pipes;
     71       
    6772        /** Number of other endpoint pipes. */
    6873        size_t pipes_count;
     74       
    6975        /** Current interface.
     76         *
    7077         * Usually, drivers operate on single interface only.
    7178         * This item contains the value of the interface or -1 for any.
    7279         */
    7380        int interface_no;
     81       
    7482        /** Alternative interfaces. */
    7583        usb_alternate_interfaces_t alternate_interfaces;
     84       
    7685        /** Some useful descriptors for USB device. */
    7786        usb_device_descriptors_t descriptors;
     87       
    7888        /** Generic DDF device backing this one. DO NOT TOUCH! */
    7989        ddf_dev_t *ddf_dev;
     90       
    8091        /** Custom driver data.
     92         *
    8193         * Do not use the entry in generic device, that is already used
    8294         * by the framework.
    8395         */
    8496        void *driver_data;
    85 
    8697} usb_device_t;
    8798
     
    135146                return rc;
    136147        }
    137 
     148       
    138149        /* Change current alternative */
    139150        usb_dev->alternate_interfaces.current = alternate_setting;
     
    279290 *
    280291 * @param[in] usb_dev USB device.
     292 *
    281293 */
    282294void usb_device_destroy_pipes(usb_device_t *usb_dev)
     
    284296        assert(usb_dev);
    285297        assert(usb_dev->pipes || usb_dev->pipes_count == 0);
     298       
    286299        /* Destroy the pipes. */
    287300        for (size_t i = 0; i < usb_dev->pipes_count; ++i) {
     
    291304                        usb_pipe_unregister(&usb_dev->pipes[i].pipe);
    292305        }
     306       
    293307        free(usb_dev->pipes);
    294308        usb_dev->pipes = NULL;
     
    448462        assert(handle);
    449463        assert(iface_no);
     464       
    450465        async_exch_t *exch = async_exchange_begin(sess);
    451466        if (!exch)
    452467                return EPARTY;
     468       
    453469        int ret = usb_get_my_device_handle(exch, handle);
    454470        if (ret == EOK) {
     
    459475                }
    460476        }
     477       
    461478        async_exchange_end(exch);
    462479        return ret;
  • uspace/lib/usbdev/src/devpoll.c

    r9befb0d rf126c87  
    3333 * USB device driver framework - automatic interrupt polling.
    3434 */
     35
    3536#include <usb/dev/device.h>
    3637#include <usb/dev/pipes.h>
     
    8586
    8687        if (params->debug > 0) {
    87                 const usb_endpoint_mapping_t *mapping
    88                     = data->polling_mapping;
     88                const usb_endpoint_mapping_t *mapping =
     89                    data->polling_mapping;
    8990                usb_log_debug("Poll (%p): started polling of `%s' - " \
    9091                    "interface %d (%s,%d,%d), %zuB/%zu.\n",
     
    154155
    155156                /* Take a rest before next request. */
    156                 //TODO: This is broken, the time is in ms not us.
     157               
     158                // FIXME TODO: This is broken, the time is in ms not us.
    157159                // but first we need to fix drivers to actually stop using this,
    158                 // since polling dealy should be implemented in HC schedule
     160                // since polling delay should be implemented in HC schedule
    159161                async_usleep(params->delay);
    160162        }
     
    213215        if (request_size == 0)
    214216                return EINVAL;
    215 
     217       
    216218        if (!epm || (epm->pipe.transfer_type != USB_TRANSFER_INTERRUPT) ||
    217219            (epm->pipe.direction != USB_DIRECTION_IN))
    218220                return EINVAL;
    219 
     221       
    220222
    221223        polling_data_t *polling_data = malloc(sizeof(polling_data_t));
  • uspace/lib/usbdev/src/pipes.c

    r9befb0d rf126c87  
    9898        async_exch_t *exch = async_exchange_begin(pipe->bus_session);
    9999        size_t act_size = 0;
    100         const int rc = usb_read(exch,
    101             pipe->endpoint_no, setup_packet, buffer, buffer_size, &act_size);
     100        const int rc = usb_read(exch, pipe->endpoint_no, setup_packet, buffer,
     101            buffer_size, &act_size);
    102102        async_exchange_end(exch);
    103103
  • uspace/lib/usbdev/src/pipesinit.c

    r9befb0d rf126c87  
    286286    usb_dev_session_t *bus_session)
    287287{
    288 
    289         if (config_descriptor == NULL) {
     288        if (config_descriptor == NULL)
    290289                return EBADMEM;
    291         }
    292         if (config_descriptor_size
    293             < sizeof(usb_standard_configuration_descriptor_t)) {
     290       
     291        if (config_descriptor_size <
     292            sizeof(usb_standard_configuration_descriptor_t)) {
    294293                return ERANGE;
    295294        }
  • uspace/lib/usbdev/src/recognise.c

    r9befb0d rf126c87  
    234234                    (int) device_descriptor->product_id,
    235235                    BCD_ARGS(device_descriptor->device_version));
    236 
     236               
    237237                /* Next, without release number. */
    238238                ADD_MATCHID_OR_RETURN(matches, 90,
     
    245245        ADD_MATCHID_OR_RETURN(matches, 50, "usb&class=%s",
    246246            usb_str_class(device_descriptor->device_class));
    247 
     247       
    248248        /* As a last resort, try fallback driver. */
    249249        ADD_MATCHID_OR_RETURN(matches, 10, "usb&fallback");
  • uspace/lib/usbdev/src/request.c

    r9befb0d rf126c87  
    5050 * @see usb_pipe_control_write
    5151 *
    52  * @param pipe Pipe used for the communication.
     52 * @param pipe         Pipe used for the communication.
    5353 * @param request_type Request type (standard/class/vendor).
    54  * @param recipient Request recipient (e.g. device or endpoint).
    55  * @param request Actual request (e.g. GET_DESCRIPTOR).
    56  * @param value Value of @c wValue field of setup packet
    57  *      (must be in USB endianness).
    58  * @param index Value of @c wIndex field of setup packet
    59  *      (must be in USB endianness).
    60  * @param data Data to be sent during DATA stage
    61  *      (expected to be in USB endianness).
    62  * @param data_size Size of the @p data buffer (in native endianness).
     54 * @param recipient    Request recipient (e.g. device or endpoint).
     55 * @param request      Actual request (e.g. GET_DESCRIPTOR).
     56 * @param value        Value of @c wValue field of setup packet
     57 *                     (must be in USB endianness).
     58 * @param index        Value of @c wIndex field of setup packet
     59 *                     (must be in USB endianness).
     60 * @param data         Data to be sent during DATA stage
     61 *                     (expected to be in USB endianness).
     62 * @param data_size     Size of the @p data buffer (in native endianness).
     63 *
    6364 * @return Error code.
    6465 * @retval EBADMEM @p pipe is NULL.
    6566 * @retval EBADMEM @p data is NULL and @p data_size is not zero.
    6667 * @retval ERANGE Data buffer too large.
     68 *
    6769 */
    6870int usb_control_request_set(usb_pipe_t *pipe,
     
    100102}
    101103
    102  /** Generic wrapper for GET requests using standard control request format.
    103   *
    104   * @see usb_pipe_control_read
    105   *
    106   * @param pipe Pipe used for the communication.
    107   * @param request_type Request type (standard/class/vendor).
    108   * @param recipient Request recipient (e.g. device or endpoint).
    109   * @param request Actual request (e.g. GET_DESCRIPTOR).
    110   * @param value Value of @c wValue field of setup packet
    111   *     (must be in USB endianness).
    112   * @param index Value of @c wIndex field of setup packet
    113   *     (must be in USB endianness).
    114   * @param data Buffer where to store data accepted during the DATA stage.
    115   *     (they will come in USB endianness).
    116   * @param data_size Size of the @p data buffer
    117   *     (in native endianness).
    118   * @param actual_data_size Actual size of transfered data
    119   *     (in native endianness).
    120   * @return Error code.
    121   * @retval EBADMEM @p pipe is NULL.
    122   * @retval EBADMEM @p data is NULL and @p data_size is not zero.
    123   * @retval ERANGE Data buffer too large.
    124   */
     104/** Generic wrapper for GET requests using standard control request format.
     105 *
     106 * @see usb_pipe_control_read
     107 *
     108 * @param pipe             Pipe used for the communication.
     109 * @param request_type     Request type (standard/class/vendor).
     110 * @param recipient        Request recipient (e.g. device or endpoint).
     111 * @param request          Actual request (e.g. GET_DESCRIPTOR).
     112 * @param value            Value of @c wValue field of setup packet
     113 *                         (must be in USB endianness).
     114 * @param index            Value of @c wIndex field of setup packet
     115 *                         (must be in USB endianness).
     116 * @param data             Buffer where to store data accepted during
     117 *                         the DATA stage (they will come in USB endianness).
     118 * @param data_size        Size of the @p data buffer
     119 *                         (in native endianness).
     120 * @param actual_data_size Actual size of transfered data
     121 *                         (in native endianness).
     122 *
     123 * @return Error code.
     124 * @retval EBADMEM @p pipe is NULL.
     125 * @retval EBADMEM @p data is NULL and @p data_size is not zero.
     126 * @retval ERANGE Data buffer too large.
     127 *
     128 */
    125129int usb_control_request_get(usb_pipe_t *pipe,
    126130    usb_request_type_t request_type, usb_request_recipient_t recipient,
     
    209213{
    210214        if (request_type == USB_REQUEST_TYPE_STANDARD) {
    211                 if ((recipient == USB_REQUEST_RECIPIENT_DEVICE) && (index != 0))
    212                 {
     215                if ((recipient == USB_REQUEST_RECIPIENT_DEVICE) && (index != 0)) {
    213216                        return EINVAL;
    214217                }
     
    234237{
    235238        if (request_type == USB_REQUEST_TYPE_STANDARD) {
    236                 if ((recipient == USB_REQUEST_RECIPIENT_DEVICE) && (index != 0))
    237                 {
     239                if ((recipient == USB_REQUEST_RECIPIENT_DEVICE) && (index != 0)) {
    238240                        return EINVAL;
    239241                }
     
    271273        }
    272274
    273         /* The wValue field specifies the descriptor type in the high byte
     275        /*
     276         * The wValue field specifies the descriptor type in the high byte
    274277         * and the descriptor index in the low byte. USB 1.1 spec p. 189
    275278         */
  • uspace/lib/usbhost/include/usb/host/endpoint.h

    r9befb0d rf126c87  
    8888} endpoint_t;
    8989
    90 endpoint_t * endpoint_create(usb_address_t address, usb_endpoint_t endpoint,
    91     usb_direction_t direction, usb_transfer_type_t type, usb_speed_t speed,
    92     size_t max_packet_size, unsigned packets, size_t bw,
    93     usb_address_t tt_address, unsigned tt_port);
    94 void endpoint_destroy(endpoint_t *instance);
     90extern endpoint_t *endpoint_create(usb_address_t, usb_endpoint_t,
     91    usb_direction_t, usb_transfer_type_t, usb_speed_t, size_t, unsigned int,
     92    size_t, usb_address_t, unsigned int);
     93extern void endpoint_destroy(endpoint_t *);
    9594
    96 void endpoint_add_ref(endpoint_t *instance);
    97 void endpoint_del_ref(endpoint_t *instance);
     95extern void endpoint_add_ref(endpoint_t *);
     96extern void endpoint_del_ref(endpoint_t *);
    9897
    99 void endpoint_set_hc_data(endpoint_t *instance,
    100     void *data, int (*toggle_get)(void *), void (*toggle_set)(void *, int));
    101 void endpoint_clear_hc_data(endpoint_t *instance);
     98extern void endpoint_set_hc_data(endpoint_t *, void *, int (*)(void *),
     99    void (*)(void *, int));
     100extern void endpoint_clear_hc_data(endpoint_t *);
    102101
    103 void endpoint_use(endpoint_t *instance);
    104 void endpoint_release(endpoint_t *instance);
     102extern void endpoint_use(endpoint_t *);
     103extern void endpoint_release(endpoint_t *);
    105104
    106 int endpoint_toggle_get(endpoint_t *instance);
    107 void endpoint_toggle_set(endpoint_t *instance, int toggle);
     105extern int endpoint_toggle_get(endpoint_t *);
     106extern void endpoint_toggle_set(endpoint_t *, int);
    108107
    109108/** list_get_instance wrapper.
     109 *
    110110 * @param item Pointer to link member.
     111 *
    111112 * @return Pointer to endpoint_t structure.
     113 *
    112114 */
    113115static inline endpoint_t * endpoint_get_instance(link_t *item)
     
    116118}
    117119#endif
     120
    118121/**
    119122 * @}
  • uspace/lib/usbhost/include/usb/host/hcd.h

    r9befb0d rf126c87  
    8181};
    8282
    83 void hcd_init(hcd_t *hcd, usb_speed_t max_speed, size_t bandwidth,
    84     bw_count_func_t bw_count);
     83extern void hcd_init(hcd_t *, usb_speed_t, size_t, bw_count_func_t);
    8584
    8685static inline void hcd_set_implementation(hcd_t *hcd, void *data,
     
    102101}
    103102
    104 usb_address_t hcd_request_address(hcd_t *hcd, usb_speed_t speed);
     103extern usb_address_t hcd_request_address(hcd_t *, usb_speed_t);
    105104
    106 int hcd_release_address(hcd_t *hcd, usb_address_t address);
     105extern int hcd_release_address(hcd_t *, usb_address_t);
    107106
    108 int hcd_reserve_default_address(hcd_t *hcd, usb_speed_t speed);
     107extern int hcd_reserve_default_address(hcd_t *, usb_speed_t);
    109108
    110109static inline int hcd_release_default_address(hcd_t *hcd)
     
    113112}
    114113
    115 int hcd_add_ep(hcd_t *hcd, usb_target_t target, usb_direction_t dir,
    116     usb_transfer_type_t type, size_t max_packet_size, unsigned packets,
    117     size_t size, usb_address_t tt_address, unsigned tt_port);
     114extern int hcd_add_ep(hcd_t *, usb_target_t, usb_direction_t,
     115    usb_transfer_type_t, size_t, unsigned int, size_t, usb_address_t,
     116    unsigned int);
    118117
    119 int hcd_remove_ep(hcd_t *hcd, usb_target_t target, usb_direction_t dir);
     118extern int hcd_remove_ep(hcd_t *, usb_target_t, usb_direction_t);
    120119
    121 int hcd_send_batch(hcd_t *hcd, usb_target_t target, usb_direction_t direction,
    122     void *data, size_t size, uint64_t setup_data,
    123     usbhc_iface_transfer_in_callback_t in,
    124     usbhc_iface_transfer_out_callback_t out, void *arg, const char* name);
     120extern int hcd_send_batch(hcd_t *, usb_target_t, usb_direction_t, void *,
     121    size_t, uint64_t, usbhc_iface_transfer_in_callback_t,
     122    usbhc_iface_transfer_out_callback_t, void *, const char *);
    125123
    126 ssize_t hcd_send_batch_sync(hcd_t *hcd, usb_target_t target,
    127     usb_direction_t dir, void *data, size_t size, uint64_t setup_data,
    128     const char* name);
     124extern ssize_t hcd_send_batch_sync(hcd_t *, usb_target_t, usb_direction_t,
     125    void *, size_t, uint64_t, const char *);
    129126
    130127#endif
     128
    131129/**
    132130 * @}
  • uspace/lib/usbhost/src/usb_transfer_batch.c

    r9befb0d rf126c87  
    5656 * @return Pointer to valid usb_transfer_batch_t structure, NULL on failure.
    5757 */
    58 usb_transfer_batch_t * usb_transfer_batch_create(
    59     endpoint_t *ep,
    60     char *buffer,
     58usb_transfer_batch_t *usb_transfer_batch_create(endpoint_t *ep, char *buffer,
    6159    size_t buffer_size,
    6260    uint64_t setup_buffer,
    6361    usbhc_iface_transfer_in_callback_t func_in,
    6462    usbhc_iface_transfer_out_callback_t func_out,
    65     void *arg
    66     )
     63    void *arg)
    6764{
    6865        if (func_in == NULL && func_out == NULL)
  • uspace/lib/usbvirt/include/usbvirt/device.h

    r9befb0d rf126c87  
    4141#include <async.h>
    4242#include <errno.h>
    43 
    4443
    4544/** Maximum number of endpoints supported by virtual USB. */
     
    240239};
    241240
    242 
    243 int req_nop(usbvirt_device_t *device,
     241extern int req_nop(usbvirt_device_t *device,
    244242    const usb_device_request_setup_packet_t *setup_packet,
    245243    uint8_t *data, size_t *act_size);
    246244
    247 int usbvirt_device_plug(usbvirt_device_t *, const char *);
    248 void usbvirt_device_unplug(usbvirt_device_t *);
    249 
    250 void usbvirt_control_reply_helper(const usb_device_request_setup_packet_t *,
    251     uint8_t *, size_t *, const void *, size_t);
    252 
    253 int usbvirt_control_write(usbvirt_device_t *, const void *, size_t, void *, size_t);
    254 int usbvirt_control_read(usbvirt_device_t *, const void *, size_t, void *, size_t, size_t *);
    255 int usbvirt_data_out(usbvirt_device_t *, usb_transfer_type_t, usb_endpoint_t,
     245extern int usbvirt_device_plug(usbvirt_device_t *, const char *);
     246extern void usbvirt_device_unplug(usbvirt_device_t *);
     247
     248extern void usbvirt_control_reply_helper(
     249    const usb_device_request_setup_packet_t *, uint8_t *, size_t *,
    256250    const void *, size_t);
    257 int usbvirt_data_in(usbvirt_device_t *, usb_transfer_type_t, usb_endpoint_t,
     251
     252extern int usbvirt_control_write(usbvirt_device_t *, const void *, size_t,
     253    void *, size_t);
     254extern int usbvirt_control_read(usbvirt_device_t *, const void *, size_t,
    258255    void *, size_t, size_t *);
     256extern int usbvirt_data_out(usbvirt_device_t *, usb_transfer_type_t,
     257    usb_endpoint_t, const void *, size_t);
     258extern int usbvirt_data_in(usbvirt_device_t *, usb_transfer_type_t,
     259    usb_endpoint_t, void *, size_t, size_t *);
    259260
    260261#endif
  • uspace/lib/usbvirt/src/ctrltransfer.c

    r9befb0d rf126c87  
    6060                return EFORWARD;
    6161        }
     62       
    6263        const usbvirt_control_request_handler_t *handler = control_handlers;
    6364        for (;handler->callback != NULL; ++handler) {
Note: See TracChangeset for help on using the changeset viewer.