Changeset 8e7c9fe in mainline for uspace/lib/c/include


Ignore:
Timestamp:
2014-09-12T03:45:25Z (11 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c53b58e
Parents:
3eb0c85 (diff), 105d8d6 (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 mainline changes

most usb changes were reverted. blink and usbmass were fixed
known problems:
ehci won't initialize
usbmast asserts on unmount (happens on mainline too)

Location:
uspace/lib/c/include
Files:
2 added
1 deleted
24 edited
6 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/include/adt/list.h

    r3eb0c85 r8e7c9fe  
    3939#include <assert.h>
    4040#include <stdbool.h>
    41 #include <unistd.h>
     41#include <stddef.h>
    4242
    4343/** Doubly linked list link. */
  • uspace/lib/c/include/async.h

    r3eb0c85 r8e7c9fe  
    4545#include <atomic.h>
    4646#include <stdbool.h>
    47 #include <task.h>
     47#include <abi/proc/task.h>
     48#include <abi/ddi/irq.h>
     49#include <abi/ipc/event.h>
    4850
    4951typedef ipc_callid_t aid_t;
     
    6264typedef void (*async_client_conn_t)(ipc_callid_t, ipc_call_t *, void *);
    6365
    64 /** Interrupt handler */
    65 typedef void (*async_interrupt_handler_t)(ipc_callid_t, ipc_call_t *);
     66/** Notification handler */
     67typedef void (*async_notification_handler_t)(ipc_callid_t, ipc_call_t *,
     68    void *);
    6669
    6770/** Exchange management style
     
    155158
    156159extern void async_set_client_connection(async_client_conn_t);
    157 extern void async_set_interrupt_received(async_interrupt_handler_t);
    158 extern void async_set_interrupt_handler_stack_size(size_t);
     160extern void async_set_notification_handler_stack_size(size_t);
     161
     162extern int async_irq_subscribe(int, int, async_notification_handler_t, void *,
     163    const irq_code_t *);
     164extern int async_irq_unsubscribe(int, int);
     165
     166extern int async_event_subscribe(event_type_t, async_notification_handler_t,
     167    void *);
     168extern int async_event_task_subscribe(event_task_type_t,
     169    async_notification_handler_t, void *);
     170extern int async_event_unsubscribe(event_type_t);
     171extern int async_event_task_unsubscribe(event_task_type_t);
     172extern int async_event_unmask(event_type_t);
     173extern int async_event_task_unmask(event_task_type_t);
    159174
    160175/*
  • uspace/lib/c/include/bd.h

    r3eb0c85 r8e7c9fe  
    4848extern int bd_read_toc(bd_t *, uint8_t, void *, size_t);
    4949extern int bd_write_blocks(bd_t *, aoff64_t, size_t, const void *, size_t);
     50extern int bd_sync_cache(bd_t *, aoff64_t, size_t);
    5051extern int bd_get_block_size(bd_t *, size_t *);
    5152extern int bd_get_num_blocks(bd_t *, aoff64_t *);
  • uspace/lib/c/include/bd_srv.h

    r3eb0c85 r8e7c9fe  
    6262        int (*read_blocks)(bd_srv_t *, aoff64_t, size_t, void *, size_t);
    6363        int (*read_toc)(bd_srv_t *, uint8_t, void *, size_t);
     64        int (*sync_cache)(bd_srv_t *, aoff64_t, size_t);
    6465        int (*write_blocks)(bd_srv_t *, aoff64_t, size_t, const void *, size_t);
    6566        int (*get_block_size)(bd_srv_t *, size_t *);
  • uspace/lib/c/include/ddi.h

    r3eb0c85 r8e7c9fe  
    5151
    5252extern int physmem_map(uintptr_t, size_t, unsigned int, void **);
     53extern int physmem_unmap(void *);
    5354
    5455extern int dmamem_map(void *, size_t, unsigned int, unsigned int, uintptr_t *);
     
    6162extern int pio_enable_resource(pio_window_t *, hw_resource_t *, void **);
    6263extern int pio_enable(void *, size_t, void **);
     64extern int pio_disable(void *, size_t);
    6365
    6466typedef void (*trace_fnc)(const volatile void *place, uint32_t val,
     
    130132}
    131133
    132 extern int irq_register(int, int, int, const irq_code_t *);
    133 extern int irq_unregister(int, int);
    134 
    135134#endif
    136135
  • uspace/lib/c/include/fibril.h

    r3eb0c85 r8e7c9fe  
    6767typedef struct fibril {
    6868        link_t link;
     69        link_t all_link;
    6970        context_t ctx;
    7071        void *stack;
  • uspace/lib/c/include/fibril_synch.h

    r3eb0c85 r8e7c9fe  
    116116        /** Timer has fired and has not been cleared since */
    117117        fts_fired,
    118         /** Timer is being destroyed */
    119         fts_cleanup
     118        /** Timer fibril is requested to terminate */
     119        fts_cleanup,
     120        /** Timer fibril acknowledged termination */
     121        fts_clean
    120122} fibril_timer_state_t;
    121123
     
    129131typedef struct {
    130132        fibril_mutex_t lock;
     133        fibril_mutex_t *lockp;
    131134        fibril_condvar_t cv;
    132135        fid_t fibril;
    133136        fibril_timer_state_t state;
     137        bool handler_running;
    134138
    135139        suseconds_t delay;
     
    160164extern void fibril_condvar_broadcast(fibril_condvar_t *);
    161165
    162 extern fibril_timer_t *fibril_timer_create(void);
     166extern fibril_timer_t *fibril_timer_create(fibril_mutex_t *);
    163167extern void fibril_timer_destroy(fibril_timer_t *);
    164168extern void fibril_timer_set(fibril_timer_t *, suseconds_t, fibril_timer_fun_t,
    165169    void *);
     170extern void fibril_timer_set_locked(fibril_timer_t *, suseconds_t,
     171    fibril_timer_fun_t, void *);
    166172extern fibril_timer_state_t fibril_timer_clear(fibril_timer_t *);
     173extern fibril_timer_state_t fibril_timer_clear_locked(fibril_timer_t *);
    167174
    168175#endif
  • uspace/lib/c/include/inet/iplink.h

    r3eb0c85 r8e7c9fe  
    7878typedef struct iplink_ev_ops {
    7979        int (*recv)(iplink_t *, iplink_recv_sdu_t *, ip_ver_t);
     80        int (*change_addr)(iplink_t *, addr48_t);
    8081} iplink_ev_ops_t;
    8182
     
    8889extern int iplink_get_mtu(iplink_t *, size_t *);
    8990extern int iplink_get_mac48(iplink_t *, addr48_t *);
     91extern int iplink_set_mac48(iplink_t *, addr48_t);
    9092
    9193#endif
  • uspace/lib/c/include/inet/iplink_srv.h

    r3eb0c85 r8e7c9fe  
    5959        int (*get_mtu)(iplink_srv_t *, size_t *);
    6060        int (*get_mac48)(iplink_srv_t *, addr48_t *);
     61        int (*set_mac48)(iplink_srv_t *, addr48_t *);
    6162        int (*addr_add)(iplink_srv_t *, inet_addr_t *);
    6263        int (*addr_remove)(iplink_srv_t *, inet_addr_t *);
     
    6768extern int iplink_conn(ipc_callid_t, ipc_call_t *, void *);
    6869extern int iplink_ev_recv(iplink_srv_t *, iplink_recv_sdu_t *, ip_ver_t);
     70extern int iplink_ev_change_addr(iplink_srv_t *, addr48_t *);
    6971
    7072#endif
  • uspace/lib/c/include/io/chardev.h

    r3eb0c85 r8e7c9fe  
    2626 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727 */
    28 /** @addtogroup drvkbd
     28/** @addtogroup libc
    2929 * @{
    3030 */
    31 /** @file
    32  * @brief ps/2 mouse driver.
    33  */
    3431
    35 #ifndef _CHARDEV_H_
    36 #define _CHARDEV_H_
     32#ifndef LIBC_IO_CHARDEV_H_
     33#define LIBC_IO_CHARDEV_H_
    3734
    3835#include <libarch/types.h>
  • uspace/lib/c/include/io/input.h

    r3eb0c85 r8e7c9fe  
    4949
    5050typedef struct input_ev_ops {
     51        int (*active)(input_t *);
     52        int (*deactive)(input_t *);
    5153        int (*key)(input_t *, kbd_event_type_t, keycode_t, keymod_t, wchar_t);
    5254        int (*move)(input_t *, int, int);
     
    5759extern int input_open(async_sess_t *, input_ev_ops_t *, void *, input_t **);
    5860extern void input_close(input_t *);
    59 extern int input_yield(input_t *);
    60 extern int input_reclaim(input_t *);
     61extern int input_activate(input_t *);
    6162
    6263#endif
  • uspace/lib/c/include/io/pixelmap.h

    r3eb0c85 r8e7c9fe  
    11/*
    22 * Copyright (c) 2011 Petr Koupy
     3 * Copyright (c) 2014 Martin Sucha
    34 * All rights reserved.
    45 *
     
    4041#include <unistd.h>
    4142#include <io/pixel.h>
     43
     44/* Defines how a pixel outside of pixmap rectangle shall be treated */
     45typedef enum {
     46        /* Pixels outside of a pixmap are PIXEL(0, 0, 0, 0) */
     47        PIXELMAP_EXTEND_TRANSPARENT_BLACK = 0,
     48       
     49        /* The pixmap is repeated infinetely */
     50        PIXELMAP_EXTEND_TILE,
     51       
     52        /* If outside of a pixmap, return closest pixel from the edge */
     53        PIXELMAP_EXTEND_SIDES,
     54       
     55        /* If outside of a pixmap, return closest pixel from the edge,
     56         * with alpha = 0
     57         */
     58        PIXELMAP_EXTEND_TRANSPARENT_SIDES
     59} pixelmap_extend_t;
    4260
    4361typedef struct {
     
    86104}
    87105
     106static inline pixel_t pixelmap_get_extended_pixel(pixelmap_t *pixmap,
     107    native_t x, native_t y, pixelmap_extend_t extend)
     108{
     109        bool transparent = false;
     110        if (extend == PIXELMAP_EXTEND_TILE) {
     111                x %= pixmap->width;
     112                y %= pixmap->height;
     113        }
     114        else if (extend == PIXELMAP_EXTEND_SIDES ||
     115            extend == PIXELMAP_EXTEND_TRANSPARENT_SIDES) {
     116                bool transparent_outside =
     117                    (extend == PIXELMAP_EXTEND_TRANSPARENT_SIDES);
     118                if (x < 0) {
     119                        x = 0;
     120                        transparent = transparent_outside;
     121                }
     122                else if (((sysarg_t) x) >= pixmap->width) {
     123                        x = pixmap->width - 1;
     124                        transparent = transparent_outside;
     125                }
     126               
     127                if (y < 0) {
     128                        y = 0;
     129                        transparent = transparent_outside;
     130                }
     131                else if (((sysarg_t) y) >= pixmap->height) {
     132                        y = pixmap->height - 1;
     133                        transparent = transparent_outside;
     134                }
     135        }
     136       
     137        if (x < 0 || ((sysarg_t) x) >= pixmap->width ||
     138            y < 0 || ((sysarg_t) y) >= pixmap->height)
     139                return PIXEL(0, 0, 0, 0);
     140
     141        pixel_t pixel = pixelmap_get_pixel(pixmap, x, y);
     142       
     143        if (transparent)
     144                pixel = PIXEL(0, RED(pixel), GREEN(pixel), BLUE(pixel));
     145       
     146        return pixel;
     147}
     148
     149
    88150#endif
    89151
  • uspace/lib/c/include/ipc/bd.h

    r3eb0c85 r8e7c9fe  
    4242        BD_GET_NUM_BLOCKS,
    4343        BD_READ_BLOCKS,
     44        BD_SYNC_CACHE,
    4445        BD_WRITE_BLOCKS,
    4546        BD_READ_TOC
  • uspace/lib/c/include/ipc/chardev.h

    r3eb0c85 r8e7c9fe  
    11/*
    2  * Copyright (c) 2003-2004 Jakub Jermar
     2 * Copyright (c) 2014 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup mips64
     29/** @addtogroup libcipc
    3030 * @{
    3131 */
    3232/** @file
     33 * @brief Character device interface.
    3334 */
    3435
    35 #ifndef KERN_mips64_CPU_H_
    36 #define KERN_mips64_CPU_H_
     36#ifndef LIBC_IPC_CHARDEV_H_
     37#define LIBC_IPC_CHARDEV_H_
    3738
    38 #include <typedefs.h>
    39 #include <arch/asm.h>
     39#include <ipc/common.h>
    4040
    41 typedef struct {
    42         uint32_t imp_num;
    43         uint32_t rev_num;
    44 } cpu_arch_t;
     41typedef enum {
     42        CHARDEV_READ = IPC_FIRST_USER_METHOD,
     43        CHARDEV_WRITE
     44} chardev_request_t;
    4545
    4646#endif
  • uspace/lib/c/include/ipc/common.h

    r3eb0c85 r8e7c9fe  
    3939#include <abi/ipc/ipc.h>
    4040#include <atomic.h>
    41 #include <task.h>
     41#include <abi/proc/task.h>
    4242
    4343#define IPC_FLAG_BLOCKING  0x01
  • uspace/lib/c/include/ipc/dev_iface.h

    r3eb0c85 r8e7c9fe  
    4141        CHAR_DEV_IFACE,
    4242
    43         /** Graphic device interface */
    44         GRAPH_DEV_IFACE,
    45 
    4643        /** Audio device mixer interface */
    4744        AUDIO_MIXER_IFACE,
     
    6461        /** Interface provided by Real Time Clock devices */
    6562        CLOCK_DEV_IFACE,
     63
     64        /** Interface provided by LED devices */
     65        LED_DEV_IFACE,
    6666
    6767        /** Interface provided by battery powered devices */
  • uspace/lib/c/include/ipc/event.h

    r3eb0c85 r8e7c9fe  
    3333 */
    3434
    35 #ifndef LIBC_EVENT_H_
    36 #define LIBC_EVENT_H_
     35#ifndef LIBC_IPC_EVENT_H_
     36#define LIBC_IPC_EVENT_H_
    3737
    3838#include <abi/ipc/event.h>
    3939#include <libarch/types.h>
    4040
    41 extern int event_subscribe(event_type_t, sysarg_t);
    42 extern int event_task_subscribe(event_task_type_t, sysarg_t);
    43 extern int event_unmask(event_type_t);
    44 extern int event_task_unmask(event_task_type_t);
     41extern int ipc_event_subscribe(event_type_t, sysarg_t);
     42extern int ipc_event_task_subscribe(event_task_type_t, sysarg_t);
     43extern int ipc_event_unsubscribe(event_type_t);
     44extern int ipc_event_task_unsubscribe(event_task_type_t);
     45extern int ipc_event_unmask(event_type_t);
     46extern int ipc_event_task_unmask(event_task_type_t);
    4547
    4648#endif
  • uspace/lib/c/include/ipc/input.h

    r3eb0c85 r8e7c9fe  
    3939
    4040typedef enum {
    41         INPUT_YIELD = IPC_FIRST_USER_METHOD,
    42         INPUT_RECLAIM
     41        INPUT_ACTIVATE = IPC_FIRST_USER_METHOD
    4342} input_request_t;
    4443
    4544typedef enum {
    46         INPUT_EVENT_KEY = IPC_FIRST_USER_METHOD,
     45        INPUT_EVENT_ACTIVE = IPC_FIRST_USER_METHOD,
     46        INPUT_EVENT_DEACTIVE,
     47        INPUT_EVENT_KEY,
    4748        INPUT_EVENT_MOVE,
    4849        INPUT_EVENT_ABS_MOVE,
  • uspace/lib/c/include/ipc/ipc.h

    r3eb0c85 r8e7c9fe  
    4444#include <abi/ipc/methods.h>
    4545#include <abi/synch.h>
    46 #include <task.h>
     46#include <abi/proc/task.h>
    4747
    4848typedef void (*ipc_async_callback_t)(void *, int, ipc_call_t *);
  • uspace/lib/c/include/ipc/iplink.h

    r3eb0c85 r8e7c9fe  
    4141        IPLINK_GET_MTU = IPC_FIRST_USER_METHOD,
    4242        IPLINK_GET_MAC48,
     43        IPLINK_SET_MAC48,
    4344        IPLINK_SEND,
    4445        IPLINK_SEND6,
     
    4849
    4950typedef enum {
    50         IPLINK_EV_RECV = IPC_FIRST_USER_METHOD
     51        IPLINK_EV_RECV = IPC_FIRST_USER_METHOD,
     52        IPLINK_EV_CHANGE_ADDR,
    5153} iplink_event_t;
    5254
  • uspace/lib/c/include/ipc/irc.h

    r3eb0c85 r8e7c9fe  
    3333 */
    3434
    35 #ifndef LIBC_IRC_H_
    36 #define LIBC_IRC_H_
     35#ifndef LIBC_IPC_IRC_H_
     36#define LIBC_IPC_IRC_H_
    3737
    3838#include <ipc/common.h>
  • uspace/lib/c/include/ipc/irq.h

    r3eb0c85 r8e7c9fe  
    11/*
    2  * Copyright (c) 2005 Martin Decky
     2 * Copyright (c) 2014 Martin Decky
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup mips64mm
     29/** @addtogroup libc
    3030 * @{
    3131 */
     
    3333 */
    3434
    35 #ifndef KERN_mips64_ASID_H_
    36 #define KERN_mips64_ASID_H_
     35#ifndef LIBC_IPC_IRQ_H_
     36#define LIBC_IPC_IRQ_H_
    3737
    38 #include <typedefs.h>
     38#include <sys/types.h>
     39#include <abi/ddi/irq.h>
    3940
    40 #define ASID_MAX_ARCH  255    /* 2^8 - 1 */
    41 
    42 typedef uint8_t asid_t;
     41extern int ipc_irq_subscribe(int, int, sysarg_t, const irq_code_t *);
     42extern int ipc_irq_unsubscribe(int, int);
    4343
    4444#endif
  • uspace/lib/c/include/irc.h

    r3eb0c85 r8e7c9fe  
    11/*
    2  * Copyright (c) 2011 Petr Koupy
     2 * Copyright (c) 2014 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    3333 */
    3434
    35 #ifndef LIBC_DEVICE_GRAPH_DEV_H_
    36 #define LIBC_DEVICE_GRAPH_DEV_H_
     35#ifndef LIBC_IRC_H_
     36#define LIBC_IRC_H_
    3737
    38 #include <async.h>
    39 
    40 extern int graph_dev_connect(async_sess_t *);
     38extern int irc_enable_interrupt(int);
     39extern int irc_disable_interrupt(int);
    4140
    4241#endif
  • uspace/lib/c/include/loader/loader.h

    r3eb0c85 r8e7c9fe  
    3737#define LIBC_LOADER_H_
    3838
    39 #include <task.h>
     39#include <abi/proc/task.h>
    4040
    4141/** Forward declararion */
  • uspace/lib/c/include/stacktrace.h

    r3eb0c85 r8e7c9fe  
    4141
    4242typedef struct {
     43        int (*read_uintptr)(void *, uintptr_t, uintptr_t *);
     44} stacktrace_ops_t;
     45
     46typedef struct {
    4347        void *op_arg;
    44         int (*read_uintptr)(void *, uintptr_t, uintptr_t *);
     48        stacktrace_ops_t *ops;
    4549} stacktrace_t;
    4650
    4751extern void stacktrace_print(void);
    4852extern void stacktrace_print_fp_pc(uintptr_t, uintptr_t);
     53extern void stacktrace_print_generic(stacktrace_ops_t *, void *, uintptr_t,
     54    uintptr_t);
    4955
    5056/*
  • uspace/lib/c/include/stddef.h

    r3eb0c85 r8e7c9fe  
    3838#include <sys/types.h>
    3939
     40#ifndef NULL
     41        #define NULL  ((void *) 0)
     42#endif
     43
     44
    4045#endif
    4146
  • uspace/lib/c/include/stdio.h

    r3eb0c85 r8e7c9fe  
    120120extern int snprintf(char *, size_t , const char *, ...)
    121121    PRINTF_ATTRIBUTE(3, 4);
     122extern int vasprintf(char **, const char *, va_list);
    122123extern int asprintf(char **, const char *, ...)
    123124    PRINTF_ATTRIBUTE(2, 3);
  • uspace/lib/c/include/str.h

    r3eb0c85 r8e7c9fe  
    109109extern char *str_ndup(const char *, size_t max_size);
    110110
     111extern char *str_tok(char *, const char *, char **);
     112
    111113extern int str_uint8_t(const char *, const char **, unsigned int, bool,
    112114    uint8_t *);
     
    132134extern unsigned long strtoul(const char *, char **, int);
    133135
    134 extern char * strtok_r(char *, const char *, char **);
    135 extern char * strtok(char *, const char *);
    136 
    137136#endif
    138137
  • uspace/lib/c/include/task.h

    r3eb0c85 r8e7c9fe  
    3939#include <abi/proc/task.h>
    4040#include <stdarg.h>
     41#include <async.h>
     42#include <types/task.h>
    4143
    42 typedef enum {
    43         TASK_EXIT_NORMAL,
    44         TASK_EXIT_UNEXPECTED
    45 } task_exit_t;
     44typedef struct {
     45        ipc_call_t result;
     46        aid_t aid;
     47} task_wait_t;
     48
     49struct _TASK;
     50typedef struct _TASK task_t;
    4651
    4752extern task_id_t task_get_id(void);
     
    4954extern int task_kill(task_id_t);
    5055
    51 extern int task_spawnv(task_id_t *, const char *path, const char *const []);
    52 extern int task_spawnvf(task_id_t *, const char *path, const char *const [],
    53     int *const []);
    54 extern int task_spawn(task_id_t *, const char *path, int, va_list ap);
    55 extern int task_spawnl(task_id_t *, const char *path, ...);
     56extern int task_spawnv(task_id_t *, task_wait_t *, const char *path,
     57    const char *const []);
     58extern int task_spawnvf(task_id_t *, task_wait_t *, const char *path,
     59    const char *const [], int *const []);
     60extern int task_spawn(task_id_t *, task_wait_t *, const char *path, int,
     61    va_list ap);
     62extern int task_spawnl(task_id_t *, task_wait_t *, const char *path, ...);
    5663
    57 extern int task_wait(task_id_t id, task_exit_t *, int *);
     64extern int task_setup_wait(task_id_t, task_wait_t *);
     65extern void task_cancel_wait(task_wait_t *);
     66extern int task_wait(task_wait_t *, task_exit_t *, int *);
     67extern int task_wait_task_id(task_id_t, task_exit_t *, int *);
    5868extern int task_retval(int);
    5969
  • uspace/lib/c/include/types/task.h

    r3eb0c85 r8e7c9fe  
    2727 */
    2828
    29 /** @addtogroup mips64proc
     29/** @addtogroup libc
    3030 * @{
    3131 */
     
    3333 */
    3434
    35 #ifndef KERN_mips64_TASK_H_
    36 #define KERN_mips64_TASK_H_
     35#ifndef LIBC_TYPES_TASK_H_
     36#define LIBC_TYPES_TASK_H_
    3737
    38 typedef struct {
    39 } task_arch_t;
    40 
    41 #define task_create_arch(task)
    42 #define task_destroy_arch(task)
     38typedef enum {
     39        TASK_EXIT_NORMAL,
     40        TASK_EXIT_UNEXPECTED
     41} task_exit_t;
    4342
    4443#endif
Note: See TracChangeset for help on using the changeset viewer.