Changeset 132ab5d1 in mainline for uspace/lib/c/include


Ignore:
Timestamp:
2018-01-30T03:20:45Z (8 years ago)
Author:
Jenda <jenda.jzqk73@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5a6cc679
Parents:
8bfb163 (diff), 6a5d05b (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 commit '6a5d05bd2551e64111bea4f9332dd7448c26ce84' into forwardport

Separate return value from error code in gen_irq_code*().

Location:
uspace/lib/c/include
Files:
29 edited
2 moved

Legend:

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

    r8bfb163 r132ab5d1  
    11/*
    2  * Copyright (c) 2009 Jiri Svoboda
     2 * Copyright (c) 2017 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup libcipc
     29/** @addtogroup libc
    3030 * @{
    3131 */
    32 /** @file
    33  * @brief Character device interface.
     32/** @file Circular buffer
    3433 */
    3534
    36 #ifndef LIBC_IPC_CHAR_H_
    37 #define LIBC_IPC_CHAR_H_
     35#ifndef LIBC_CIRC_BUF_H_
     36#define LIBC_CIRC_BUF_H_
    3837
    39 #include <ipc/common.h>
     38#include <stddef.h>
    4039
    41 typedef enum {
    42         CHAR_WRITE_BYTE = IPC_FIRST_USER_METHOD
    43 } char_request_t;
     40/** Circular buffer */
     41typedef struct {
     42        /** Buffer */
     43        void *buf;
     44        /** Number of buffer members */
     45        size_t nmemb;
     46        /** Member size */
     47        size_t size;
     48        /** Read position */
     49        size_t rp;
     50        /** Write position */
     51        size_t wp;
     52        /** Number of used entries */
     53        size_t nused;
     54} circ_buf_t;
    4455
    45 typedef enum {
    46         CHAR_NOTIF_BYTE = IPC_FIRST_USER_METHOD
    47 } char_notif_t;
     56extern void circ_buf_init(circ_buf_t *, void *, size_t, size_t);
     57extern size_t circ_buf_nfree(circ_buf_t *);
     58extern size_t circ_buf_nused(circ_buf_t *);
     59extern int circ_buf_push(circ_buf_t *, const void *);
     60extern int circ_buf_pop(circ_buf_t *, void *);
    4861
    4962#endif
  • uspace/lib/c/include/adt/fifo.h

    r8bfb163 r132ab5d1  
    4646#define LIBC_FIFO_H_
    4747
    48 #include <malloc.h>
     48#include <stdlib.h>
    4949
    5050typedef unsigned long fifo_count_t;
  • uspace/lib/c/include/async.h

    r8bfb163 r132ab5d1  
    4949#include <abi/ipc/event.h>
    5050#include <abi/ipc/interfaces.h>
    51 
    52 typedef ipc_callid_t aid_t;
     51#include <abi/cap.h>
     52
     53typedef sysarg_t aid_t;
    5354typedef sysarg_t port_id_t;
    5455
     
    5859/** Port connection handler
    5960 *
    60  * @param callid ID of incoming call or 0 if connection initiated from
    61  *               inside using async_create_callback_port()
    62  * @param call   Incoming call or 0 if connection initiated from inside
    63  *               using async_create_callback_port()
    64  * @param arg    Local argument.
    65  *
    66  */
    67 typedef void (*async_port_handler_t)(ipc_callid_t, ipc_call_t *, void *);
     61 * @param chandle  Handle of the incoming call or CAP_NIL if connection
     62 *                 initiated from inside using async_create_callback_port()
     63 * @param call     Incoming call or 0 if connection initiated from inside
     64 *                 using async_create_callback_port()
     65 * @param arg      Local argument.
     66 *
     67 */
     68typedef void (*async_port_handler_t)(cap_handle_t, ipc_call_t *, void *);
    6869
    6970/** Notification handler */
    70 typedef void (*async_notification_handler_t)(ipc_callid_t, ipc_call_t *,
    71     void *);
     71typedef void (*async_notification_handler_t)(ipc_call_t *, void *);
    7272
    7373/** Exchange management style
     
    119119        async_get_call_timeout(data, 0)
    120120
    121 extern ipc_callid_t async_get_call_timeout(ipc_call_t *, suseconds_t);
     121extern cap_handle_t async_get_call_timeout(ipc_call_t *, suseconds_t);
    122122
    123123/*
     
    146146    sysarg_t, sysarg_t, sysarg_t, ipc_call_t *);
    147147
    148 extern void async_wait_for(aid_t, sysarg_t *);
    149 extern int async_wait_timeout(aid_t, sysarg_t *, suseconds_t);
     148extern void async_wait_for(aid_t, int *);
     149extern int async_wait_timeout(aid_t, int *, suseconds_t);
    150150extern void async_forget(aid_t);
    151151
    152152extern void async_usleep(suseconds_t);
     153extern void async_sleep(unsigned int);
     154
    153155extern void async_create_manager(void);
    154156extern void async_destroy_manager(void);
     
    167169
    168170extern int async_irq_subscribe(int, async_notification_handler_t, void *,
    169     const irq_code_t *);
    170 extern int async_irq_unsubscribe(int);
     171    const irq_code_t *, cap_handle_t *);
     172extern int async_irq_unsubscribe(cap_handle_t);
    171173
    172174extern int async_event_subscribe(event_type_t, async_notification_handler_t,
     
    196198 */
    197199
    198 extern sysarg_t async_answer_0(ipc_callid_t, sysarg_t);
    199 extern sysarg_t async_answer_1(ipc_callid_t, sysarg_t, sysarg_t);
    200 extern sysarg_t async_answer_2(ipc_callid_t, sysarg_t, sysarg_t, sysarg_t);
    201 extern sysarg_t async_answer_3(ipc_callid_t, sysarg_t, sysarg_t, sysarg_t,
     200extern int async_answer_0(cap_handle_t, int);
     201extern int async_answer_1(cap_handle_t, int, sysarg_t);
     202extern int async_answer_2(cap_handle_t, int, sysarg_t, sysarg_t);
     203extern int async_answer_3(cap_handle_t, int, sysarg_t, sysarg_t,
    202204    sysarg_t);
    203 extern sysarg_t async_answer_4(ipc_callid_t, sysarg_t, sysarg_t, sysarg_t,
     205extern int async_answer_4(cap_handle_t, int, sysarg_t, sysarg_t,
    204206    sysarg_t, sysarg_t);
    205 extern sysarg_t async_answer_5(ipc_callid_t, sysarg_t, sysarg_t, sysarg_t,
     207extern int async_answer_5(cap_handle_t, int, sysarg_t, sysarg_t,
    206208    sysarg_t, sysarg_t, sysarg_t);
    207209
     
    210212 */
    211213
    212 extern int async_forward_fast(ipc_callid_t, async_exch_t *, sysarg_t, sysarg_t,
     214extern int async_forward_fast(cap_handle_t, async_exch_t *, sysarg_t, sysarg_t,
    213215    sysarg_t, unsigned int);
    214 extern int async_forward_slow(ipc_callid_t, async_exch_t *, sysarg_t, sysarg_t,
     216extern int async_forward_slow(cap_handle_t, async_exch_t *, sysarg_t, sysarg_t,
    215217    sysarg_t, sysarg_t, sysarg_t, sysarg_t, unsigned int);
    216218
     
    336338            rc3, rc4, rc5)
    337339
    338 extern sysarg_t async_req_fast(async_exch_t *, sysarg_t, sysarg_t, sysarg_t,
     340extern int async_req_fast(async_exch_t *, sysarg_t, sysarg_t, sysarg_t,
    339341    sysarg_t, sysarg_t, sysarg_t *, sysarg_t *, sysarg_t *, sysarg_t *,
    340342    sysarg_t *);
    341 extern sysarg_t async_req_slow(async_exch_t *, sysarg_t, sysarg_t, sysarg_t,
     343extern int async_req_slow(async_exch_t *, sysarg_t, sysarg_t, sysarg_t,
    342344    sysarg_t, sysarg_t, sysarg_t, sysarg_t *, sysarg_t *, sysarg_t *,
    343345    sysarg_t *, sysarg_t *);
     
    382384extern int async_share_in_start(async_exch_t *, size_t, sysarg_t,
    383385    unsigned int *, void **);
    384 extern bool async_share_in_receive(ipc_callid_t *, size_t *);
    385 extern int async_share_in_finalize(ipc_callid_t, void *, unsigned int);
     386extern bool async_share_in_receive(cap_handle_t *, size_t *);
     387extern int async_share_in_finalize(cap_handle_t, void *, unsigned int);
    386388
    387389extern int async_share_out_start(async_exch_t *, void *, unsigned int);
    388 extern bool async_share_out_receive(ipc_callid_t *, size_t *, unsigned int *);
    389 extern int async_share_out_finalize(ipc_callid_t, void **);
     390extern bool async_share_out_receive(cap_handle_t *, size_t *, unsigned int *);
     391extern int async_share_out_finalize(cap_handle_t, void **);
    390392
    391393/*
     
    421423extern aid_t async_data_read(async_exch_t *, void *, size_t, ipc_call_t *);
    422424extern int async_data_read_start(async_exch_t *, void *, size_t);
    423 extern bool async_data_read_receive(ipc_callid_t *, size_t *);
    424 extern bool async_data_read_receive_call(ipc_callid_t *, ipc_call_t *, size_t *);
    425 extern int async_data_read_finalize(ipc_callid_t, const void *, size_t);
     425extern bool async_data_read_receive(cap_handle_t *, size_t *);
     426extern bool async_data_read_receive_call(cap_handle_t *, ipc_call_t *, size_t *);
     427extern int async_data_read_finalize(cap_handle_t, const void *, size_t);
    426428
    427429extern int async_data_read_forward_fast(async_exch_t *, sysarg_t, sysarg_t,
     
    460462
    461463extern int async_data_write_start(async_exch_t *, const void *, size_t);
    462 extern bool async_data_write_receive(ipc_callid_t *, size_t *);
    463 extern bool async_data_write_receive_call(ipc_callid_t *, ipc_call_t *, size_t *);
    464 extern int async_data_write_finalize(ipc_callid_t, void *, size_t);
     464extern bool async_data_write_receive(cap_handle_t *, size_t *);
     465extern bool async_data_write_receive_call(cap_handle_t *, ipc_call_t *, size_t *);
     466extern int async_data_write_finalize(cap_handle_t, void *, size_t);
    465467
    466468extern int async_data_write_accept(void **, const bool, const size_t,
    467469    const size_t, const size_t, size_t *);
    468 extern void async_data_write_void(sysarg_t);
     470extern void async_data_write_void(int);
    469471
    470472extern int async_data_write_forward_fast(async_exch_t *, sysarg_t, sysarg_t,
     
    476478extern int async_state_change_start(async_exch_t *, sysarg_t, sysarg_t,
    477479    sysarg_t, async_exch_t *);
    478 extern bool async_state_change_receive(ipc_callid_t *, sysarg_t *, sysarg_t *,
     480extern bool async_state_change_receive(cap_handle_t *, sysarg_t *, sysarg_t *,
    479481    sysarg_t *);
    480 extern int async_state_change_finalize(ipc_callid_t, async_exch_t *);
     482extern int async_state_change_finalize(cap_handle_t, async_exch_t *);
    481483
    482484extern void *async_remote_state_acquire(async_sess_t *);
  • uspace/lib/c/include/bd.h

    r8bfb163 r132ab5d1  
    3030 * @{
    3131 */
    32 /** @file
     32/** @file Block device client interface
    3333 */
    3434
  • uspace/lib/c/include/device/hw_res.h

    r8bfb163 r132ab5d1  
    123123extern int hw_res_dma_channel_setup(async_sess_t *, unsigned int, uint32_t,
    124124    uint32_t, uint8_t);
    125 extern int hw_res_dma_channel_remain(async_sess_t *, unsigned);
     125extern int hw_res_dma_channel_remain(async_sess_t *, unsigned, size_t *);
    126126
    127127#endif
  • uspace/lib/c/include/elf/elf_mod.h

    r8bfb163 r132ab5d1  
    5353#define EE_LOADER               5       /* The image is actually a program loader. */
    5454#define EE_IRRECOVERABLE        6
     55#define EE_IO                   7       /* Could not read file. */
    5556
    5657typedef enum {
  • uspace/lib/c/include/errno.h

    r8bfb163 r132ab5d1  
    3636#define LIBC_ERRNO_H_
    3737
     38#include <_bits/errno.h>
    3839#include <abi/errno.h>
    3940
    4041#define errno  (*(__errno()))
    4142
    42 extern int *__errno(void) __attribute__((const));
    43 
    44 #define EMFILE        (-18)
    45 #define ENAMETOOLONG  (-256)
    46 #define EISDIR        (-257)
    47 #define ENOTDIR       (-258)
    48 #define ENOSPC        (-259)
    49 #define ENOTEMPTY     (-261)
    50 #define EBADF         (-262)
    51 #define EDOM          (-263)
    52 #define ERANGE        (-264)
    53 #define EXDEV         (-265)
    54 #define EIO           (-266)
    55 #define EMLINK        (-267)
    56 #define ENXIO         (-268)
    57 #define ENOFS         (-269)
    58 
    59 /** Bad checksum. */
    60 #define EBADCHECKSUM  (-300)
    61 
    62 /** USB: stalled operation. */
    63 #define ESTALL (-301)
    64 
    65 /** Empty resource (no data). */
    66 #define EEMPTY (-302)
    67 
    68 /** Negative acknowledgment. */
    69 #define ENAK (-303)
    70 
    71 /** The requested operation was not performed. Try again later. */
    72 #define EAGAIN  (-11002)
     43extern errno_t *__errno(void) __attribute__((const));
    7344
    7445#endif
  • uspace/lib/c/include/fibril.h

    r8bfb163 r132ab5d1  
    102102extern void fibril_remove_manager(void);
    103103extern fid_t fibril_get_id(void);
    104 extern void fibril_inc_sercount(void);
    105 extern void fibril_dec_sercount(void);
    106 extern int fibril_get_sercount(void);
    107104
    108105static inline int fibril_yield(void)
  • uspace/lib/c/include/fibril_synch.h

    r8bfb163 r132ab5d1  
    173173extern fibril_timer_state_t fibril_timer_clear(fibril_timer_t *);
    174174extern fibril_timer_state_t fibril_timer_clear_locked(fibril_timer_t *);
    175 extern void fibril_usleep(useconds_t);
    176 extern void fibril_sleep(unsigned int);
    177175
    178176#endif
  • uspace/lib/c/include/futex.h

    r8bfb163 r132ab5d1  
    3737
    3838#include <atomic.h>
     39#include <errno.h>
    3940#include <libc.h>
    4041
     
    107108 * @param futex Futex.
    108109 *
    109  * @return Non-zero if the futex was acquired.
    110  * @return Zero if the futex was not acquired.
     110 * @return true if the futex was acquired.
     111 * @return false if the futex was not acquired.
    111112 *
    112113 */
    113 static inline int futex_trydown(futex_t *futex)
     114static inline bool futex_trydown(futex_t *futex)
    114115{
    115116        return cas(&futex->val, 1, 0);
     
    121122 *
    122123 * @return ENOENT if there is no such virtual address.
    123  * @return Zero in the uncontended case.
    124  * @return Otherwise one of ESYNCH_OK_ATOMIC or ESYNCH_OK_BLOCKED.
     124 * @return EOK on success.
     125 * @return Error code from <errno.h> otherwise.
    125126 *
    126127 */
     
    128129{
    129130        if ((atomic_signed_t) atomic_predec(&futex->val) < 0)
    130                 return __SYSCALL1(SYS_FUTEX_SLEEP, (sysarg_t) &futex->val.count);
     131                return (int) __SYSCALL1(SYS_FUTEX_SLEEP, (sysarg_t) &futex->val.count);
    131132       
    132         return 0;
     133        return EOK;
    133134}
    134135
     
    138139 *
    139140 * @return ENOENT if there is no such virtual address.
    140  * @return Zero in the uncontended case.
     141 * @return EOK on success.
     142 * @return Error code from <errno.h> otherwise.
    141143 *
    142144 */
     
    144146{
    145147        if ((atomic_signed_t) atomic_postinc(&futex->val) < 0)
    146                 return __SYSCALL1(SYS_FUTEX_WAKEUP, (sysarg_t) &futex->val.count);
     148                return (int) __SYSCALL1(SYS_FUTEX_WAKEUP, (sysarg_t) &futex->val.count);
    147149       
    148         return 0;
     150        return EOK;
    149151}
    150152
  • uspace/lib/c/include/ieee80211/ieee80211.h

    r8bfb163 r132ab5d1  
    3838#define LIBC_IEEE80211_H_
    3939
    40 #include <malloc.h>
    4140#include <adt/list.h>
    4241#include <nic/nic.h>
  • uspace/lib/c/include/io/chardev.h

    r8bfb163 r132ab5d1  
    11/*
    22 * Copyright (c) 2011 Jan Vesely
     3 * Copyright (c) 2017 Jiri Svoboda
    34 * All rights reserved.
    45 *
     
    3334#define LIBC_IO_CHARDEV_H_
    3435
    35 #include <types/common.h>
    3636#include <async.h>
     37#include <stddef.h>
    3738
    38 ssize_t chardev_read(async_exch_t *, void *, size_t);
    39 ssize_t chardev_write(async_exch_t *, const void *, size_t);
     39typedef struct {
     40        async_sess_t *sess;
     41} chardev_t;
     42
     43extern int chardev_open(async_sess_t *, chardev_t **);
     44extern void chardev_close(chardev_t *);
     45extern int chardev_read(chardev_t *, void *, size_t, size_t *);
     46extern int chardev_write(chardev_t *, const void *, size_t, size_t *);
    4047
    4148#endif
  • uspace/lib/c/include/io/chardev_srv.h

    r8bfb163 r132ab5d1  
    5959        int (*open)(chardev_srvs_t *, chardev_srv_t *);
    6060        int (*close)(chardev_srv_t *);
    61         int (*read)(chardev_srv_t *, void *, size_t);
    62         int (*write)(chardev_srv_t *, const void *, size_t);
     61        int (*read)(chardev_srv_t *, void *, size_t, size_t *);
     62        int (*write)(chardev_srv_t *, const void *, size_t, size_t *);
     63        void (*def_handler)(chardev_srv_t *, ipc_callid_t, ipc_call_t *);
    6364};
    6465
  • uspace/lib/c/include/io/con_srv.h

    r8bfb163 r132ab5d1  
    6969        int (*open)(con_srvs_t *, con_srv_t *);
    7070        int (*close)(con_srv_t *);
    71         int (*read)(con_srv_t *, void *, size_t);
    72         int (*write)(con_srv_t *, void *, size_t);
     71        int (*read)(con_srv_t *, void *, size_t, size_t *);
     72        int (*write)(con_srv_t *, void *, size_t, size_t *);
    7373        void (*sync)(con_srv_t *);
    7474        void (*clear)(con_srv_t *);
  • uspace/lib/c/include/io/klog.h

    r8bfb163 r132ab5d1  
    4444#include <abi/log.h>
    4545
    46 extern size_t klog_write(log_level_t, const void *, size_t);
    47 extern int klog_read(void *, size_t);
     46extern int klog_write(log_level_t, const void *, size_t);
     47extern int klog_read(void *, size_t, size_t *);
    4848
    4949#define KLOG_PRINTF(lvl, fmt, ...) ({ \
    50         char *_fmt = str_dup(fmt); \
    51         size_t _fmtsize = str_size(_fmt); \
    52         if (_fmtsize > 0 && _fmt[_fmtsize - 1] == '\n') \
    53                 _fmt[_fmtsize - 1] = 0; \
    5450        char *_s; \
    55         int _c = asprintf(&_s, _fmt, ##__VA_ARGS__); \
    56         free(_fmt); \
    57         if (_c >= 0) { \
    58                 _c = klog_write((lvl), _s, str_size(_s)); \
     51        int _rc = ENOMEM; \
     52        if (asprintf(&_s, fmt, ##__VA_ARGS__) >= 0) { \
     53                _rc = klog_write((lvl), _s, str_size(_s)); \
    5954                free(_s); \
    6055        }; \
    61         (_c >= 0); \
     56        (_rc != EOK); \
    6257})
    6358
  • uspace/lib/c/include/io/serial.h

    r8bfb163 r132ab5d1  
    11/*
    2  * Copyright (c) 2010 Lenka Trochtova
     2 * Copyright (c) 2017 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup libdrv
     29/** @addtogroup libc
    3030 * @{
    3131 */
     
    3333 */
    3434
    35 #ifndef LIBDRV_OPS_CHAR_DEV_H_
    36 #define LIBDRV_OPS_CHAR_DEV_H_
     35#ifndef LIBC_IO_SERIAL_H_
     36#define LIBC_IO_SERIAL_H_
    3737
    38 #include "../ddf/driver.h"
     38#include <async.h>
     39#include <ipc/serial_ctl.h>
    3940
    4041typedef struct {
    41         int (*read)(ddf_fun_t *, char *, size_t);
    42         int (*write)(ddf_fun_t *, char *, size_t);
    43 } char_dev_ops_t;
     42        async_sess_t *sess;
     43} serial_t;
     44
     45extern int serial_open(async_sess_t *, serial_t **);
     46extern void serial_close(serial_t *);
     47extern int serial_set_comm_props(serial_t *, unsigned, serial_parity_t,
     48    unsigned, unsigned);
     49extern int serial_get_comm_props(serial_t *, unsigned *, serial_parity_t *,
     50    unsigned *, unsigned *);
    4451
    4552#endif
    4653
    47 /**
    48  * @}
     54/** @}
    4955 */
  • uspace/lib/c/include/io/table.h

    r8bfb163 r132ab5d1  
    4040#include <stddef.h>
    4141#include <stdio.h>
     42#include <errno.h>
    4243
    4344/** Table metrics */
  • uspace/lib/c/include/ipc/chardev.h

    r8bfb163 r132ab5d1  
    4141typedef enum {
    4242        CHARDEV_READ = IPC_FIRST_USER_METHOD,
    43         CHARDEV_WRITE
     43        CHARDEV_WRITE,
    4444} chardev_request_t;
     45
     46enum {
     47        CHARDEV_LIMIT = CHARDEV_WRITE + 1
     48};
    4549
    4650#endif
  • uspace/lib/c/include/ipc/common.h

    r8bfb163 r132ab5d1  
    4040#include <abi/proc/task.h>
    4141#include <futex.h>
     42#include <abi/cap.h>
    4243
    4344#define IPC_FLAG_BLOCKING  0x01
     45
     46struct async_call;
    4447
    4548typedef struct {
     
    4750        task_id_t in_task_id;
    4851        sysarg_t in_phone_hash;
     52        unsigned flags;
     53        struct async_call *label;
     54        cap_handle_t cap_handle;
    4955} ipc_call_t;
    5056
    51 typedef sysarg_t ipc_callid_t;
     57typedef cap_handle_t ipc_callid_t;
    5258
    5359extern futex_t async_futex;
  • uspace/lib/c/include/ipc/dev_iface.h

    r8bfb163 r132ab5d1  
    3030#define LIBC_IPC_DEV_IFACE_H_
    3131
    32 #include <malloc.h>
     32#include <stdlib.h>
    3333#include <types/common.h>
    3434
  • uspace/lib/c/include/ipc/devman.h

    r8bfb163 r132ab5d1  
    3636#include <ipc/common.h>
    3737#include <adt/list.h>
    38 #include <malloc.h>
    3938#include <mem.h>
     39#include <stdlib.h>
    4040
    4141#define DEVMAN_NAME_MAXLEN  256
  • uspace/lib/c/include/ipc/ipc.h

    r8bfb163 r132ab5d1  
    4444#include <abi/synch.h>
    4545#include <abi/proc/task.h>
     46#include <abi/cap.h>
    4647
    4748typedef void (*ipc_async_callback_t)(void *, int, ipc_call_t *);
    4849
    49 extern ipc_callid_t ipc_wait_cycle(ipc_call_t *, sysarg_t, unsigned int);
     50extern int ipc_wait_cycle(ipc_call_t *, sysarg_t, unsigned int);
    5051extern void ipc_poke(void);
    5152
     
    5354        ipc_wait_for_call_timeout(data, SYNCH_NO_TIMEOUT);
    5455
    55 extern ipc_callid_t ipc_wait_for_call_timeout(ipc_call_t *, sysarg_t);
    56 extern ipc_callid_t ipc_trywait_for_call(ipc_call_t *);
     56extern int ipc_wait_for_call_timeout(ipc_call_t *, sysarg_t);
     57extern int ipc_trywait_for_call(ipc_call_t *);
    5758
    5859/*
     
    6364 */
    6465
    65 #define ipc_answer_0(callid, retval) \
    66         ipc_answer_fast((callid), (retval), 0, 0, 0, 0)
    67 #define ipc_answer_1(callid, retval, arg1) \
    68         ipc_answer_fast((callid), (retval), (arg1), 0, 0, 0)
    69 #define ipc_answer_2(callid, retval, arg1, arg2) \
    70         ipc_answer_fast((callid), (retval), (arg1), (arg2), 0, 0)
    71 #define ipc_answer_3(callid, retval, arg1, arg2, arg3) \
    72         ipc_answer_fast((callid), (retval), (arg1), (arg2), (arg3), 0)
    73 #define ipc_answer_4(callid, retval, arg1, arg2, arg3, arg4) \
    74         ipc_answer_fast((callid), (retval), (arg1), (arg2), (arg3), (arg4))
    75 #define ipc_answer_5(callid, retval, arg1, arg2, arg3, arg4, arg5) \
    76         ipc_answer_slow((callid), (retval), (arg1), (arg2), (arg3), (arg4), (arg5))
     66#define ipc_answer_0(chandle, retval) \
     67        ipc_answer_fast((chandle), (retval), 0, 0, 0, 0)
     68#define ipc_answer_1(chandle, retval, arg1) \
     69        ipc_answer_fast((chandle), (retval), (arg1), 0, 0, 0)
     70#define ipc_answer_2(chandle, retval, arg1, arg2) \
     71        ipc_answer_fast((chandle), (retval), (arg1), (arg2), 0, 0)
     72#define ipc_answer_3(chandle, retval, arg1, arg2, arg3) \
     73        ipc_answer_fast((chandle), (retval), (arg1), (arg2), (arg3), 0)
     74#define ipc_answer_4(chandle, retval, arg1, arg2, arg3, arg4) \
     75        ipc_answer_fast((chandle), (retval), (arg1), (arg2), (arg3), (arg4))
     76#define ipc_answer_5(chandle, retval, arg1, arg2, arg3, arg4, arg5) \
     77        ipc_answer_slow((chandle), (retval), (arg1), (arg2), (arg3), (arg4), \
     78            (arg5))
    7779
    78 extern sysarg_t ipc_answer_fast(ipc_callid_t, sysarg_t, sysarg_t, sysarg_t,
     80extern int ipc_answer_fast(cap_handle_t, int, sysarg_t, sysarg_t,
    7981    sysarg_t, sysarg_t);
    80 extern sysarg_t ipc_answer_slow(ipc_callid_t, sysarg_t, sysarg_t, sysarg_t,
     82extern int ipc_answer_slow(cap_handle_t, int, sysarg_t, sysarg_t,
    8183    sysarg_t, sysarg_t, sysarg_t);
    8284
     
    8890 */
    8991
    90 #define ipc_call_async_0(phoneid, method, private, callback) \
    91         ipc_call_async_fast((phoneid), (method), 0, 0, 0, 0, (private), \
     92#define ipc_call_async_0(phandle, method, private, callback) \
     93        ipc_call_async_fast((phandle), (method), 0, 0, 0, (private), (callback))
     94#define ipc_call_async_1(phandle, method, arg1, private, callback) \
     95        ipc_call_async_fast((phandle), (method), (arg1), 0, 0, (private), \
    9296            (callback))
    93 #define ipc_call_async_1(phoneid, method, arg1, private, callback) \
    94         ipc_call_async_fast((phoneid), (method), (arg1), 0, 0, 0, (private), \
    95             (callback))
    96 #define ipc_call_async_2(phoneid, method, arg1, arg2, private, callback) \
    97         ipc_call_async_fast((phoneid), (method), (arg1), (arg2), 0, 0, \
     97#define ipc_call_async_2(phandle, method, arg1, arg2, private, callback) \
     98        ipc_call_async_fast((phandle), (method), (arg1), (arg2), 0, \
    9899            (private), (callback))
    99 #define ipc_call_async_3(phoneid, method, arg1, arg2, arg3, private, callback) \
    100         ipc_call_async_fast((phoneid), (method), (arg1), (arg2), (arg3), 0, \
     100#define ipc_call_async_3(phandle, method, arg1, arg2, arg3, private, callback) \
     101        ipc_call_async_fast((phandle), (method), (arg1), (arg2), (arg3), \
    101102            (private), (callback))
    102 #define ipc_call_async_4(phoneid, method, arg1, arg2, arg3, arg4, private, \
     103#define ipc_call_async_4(phandle, method, arg1, arg2, arg3, arg4, private, \
    103104    callback) \
    104         ipc_call_async_fast((phoneid), (method), (arg1), (arg2), (arg3), \
    105             (arg4), (private), (callback))
    106 #define ipc_call_async_5(phoneid, method, arg1, arg2, arg3, arg4, arg5, \
     105        ipc_call_async_slow((phandle), (method), (arg1), (arg2), (arg3), \
     106            (arg4), 0, (private), (callback))
     107#define ipc_call_async_5(phandle, method, arg1, arg2, arg3, arg4, arg5, \
    107108    private, callback) \
    108         ipc_call_async_slow((phoneid), (method), (arg1), (arg2), (arg3), \
     109        ipc_call_async_slow((phandle), (method), (arg1), (arg2), (arg3), \
    109110            (arg4), (arg5), (private), (callback))
    110111
    111 extern void ipc_call_async_fast(int, sysarg_t, sysarg_t, sysarg_t, sysarg_t,
     112extern void ipc_call_async_fast(cap_handle_t, sysarg_t, sysarg_t, sysarg_t,
    112113    sysarg_t, void *, ipc_async_callback_t);
    113 extern void ipc_call_async_slow(int, sysarg_t, sysarg_t, sysarg_t, sysarg_t,
    114     sysarg_t, sysarg_t, void *, ipc_async_callback_t);
     114extern void ipc_call_async_slow(cap_handle_t, sysarg_t, sysarg_t, sysarg_t,
     115    sysarg_t, sysarg_t, sysarg_t, void *, ipc_async_callback_t);
    115116
    116 extern int ipc_hangup(int);
     117extern int ipc_hangup(cap_handle_t);
    117118
    118 extern int ipc_forward_fast(ipc_callid_t, int, sysarg_t, sysarg_t, sysarg_t,
    119     unsigned int);
    120 extern int ipc_forward_slow(ipc_callid_t, int, sysarg_t, sysarg_t, sysarg_t,
    121     sysarg_t, sysarg_t, sysarg_t, unsigned int);
     119extern int ipc_forward_fast(cap_handle_t, cap_handle_t, sysarg_t, sysarg_t,
     120    sysarg_t, unsigned int);
     121extern int ipc_forward_slow(cap_handle_t, cap_handle_t, sysarg_t, sysarg_t,
     122    sysarg_t, sysarg_t, sysarg_t, sysarg_t, unsigned int);
    122123
    123 extern int ipc_connect_kbox(task_id_t);
     124extern int ipc_connect_kbox(task_id_t, cap_handle_t *);
    124125
    125126#endif
  • uspace/lib/c/include/ipc/irq.h

    r8bfb163 r132ab5d1  
    3838#include <types/common.h>
    3939#include <abi/ddi/irq.h>
     40#include <abi/cap.h>
    4041
    41 extern int ipc_irq_subscribe(int, sysarg_t, const irq_code_t *);
    42 extern int ipc_irq_unsubscribe(int);
     42extern int ipc_irq_subscribe(int, sysarg_t, const irq_code_t *, cap_handle_t *);
     43extern int ipc_irq_unsubscribe(cap_handle_t);
    4344
    4445#endif
  • uspace/lib/c/include/ipc/serial_ctl.h

    r8bfb163 r132ab5d1  
    3030#define LIBC_IPC_SERIAL_CTL_H_
    3131
    32 #include <ipc/dev_iface.h>
     32#include <ipc/chardev.h>
    3333
    3434/** IPC methods for getting/setting serial communication properties
     
    4141 */
    4242typedef enum {
    43         SERIAL_GET_COM_PROPS = DEV_FIRST_CUSTOM_METHOD,
     43        SERIAL_GET_COM_PROPS = CHARDEV_LIMIT,
    4444        SERIAL_SET_COM_PROPS
    4545} serial_ctl_t;
  • uspace/lib/c/include/ipc/services.h

    r8bfb163 r132ab5d1  
    4949} service_t;
    5050
     51#define SERVICE_NAME_CHARDEV_TEST_SMALLX "chardev-test/smallx"
     52#define SERVICE_NAME_CHARDEV_TEST_LARGEX "chardev-test/largex"
     53#define SERVICE_NAME_CHARDEV_TEST_PARTIALX "chardev-test/partialx"
    5154#define SERVICE_NAME_CLIPBOARD "clipboard"
    5255#define SERVICE_NAME_CORECFG  "corecfg"
  • uspace/lib/c/include/ipc/tcp.h

    r8bfb163 r132ab5d1  
    11/*
    2  * Copyright (c) 2015 Jiri Svobda
     2 * Copyright (c) 2015 Jiri Svoboda
    33 * All rights reserved.
    44 *
  • uspace/lib/c/include/ipc/udp.h

    r8bfb163 r132ab5d1  
    11/*
    2  * Copyright (c) 2015 Jiri Svobda
     2 * Copyright (c) 2015 Jiri Svoboda
    33 * All rights reserved.
    44 *
  • uspace/lib/c/include/str_error.h

    r8bfb163 r132ab5d1  
    3636#define LIBC_STRERROR_H_
    3737
    38 const char *str_error(const int);
     38#include <errno.h>
     39
     40const char *str_error(errno_t);
     41const char *str_error_name(errno_t);
    3942
    4043#endif
  • uspace/lib/c/include/sys/time.h

    r8bfb163 r132ab5d1  
    9393extern int time_local2str(const time_t, char *);
    9494extern double difftime(time_t, time_t);
    95 extern size_t strftime(char *restrict, size_t, const char *restrict,
    96     const struct tm *restrict);
     95extern size_t strftime(char *__restrict__, size_t, const char *__restrict__,
     96    const struct tm *__restrict__);
    9797
    9898#endif
  • uspace/lib/c/include/types/common.h

    r8bfb163 r132ab5d1  
    4545
    4646#include <_bits/all.h>
     47#include <_bits/errno.h>
    4748
    4849#endif
  • uspace/lib/c/include/vfs/vfs.h

    r8bfb163 r132ab5d1  
    8585
    8686extern char *vfs_absolutize(const char *, size_t *);
    87 extern int vfs_clone(int, int, bool);
     87extern int vfs_clone(int, int, bool, int *);
    8888extern int vfs_cwd_get(char *path, size_t);
    8989extern int vfs_cwd_set(const char *path);
     
    9595extern int vfs_link(int, const char *, vfs_file_kind_t, int *);
    9696extern int vfs_link_path(const char *, vfs_file_kind_t, int *);
    97 extern int vfs_lookup(const char *, int);
    98 extern int vfs_lookup_open(const char *, int, int);
     97extern int vfs_lookup(const char *, int, int *);
     98extern int vfs_lookup_open(const char *, int, int, int *);
    9999extern int vfs_mount_path(const char *, const char *, const char *,
    100100    const char *, unsigned int, unsigned int);
     
    104104extern int vfs_pass_handle(async_exch_t *, int, async_exch_t *);
    105105extern int vfs_put(int);
    106 extern ssize_t vfs_read(int, aoff64_t *, void *, size_t);
     106extern int vfs_read(int, aoff64_t *, void *, size_t, size_t *);
    107107extern int vfs_read_short(int, aoff64_t, void *, size_t, ssize_t *);
    108 extern int vfs_receive_handle(bool);
     108extern int vfs_receive_handle(bool, int *);
    109109extern int vfs_rename_path(const char *, const char *);
    110110extern int vfs_resize(int, aoff64_t);
    111111extern int vfs_root(void);
    112 extern void vfs_root_set(int);
     112extern int vfs_root_set(int);
    113113extern int vfs_stat(int, struct stat *);
    114114extern int vfs_stat_path(const char *, struct stat *);
     
    120120extern int vfs_unmount(int);
    121121extern int vfs_unmount_path(const char *);
    122 extern int vfs_walk(int, const char *, int);
    123 extern ssize_t vfs_write(int, aoff64_t *, const void *, size_t);
     122extern int vfs_walk(int, const char *, int, int *);
     123extern int vfs_write(int, aoff64_t *, const void *, size_t, size_t *);
    124124extern int vfs_write_short(int, aoff64_t, const void *, size_t, ssize_t *);
    125125
Note: See TracChangeset for help on using the changeset viewer.