Changeset 132ab5d1 in mainline for uspace/lib/c/include
- Timestamp:
- 2018-01-30T03:20:45Z (8 years ago)
- 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. - Location:
- uspace/lib/c/include
- Files:
-
- 29 edited
- 2 moved
-
adt/circ_buf.h (moved) (moved from uspace/lib/c/include/ipc/char.h ) (2 diffs)
-
adt/fifo.h (modified) (1 diff)
-
async.h (modified) (12 diffs)
-
bd.h (modified) (1 diff)
-
device/hw_res.h (modified) (1 diff)
-
elf/elf_mod.h (modified) (1 diff)
-
errno.h (modified) (1 diff)
-
fibril.h (modified) (1 diff)
-
fibril_synch.h (modified) (1 diff)
-
futex.h (modified) (6 diffs)
-
ieee80211/ieee80211.h (modified) (1 diff)
-
io/chardev.h (modified) (2 diffs)
-
io/chardev_srv.h (modified) (1 diff)
-
io/con_srv.h (modified) (1 diff)
-
io/klog.h (modified) (1 diff)
-
io/serial.h (moved) (moved from uspace/lib/drv/include/ops/char_dev.h ) (3 diffs)
-
io/table.h (modified) (1 diff)
-
ipc/chardev.h (modified) (1 diff)
-
ipc/common.h (modified) (2 diffs)
-
ipc/dev_iface.h (modified) (1 diff)
-
ipc/devman.h (modified) (1 diff)
-
ipc/ipc.h (modified) (4 diffs)
-
ipc/irq.h (modified) (1 diff)
-
ipc/serial_ctl.h (modified) (2 diffs)
-
ipc/services.h (modified) (1 diff)
-
ipc/tcp.h (modified) (1 diff)
-
ipc/udp.h (modified) (1 diff)
-
str_error.h (modified) (1 diff)
-
sys/time.h (modified) (1 diff)
-
types/common.h (modified) (1 diff)
-
vfs/vfs.h (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/adt/circ_buf.h
r8bfb163 r132ab5d1 1 1 /* 2 * Copyright (c) 20 09Jiri Svoboda2 * Copyright (c) 2017 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup libc ipc29 /** @addtogroup libc 30 30 * @{ 31 31 */ 32 /** @file 33 * @brief Character device interface. 32 /** @file Circular buffer 34 33 */ 35 34 36 #ifndef LIBC_ IPC_CHAR_H_37 #define LIBC_ IPC_CHAR_H_35 #ifndef LIBC_CIRC_BUF_H_ 36 #define LIBC_CIRC_BUF_H_ 38 37 39 #include < ipc/common.h>38 #include <stddef.h> 40 39 41 typedef enum { 42 CHAR_WRITE_BYTE = IPC_FIRST_USER_METHOD 43 } char_request_t; 40 /** Circular buffer */ 41 typedef 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; 44 55 45 typedef enum { 46 CHAR_NOTIF_BYTE = IPC_FIRST_USER_METHOD 47 } char_notif_t; 56 extern void circ_buf_init(circ_buf_t *, void *, size_t, size_t); 57 extern size_t circ_buf_nfree(circ_buf_t *); 58 extern size_t circ_buf_nused(circ_buf_t *); 59 extern int circ_buf_push(circ_buf_t *, const void *); 60 extern int circ_buf_pop(circ_buf_t *, void *); 48 61 49 62 #endif -
uspace/lib/c/include/adt/fifo.h
r8bfb163 r132ab5d1 46 46 #define LIBC_FIFO_H_ 47 47 48 #include < malloc.h>48 #include <stdlib.h> 49 49 50 50 typedef unsigned long fifo_count_t; -
uspace/lib/c/include/async.h
r8bfb163 r132ab5d1 49 49 #include <abi/ipc/event.h> 50 50 #include <abi/ipc/interfaces.h> 51 52 typedef ipc_callid_t aid_t; 51 #include <abi/cap.h> 52 53 typedef sysarg_t aid_t; 53 54 typedef sysarg_t port_id_t; 54 55 … … 58 59 /** Port connection handler 59 60 * 60 * @param c allid ID of incoming call or 0 if connection initiated from61 * inside using async_create_callback_port()62 * @param call Incoming call or 0 if connection initiated from inside63 * 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 */ 68 typedef void (*async_port_handler_t)(cap_handle_t, ipc_call_t *, void *); 68 69 69 70 /** Notification handler */ 70 typedef void (*async_notification_handler_t)(ipc_callid_t, ipc_call_t *, 71 void *); 71 typedef void (*async_notification_handler_t)(ipc_call_t *, void *); 72 72 73 73 /** Exchange management style … … 119 119 async_get_call_timeout(data, 0) 120 120 121 extern ipc_callid_t async_get_call_timeout(ipc_call_t *, suseconds_t);121 extern cap_handle_t async_get_call_timeout(ipc_call_t *, suseconds_t); 122 122 123 123 /* … … 146 146 sysarg_t, sysarg_t, sysarg_t, ipc_call_t *); 147 147 148 extern void async_wait_for(aid_t, sysarg_t *);149 extern int async_wait_timeout(aid_t, sysarg_t *, suseconds_t);148 extern void async_wait_for(aid_t, int *); 149 extern int async_wait_timeout(aid_t, int *, suseconds_t); 150 150 extern void async_forget(aid_t); 151 151 152 152 extern void async_usleep(suseconds_t); 153 extern void async_sleep(unsigned int); 154 153 155 extern void async_create_manager(void); 154 156 extern void async_destroy_manager(void); … … 167 169 168 170 extern 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 *); 172 extern int async_irq_unsubscribe(cap_handle_t); 171 173 172 174 extern int async_event_subscribe(event_type_t, async_notification_handler_t, … … 196 198 */ 197 199 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,200 extern int async_answer_0(cap_handle_t, int); 201 extern int async_answer_1(cap_handle_t, int, sysarg_t); 202 extern int async_answer_2(cap_handle_t, int, sysarg_t, sysarg_t); 203 extern int async_answer_3(cap_handle_t, int, sysarg_t, sysarg_t, 202 204 sysarg_t); 203 extern sysarg_t async_answer_4(ipc_callid_t, sysarg_t, sysarg_t, sysarg_t,205 extern int async_answer_4(cap_handle_t, int, sysarg_t, sysarg_t, 204 206 sysarg_t, sysarg_t); 205 extern sysarg_t async_answer_5(ipc_callid_t, sysarg_t, sysarg_t, sysarg_t,207 extern int async_answer_5(cap_handle_t, int, sysarg_t, sysarg_t, 206 208 sysarg_t, sysarg_t, sysarg_t); 207 209 … … 210 212 */ 211 213 212 extern int async_forward_fast( ipc_callid_t, async_exch_t *, sysarg_t, sysarg_t,214 extern int async_forward_fast(cap_handle_t, async_exch_t *, sysarg_t, sysarg_t, 213 215 sysarg_t, unsigned int); 214 extern int async_forward_slow( ipc_callid_t, async_exch_t *, sysarg_t, sysarg_t,216 extern int async_forward_slow(cap_handle_t, async_exch_t *, sysarg_t, sysarg_t, 215 217 sysarg_t, sysarg_t, sysarg_t, sysarg_t, unsigned int); 216 218 … … 336 338 rc3, rc4, rc5) 337 339 338 extern sysarg_t async_req_fast(async_exch_t *, sysarg_t, sysarg_t, sysarg_t,340 extern int async_req_fast(async_exch_t *, sysarg_t, sysarg_t, sysarg_t, 339 341 sysarg_t, sysarg_t, sysarg_t *, sysarg_t *, sysarg_t *, sysarg_t *, 340 342 sysarg_t *); 341 extern sysarg_t async_req_slow(async_exch_t *, sysarg_t, sysarg_t, sysarg_t,343 extern int async_req_slow(async_exch_t *, sysarg_t, sysarg_t, sysarg_t, 342 344 sysarg_t, sysarg_t, sysarg_t, sysarg_t *, sysarg_t *, sysarg_t *, 343 345 sysarg_t *, sysarg_t *); … … 382 384 extern int async_share_in_start(async_exch_t *, size_t, sysarg_t, 383 385 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);386 extern bool async_share_in_receive(cap_handle_t *, size_t *); 387 extern int async_share_in_finalize(cap_handle_t, void *, unsigned int); 386 388 387 389 extern 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 **);390 extern bool async_share_out_receive(cap_handle_t *, size_t *, unsigned int *); 391 extern int async_share_out_finalize(cap_handle_t, void **); 390 392 391 393 /* … … 421 423 extern aid_t async_data_read(async_exch_t *, void *, size_t, ipc_call_t *); 422 424 extern 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);425 extern bool async_data_read_receive(cap_handle_t *, size_t *); 426 extern bool async_data_read_receive_call(cap_handle_t *, ipc_call_t *, size_t *); 427 extern int async_data_read_finalize(cap_handle_t, const void *, size_t); 426 428 427 429 extern int async_data_read_forward_fast(async_exch_t *, sysarg_t, sysarg_t, … … 460 462 461 463 extern 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);464 extern bool async_data_write_receive(cap_handle_t *, size_t *); 465 extern bool async_data_write_receive_call(cap_handle_t *, ipc_call_t *, size_t *); 466 extern int async_data_write_finalize(cap_handle_t, void *, size_t); 465 467 466 468 extern int async_data_write_accept(void **, const bool, const size_t, 467 469 const size_t, const size_t, size_t *); 468 extern void async_data_write_void( sysarg_t);470 extern void async_data_write_void(int); 469 471 470 472 extern int async_data_write_forward_fast(async_exch_t *, sysarg_t, sysarg_t, … … 476 478 extern int async_state_change_start(async_exch_t *, sysarg_t, sysarg_t, 477 479 sysarg_t, async_exch_t *); 478 extern bool async_state_change_receive( ipc_callid_t *, sysarg_t *, sysarg_t *,480 extern bool async_state_change_receive(cap_handle_t *, sysarg_t *, sysarg_t *, 479 481 sysarg_t *); 480 extern int async_state_change_finalize( ipc_callid_t, async_exch_t *);482 extern int async_state_change_finalize(cap_handle_t, async_exch_t *); 481 483 482 484 extern void *async_remote_state_acquire(async_sess_t *); -
uspace/lib/c/include/bd.h
r8bfb163 r132ab5d1 30 30 * @{ 31 31 */ 32 /** @file 32 /** @file Block device client interface 33 33 */ 34 34 -
uspace/lib/c/include/device/hw_res.h
r8bfb163 r132ab5d1 123 123 extern int hw_res_dma_channel_setup(async_sess_t *, unsigned int, uint32_t, 124 124 uint32_t, uint8_t); 125 extern int hw_res_dma_channel_remain(async_sess_t *, unsigned );125 extern int hw_res_dma_channel_remain(async_sess_t *, unsigned, size_t *); 126 126 127 127 #endif -
uspace/lib/c/include/elf/elf_mod.h
r8bfb163 r132ab5d1 53 53 #define EE_LOADER 5 /* The image is actually a program loader. */ 54 54 #define EE_IRRECOVERABLE 6 55 #define EE_IO 7 /* Could not read file. */ 55 56 56 57 typedef enum { -
uspace/lib/c/include/errno.h
r8bfb163 r132ab5d1 36 36 #define LIBC_ERRNO_H_ 37 37 38 #include <_bits/errno.h> 38 39 #include <abi/errno.h> 39 40 40 41 #define errno (*(__errno())) 41 42 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) 43 extern errno_t *__errno(void) __attribute__((const)); 73 44 74 45 #endif -
uspace/lib/c/include/fibril.h
r8bfb163 r132ab5d1 102 102 extern void fibril_remove_manager(void); 103 103 extern 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);107 104 108 105 static inline int fibril_yield(void) -
uspace/lib/c/include/fibril_synch.h
r8bfb163 r132ab5d1 173 173 extern fibril_timer_state_t fibril_timer_clear(fibril_timer_t *); 174 174 extern 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);177 175 178 176 #endif -
uspace/lib/c/include/futex.h
r8bfb163 r132ab5d1 37 37 38 38 #include <atomic.h> 39 #include <errno.h> 39 40 #include <libc.h> 40 41 … … 107 108 * @param futex Futex. 108 109 * 109 * @return Non-zeroif the futex was acquired.110 * @return Zeroif the futex was not acquired.110 * @return true if the futex was acquired. 111 * @return false if the futex was not acquired. 111 112 * 112 113 */ 113 static inline intfutex_trydown(futex_t *futex)114 static inline bool futex_trydown(futex_t *futex) 114 115 { 115 116 return cas(&futex->val, 1, 0); … … 121 122 * 122 123 * @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. 125 126 * 126 127 */ … … 128 129 { 129 130 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); 131 132 132 return 0;133 return EOK; 133 134 } 134 135 … … 138 139 * 139 140 * @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. 141 143 * 142 144 */ … … 144 146 { 145 147 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); 147 149 148 return 0;150 return EOK; 149 151 } 150 152 -
uspace/lib/c/include/ieee80211/ieee80211.h
r8bfb163 r132ab5d1 38 38 #define LIBC_IEEE80211_H_ 39 39 40 #include <malloc.h>41 40 #include <adt/list.h> 42 41 #include <nic/nic.h> -
uspace/lib/c/include/io/chardev.h
r8bfb163 r132ab5d1 1 1 /* 2 2 * Copyright (c) 2011 Jan Vesely 3 * Copyright (c) 2017 Jiri Svoboda 3 4 * All rights reserved. 4 5 * … … 33 34 #define LIBC_IO_CHARDEV_H_ 34 35 35 #include <types/common.h>36 36 #include <async.h> 37 #include <stddef.h> 37 38 38 ssize_t chardev_read(async_exch_t *, void *, size_t); 39 ssize_t chardev_write(async_exch_t *, const void *, size_t); 39 typedef struct { 40 async_sess_t *sess; 41 } chardev_t; 42 43 extern int chardev_open(async_sess_t *, chardev_t **); 44 extern void chardev_close(chardev_t *); 45 extern int chardev_read(chardev_t *, void *, size_t, size_t *); 46 extern int chardev_write(chardev_t *, const void *, size_t, size_t *); 40 47 41 48 #endif -
uspace/lib/c/include/io/chardev_srv.h
r8bfb163 r132ab5d1 59 59 int (*open)(chardev_srvs_t *, chardev_srv_t *); 60 60 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 *); 63 64 }; 64 65 -
uspace/lib/c/include/io/con_srv.h
r8bfb163 r132ab5d1 69 69 int (*open)(con_srvs_t *, con_srv_t *); 70 70 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 *); 73 73 void (*sync)(con_srv_t *); 74 74 void (*clear)(con_srv_t *); -
uspace/lib/c/include/io/klog.h
r8bfb163 r132ab5d1 44 44 #include <abi/log.h> 45 45 46 extern size_t klog_write(log_level_t, const void *, size_t);47 extern int klog_read(void *, size_t );46 extern int klog_write(log_level_t, const void *, size_t); 47 extern int klog_read(void *, size_t, size_t *); 48 48 49 49 #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; \54 50 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)); \ 59 54 free(_s); \ 60 55 }; \ 61 (_ c >= 0); \56 (_rc != EOK); \ 62 57 }) 63 58 -
uspace/lib/c/include/io/serial.h
r8bfb163 r132ab5d1 1 1 /* 2 * Copyright (c) 201 0 Lenka Trochtova2 * Copyright (c) 2017 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup lib drv29 /** @addtogroup libc 30 30 * @{ 31 31 */ … … 33 33 */ 34 34 35 #ifndef LIB DRV_OPS_CHAR_DEV_H_36 #define LIB DRV_OPS_CHAR_DEV_H_35 #ifndef LIBC_IO_SERIAL_H_ 36 #define LIBC_IO_SERIAL_H_ 37 37 38 #include "../ddf/driver.h" 38 #include <async.h> 39 #include <ipc/serial_ctl.h> 39 40 40 41 typedef 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 45 extern int serial_open(async_sess_t *, serial_t **); 46 extern void serial_close(serial_t *); 47 extern int serial_set_comm_props(serial_t *, unsigned, serial_parity_t, 48 unsigned, unsigned); 49 extern int serial_get_comm_props(serial_t *, unsigned *, serial_parity_t *, 50 unsigned *, unsigned *); 44 51 45 52 #endif 46 53 47 /** 48 * @} 54 /** @} 49 55 */ -
uspace/lib/c/include/io/table.h
r8bfb163 r132ab5d1 40 40 #include <stddef.h> 41 41 #include <stdio.h> 42 #include <errno.h> 42 43 43 44 /** Table metrics */ -
uspace/lib/c/include/ipc/chardev.h
r8bfb163 r132ab5d1 41 41 typedef enum { 42 42 CHARDEV_READ = IPC_FIRST_USER_METHOD, 43 CHARDEV_WRITE 43 CHARDEV_WRITE, 44 44 } chardev_request_t; 45 46 enum { 47 CHARDEV_LIMIT = CHARDEV_WRITE + 1 48 }; 45 49 46 50 #endif -
uspace/lib/c/include/ipc/common.h
r8bfb163 r132ab5d1 40 40 #include <abi/proc/task.h> 41 41 #include <futex.h> 42 #include <abi/cap.h> 42 43 43 44 #define IPC_FLAG_BLOCKING 0x01 45 46 struct async_call; 44 47 45 48 typedef struct { … … 47 50 task_id_t in_task_id; 48 51 sysarg_t in_phone_hash; 52 unsigned flags; 53 struct async_call *label; 54 cap_handle_t cap_handle; 49 55 } ipc_call_t; 50 56 51 typedef sysarg_t ipc_callid_t;57 typedef cap_handle_t ipc_callid_t; 52 58 53 59 extern futex_t async_futex; -
uspace/lib/c/include/ipc/dev_iface.h
r8bfb163 r132ab5d1 30 30 #define LIBC_IPC_DEV_IFACE_H_ 31 31 32 #include < malloc.h>32 #include <stdlib.h> 33 33 #include <types/common.h> 34 34 -
uspace/lib/c/include/ipc/devman.h
r8bfb163 r132ab5d1 36 36 #include <ipc/common.h> 37 37 #include <adt/list.h> 38 #include <malloc.h>39 38 #include <mem.h> 39 #include <stdlib.h> 40 40 41 41 #define DEVMAN_NAME_MAXLEN 256 -
uspace/lib/c/include/ipc/ipc.h
r8bfb163 r132ab5d1 44 44 #include <abi/synch.h> 45 45 #include <abi/proc/task.h> 46 #include <abi/cap.h> 46 47 47 48 typedef void (*ipc_async_callback_t)(void *, int, ipc_call_t *); 48 49 49 extern i pc_callid_t ipc_wait_cycle(ipc_call_t *, sysarg_t, unsigned int);50 extern int ipc_wait_cycle(ipc_call_t *, sysarg_t, unsigned int); 50 51 extern void ipc_poke(void); 51 52 … … 53 54 ipc_wait_for_call_timeout(data, SYNCH_NO_TIMEOUT); 54 55 55 extern i pc_callid_t ipc_wait_for_call_timeout(ipc_call_t *, sysarg_t);56 extern i pc_callid_t ipc_trywait_for_call(ipc_call_t *);56 extern int ipc_wait_for_call_timeout(ipc_call_t *, sysarg_t); 57 extern int ipc_trywait_for_call(ipc_call_t *); 57 58 58 59 /* … … 63 64 */ 64 65 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)) 77 79 78 extern sysarg_t ipc_answer_fast(ipc_callid_t, sysarg_t, sysarg_t, sysarg_t,80 extern int ipc_answer_fast(cap_handle_t, int, sysarg_t, sysarg_t, 79 81 sysarg_t, sysarg_t); 80 extern sysarg_t ipc_answer_slow(ipc_callid_t, sysarg_t, sysarg_t, sysarg_t,82 extern int ipc_answer_slow(cap_handle_t, int, sysarg_t, sysarg_t, 81 83 sysarg_t, sysarg_t, sysarg_t); 82 84 … … 88 90 */ 89 91 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), \ 92 96 (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, \ 98 99 (private), (callback)) 99 #define ipc_call_async_3(ph oneid, method, arg1, arg2, arg3, private, callback) \100 ipc_call_async_fast((ph oneid), (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), \ 101 102 (private), (callback)) 102 #define ipc_call_async_4(ph oneid, method, arg1, arg2, arg3, arg4, private, \103 #define ipc_call_async_4(phandle, method, arg1, arg2, arg3, arg4, private, \ 103 104 callback) \ 104 ipc_call_async_ fast((phoneid), (method), (arg1), (arg2), (arg3), \105 (arg4), (private), (callback))106 #define ipc_call_async_5(ph oneid, 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, \ 107 108 private, callback) \ 108 ipc_call_async_slow((ph oneid), (method), (arg1), (arg2), (arg3), \109 ipc_call_async_slow((phandle), (method), (arg1), (arg2), (arg3), \ 109 110 (arg4), (arg5), (private), (callback)) 110 111 111 extern void ipc_call_async_fast( int, sysarg_t, sysarg_t, sysarg_t, sysarg_t,112 extern void ipc_call_async_fast(cap_handle_t, sysarg_t, sysarg_t, sysarg_t, 112 113 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);114 extern 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); 115 116 116 extern int ipc_hangup( int);117 extern int ipc_hangup(cap_handle_t); 117 118 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);119 extern int ipc_forward_fast(cap_handle_t, cap_handle_t, sysarg_t, sysarg_t, 120 sysarg_t, unsigned int); 121 extern 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); 122 123 123 extern int ipc_connect_kbox(task_id_t );124 extern int ipc_connect_kbox(task_id_t, cap_handle_t *); 124 125 125 126 #endif -
uspace/lib/c/include/ipc/irq.h
r8bfb163 r132ab5d1 38 38 #include <types/common.h> 39 39 #include <abi/ddi/irq.h> 40 #include <abi/cap.h> 40 41 41 extern int ipc_irq_subscribe(int, sysarg_t, const irq_code_t * );42 extern int ipc_irq_unsubscribe( int);42 extern int ipc_irq_subscribe(int, sysarg_t, const irq_code_t *, cap_handle_t *); 43 extern int ipc_irq_unsubscribe(cap_handle_t); 43 44 44 45 #endif -
uspace/lib/c/include/ipc/serial_ctl.h
r8bfb163 r132ab5d1 30 30 #define LIBC_IPC_SERIAL_CTL_H_ 31 31 32 #include <ipc/ dev_iface.h>32 #include <ipc/chardev.h> 33 33 34 34 /** IPC methods for getting/setting serial communication properties … … 41 41 */ 42 42 typedef enum { 43 SERIAL_GET_COM_PROPS = DEV_FIRST_CUSTOM_METHOD,43 SERIAL_GET_COM_PROPS = CHARDEV_LIMIT, 44 44 SERIAL_SET_COM_PROPS 45 45 } serial_ctl_t; -
uspace/lib/c/include/ipc/services.h
r8bfb163 r132ab5d1 49 49 } service_t; 50 50 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" 51 54 #define SERVICE_NAME_CLIPBOARD "clipboard" 52 55 #define SERVICE_NAME_CORECFG "corecfg" -
uspace/lib/c/include/ipc/tcp.h
r8bfb163 r132ab5d1 1 1 /* 2 * Copyright (c) 2015 Jiri Svob da2 * Copyright (c) 2015 Jiri Svoboda 3 3 * All rights reserved. 4 4 * -
uspace/lib/c/include/ipc/udp.h
r8bfb163 r132ab5d1 1 1 /* 2 * Copyright (c) 2015 Jiri Svob da2 * Copyright (c) 2015 Jiri Svoboda 3 3 * All rights reserved. 4 4 * -
uspace/lib/c/include/str_error.h
r8bfb163 r132ab5d1 36 36 #define LIBC_STRERROR_H_ 37 37 38 const char *str_error(const int); 38 #include <errno.h> 39 40 const char *str_error(errno_t); 41 const char *str_error_name(errno_t); 39 42 40 43 #endif -
uspace/lib/c/include/sys/time.h
r8bfb163 r132ab5d1 93 93 extern int time_local2str(const time_t, char *); 94 94 extern double difftime(time_t, time_t); 95 extern size_t strftime(char * restrict, size_t, const char *restrict,96 const struct tm * restrict);95 extern size_t strftime(char *__restrict__, size_t, const char *__restrict__, 96 const struct tm *__restrict__); 97 97 98 98 #endif -
uspace/lib/c/include/types/common.h
r8bfb163 r132ab5d1 45 45 46 46 #include <_bits/all.h> 47 #include <_bits/errno.h> 47 48 48 49 #endif -
uspace/lib/c/include/vfs/vfs.h
r8bfb163 r132ab5d1 85 85 86 86 extern char *vfs_absolutize(const char *, size_t *); 87 extern int vfs_clone(int, int, bool );87 extern int vfs_clone(int, int, bool, int *); 88 88 extern int vfs_cwd_get(char *path, size_t); 89 89 extern int vfs_cwd_set(const char *path); … … 95 95 extern int vfs_link(int, const char *, vfs_file_kind_t, int *); 96 96 extern 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 );97 extern int vfs_lookup(const char *, int, int *); 98 extern int vfs_lookup_open(const char *, int, int, int *); 99 99 extern int vfs_mount_path(const char *, const char *, const char *, 100 100 const char *, unsigned int, unsigned int); … … 104 104 extern int vfs_pass_handle(async_exch_t *, int, async_exch_t *); 105 105 extern int vfs_put(int); 106 extern ssize_t vfs_read(int, aoff64_t *, void *, size_t);106 extern int vfs_read(int, aoff64_t *, void *, size_t, size_t *); 107 107 extern int vfs_read_short(int, aoff64_t, void *, size_t, ssize_t *); 108 extern int vfs_receive_handle(bool );108 extern int vfs_receive_handle(bool, int *); 109 109 extern int vfs_rename_path(const char *, const char *); 110 110 extern int vfs_resize(int, aoff64_t); 111 111 extern int vfs_root(void); 112 extern voidvfs_root_set(int);112 extern int vfs_root_set(int); 113 113 extern int vfs_stat(int, struct stat *); 114 114 extern int vfs_stat_path(const char *, struct stat *); … … 120 120 extern int vfs_unmount(int); 121 121 extern 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);122 extern int vfs_walk(int, const char *, int, int *); 123 extern int vfs_write(int, aoff64_t *, const void *, size_t, size_t *); 124 124 extern int vfs_write_short(int, aoff64_t, const void *, size_t, ssize_t *); 125 125
Note:
See TracChangeset
for help on using the changeset viewer.
