Changeset 17aca1c in mainline for uspace/lib/c/include


Ignore:
Timestamp:
2011-02-04T20:56:52Z (14 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0397e5a4, e29e09cf
Parents:
e778543 (diff), 0b37882 (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

Location:
uspace/lib/c/include
Files:
1 added
52 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/include/as.h

    re778543 r17aca1c  
    4141#include <libarch/config.h>
    4242
     43static inline size_t SIZE2PAGES(size_t size)
     44{
     45        if (size == 0)
     46                return 0;
     47       
     48        return (size_t) ((size - 1) >> PAGE_WIDTH) + 1;
     49}
     50
     51static inline size_t PAGES2SIZE(size_t pages)
     52{
     53        return (size_t) (pages << PAGE_WIDTH);
     54}
     55
    4356extern void *as_area_create(void *address, size_t size, int flags);
    4457extern int as_area_resize(void *address, size_t size, int flags);
  • uspace/lib/c/include/assert.h

    re778543 r17aca1c  
    5757                        printf("Assertion failed (%s) at file '%s', " \
    5858                            "line %d.\n", #expr, __FILE__, __LINE__); \
    59                         stacktrace_print(); \
    60                         core(); \
    6159                        abort(); \
    6260                } \
  • uspace/lib/c/include/async.h

    re778543 r17aca1c  
    3333 */
    3434
     35#if ((defined(LIBC_IPC_H_)) && (!defined(LIBC_ASYNC_C_)))
     36        #error Do not intermix low-level IPC interface and async framework
     37#endif
     38
    3539#ifndef LIBC_ASYNC_H_
    3640#define LIBC_ASYNC_H_
    3741
    38 #include <ipc/ipc.h>
     42#include <ipc/common.h>
    3943#include <async_sess.h>
    4044#include <fibril.h>
     
    4246#include <atomic.h>
    4347#include <bool.h>
     48#include <task.h>
    4449
    4550typedef ipc_callid_t aid_t;
     
    5055typedef void (*async_client_conn_t)(ipc_callid_t, ipc_call_t *);
    5156
    52 extern atomic_t async_futex;
    53 
    5457extern atomic_t threads_in_ipc_wait;
    5558
    56 extern int __async_init(void);
     59#define async_manager() \
     60        fibril_switch(FIBRIL_TO_MANAGER)
     61
     62#define async_get_call(data) \
     63        async_get_call_timeout(data, 0)
     64
    5765extern ipc_callid_t async_get_call_timeout(ipc_call_t *, suseconds_t);
    58 
    59 static inline ipc_callid_t async_get_call(ipc_call_t *data)
    60 {
    61         return async_get_call_timeout(data, 0);
    62 }
    63 
    64 static inline void async_manager(void)
    65 {
    66         fibril_switch(FIBRIL_TO_MANAGER);
    67 }
    6866
    6967/*
     
    110108extern void async_set_interrupt_received(async_client_conn_t);
    111109
    112 /* Wrappers for simple communication */
    113 #define async_msg_0(phone, method) \
    114         ipc_call_async_0((phone), (method), NULL, NULL, true)
    115 #define async_msg_1(phone, method, arg1) \
    116         ipc_call_async_1((phone), (method), (arg1), NULL, NULL, \
    117             true)
    118 #define async_msg_2(phone, method, arg1, arg2) \
    119         ipc_call_async_2((phone), (method), (arg1), (arg2), NULL, NULL, \
    120             true)
    121 #define async_msg_3(phone, method, arg1, arg2, arg3) \
    122         ipc_call_async_3((phone), (method), (arg1), (arg2), (arg3), NULL, NULL, \
    123             true)
    124 #define async_msg_4(phone, method, arg1, arg2, arg3, arg4) \
    125         ipc_call_async_4((phone), (method), (arg1), (arg2), (arg3), (arg4), NULL, \
    126             NULL, true)
    127 #define async_msg_5(phone, method, arg1, arg2, arg3, arg4, arg5) \
    128         ipc_call_async_5((phone), (method), (arg1), (arg2), (arg3), (arg4), \
    129             (arg5), NULL, NULL, true)
     110/*
     111 * Wrappers for simple communication.
     112 */
     113
     114extern void async_msg_0(int, sysarg_t);
     115extern void async_msg_1(int, sysarg_t, sysarg_t);
     116extern void async_msg_2(int, sysarg_t, sysarg_t, sysarg_t);
     117extern void async_msg_3(int, sysarg_t, sysarg_t, sysarg_t, sysarg_t);
     118extern void async_msg_4(int, sysarg_t, sysarg_t, sysarg_t, sysarg_t, sysarg_t);
     119extern void async_msg_5(int, sysarg_t, sysarg_t, sysarg_t, sysarg_t, sysarg_t,
     120    sysarg_t);
     121
     122/*
     123 * Wrappers for answer routines.
     124 */
     125
     126extern sysarg_t async_answer_0(ipc_callid_t, sysarg_t);
     127extern sysarg_t async_answer_1(ipc_callid_t, sysarg_t, sysarg_t);
     128extern sysarg_t async_answer_2(ipc_callid_t, sysarg_t, sysarg_t, sysarg_t);
     129extern sysarg_t async_answer_3(ipc_callid_t, sysarg_t, sysarg_t, sysarg_t,
     130    sysarg_t);
     131extern sysarg_t async_answer_4(ipc_callid_t, sysarg_t, sysarg_t, sysarg_t,
     132    sysarg_t, sysarg_t);
     133extern sysarg_t async_answer_5(ipc_callid_t, sysarg_t, sysarg_t, sysarg_t,
     134    sysarg_t, sysarg_t, sysarg_t);
     135
     136/*
     137 * Wrappers for forwarding routines.
     138 */
     139
     140extern int async_forward_fast(ipc_callid_t, int, sysarg_t, sysarg_t, sysarg_t,
     141    unsigned int);
     142extern int async_forward_slow(ipc_callid_t, int, sysarg_t, sysarg_t, sysarg_t,
     143    sysarg_t, sysarg_t, sysarg_t, unsigned int);
    130144
    131145/*
     
    135149 * and slow verion based on m.
    136150 */
     151
    137152#define async_req_0_0(phoneid, method) \
    138153        async_req_fast((phoneid), (method), 0, 0, 0, 0, NULL, NULL, NULL, NULL, \
     
    266281}
    267282
     283extern int async_connect_to_me(int, sysarg_t, sysarg_t, sysarg_t,
     284    async_client_conn_t);
    268285extern int async_connect_me_to(int, sysarg_t, sysarg_t, sysarg_t);
    269286extern int async_connect_me_to_blocking(int, sysarg_t, sysarg_t, sysarg_t);
     287extern int async_connect_kbox(task_id_t);
     288extern int async_hangup(int);
     289extern void async_poke(void);
    270290
    271291/*
    272292 * User-friendly wrappers for async_share_in_start().
    273293 */
     294
    274295#define async_share_in_start_0_0(phoneid, dst, size) \
    275296        async_share_in_start((phoneid), (dst), (size), 0, NULL)
     
    281302        async_share_in_start((phoneid), (dst), (size), (arg), (flags))
    282303
    283 extern int async_share_in_start(int, void *, size_t, sysarg_t, int *);
    284 extern int async_share_in_receive(ipc_callid_t *, size_t *);
    285 extern int async_share_in_finalize(ipc_callid_t, void *, int );
    286 extern int async_share_out_start(int, void *, int);
    287 extern int async_share_out_receive(ipc_callid_t *, size_t *, int *);
     304extern int async_share_in_start(int, void *, size_t, sysarg_t, unsigned int *);
     305extern bool async_share_in_receive(ipc_callid_t *, size_t *);
     306extern int async_share_in_finalize(ipc_callid_t, void *, unsigned int);
     307
     308extern int async_share_out_start(int, void *, unsigned int);
     309extern bool async_share_out_receive(ipc_callid_t *, size_t *, unsigned int *);
    288310extern int async_share_out_finalize(ipc_callid_t, void *);
    289311
     
    291313 * User-friendly wrappers for async_data_read_forward_fast().
    292314 */
     315
    293316#define async_data_read_forward_0_0(phoneid, method, answer) \
    294317        async_data_read_forward_fast((phoneid), (method), 0, 0, 0, 0, NULL)
     
    318341
    319342extern int async_data_read_start(int, void *, size_t);
    320 extern int async_data_read_receive(ipc_callid_t *, size_t *);
     343extern bool async_data_read_receive(ipc_callid_t *, size_t *);
    321344extern int async_data_read_finalize(ipc_callid_t, const void *, size_t);
    322345
     
    327350 * User-friendly wrappers for async_data_write_forward_fast().
    328351 */
     352
    329353#define async_data_write_forward_0_0(phoneid, method, answer) \
    330354        async_data_write_forward_fast((phoneid), (method), 0, 0, 0, 0, NULL)
     
    356380
    357381extern int async_data_write_start(int, const void *, size_t);
    358 extern int async_data_write_receive(ipc_callid_t *, size_t *);
     382extern bool async_data_write_receive(ipc_callid_t *, size_t *);
    359383extern int async_data_write_finalize(ipc_callid_t, void *, size_t);
    360384
    361385extern int async_data_write_accept(void **, const bool, const size_t,
    362386    const size_t, const size_t, size_t *);
    363 extern void async_data_write_void(const int);
     387extern void async_data_write_void(sysarg_t);
    364388
    365389extern int async_data_write_forward_fast(int, sysarg_t, sysarg_t, sysarg_t,
  • uspace/lib/c/include/async_sess.h

    re778543 r17aca1c  
    4545} async_sess_t;
    4646
    47 extern void _async_sess_init(void);
    4847extern void async_session_create(async_sess_t *, int, sysarg_t);
    4948extern void async_session_destroy(async_sess_t *);
  • uspace/lib/c/include/byteorder.h

    re778543 r17aca1c  
    8080#endif
    8181
    82 #define htons(n)        host2uint16_t_be((n))
    83 #define htonl(n)        host2uint32_t_be((n))
    84 #define ntohs(n)        uint16_t_be2host((n))
    85 #define ntohl(n)        uint32_t_be2host((n))
     82#define htons(n)  host2uint16_t_be((n))
     83#define htonl(n)  host2uint32_t_be((n))
     84#define ntohs(n)  uint16_t_be2host((n))
     85#define ntohl(n)  uint32_t_be2host((n))
    8686
    8787static inline uint64_t uint64_t_byteorder_swap(uint64_t n)
  • uspace/lib/c/include/ddi.h

    re778543 r17aca1c  
    3636#define LIBC_DDI_H_
    3737
     38#include <sys/types.h>
     39#include <kernel/ddi/irq.h>
    3840#include <task.h>
    3941
     
    4244extern int iospace_enable(task_id_t, void *, unsigned long);
    4345extern int pio_enable(void *, size_t, void **);
     46extern int register_irq(int, int, int, irq_code_t *);
     47extern int unregister_irq(int, int);
    4448
    4549#endif
  • uspace/lib/c/include/devman.h

    re778543 r17aca1c  
    4141#include <bool.h>
    4242
    43 
    4443extern int devman_get_phone(devman_interface_t, unsigned int);
    4544extern void devman_hangup_phone(devman_interface_t);
  • uspace/lib/c/include/err.h

    re778543 r17aca1c  
    3939
    4040#define errx(status, fmt, ...) \
    41         { \
     41        do { \
    4242                printf((fmt), ##__VA_ARGS__); \
    43                 _exit(status); \
    44         }
     43                exit(status); \
     44        } while (0)
    4545
    4646#endif
  • uspace/lib/c/include/errno.h

    re778543 r17aca1c  
    3939#include <fibril.h>
    4040
     41#define errno _errno
     42
    4143extern int _errno;
    42 
    43 #define errno _errno
    4444
    4545#define EMFILE        (-18)
     
    5757
    5858/** An API function is called while another blocking function is in progress. */
    59 #define EINPROGRESS     (-10036)
     59#define EINPROGRESS  (-10036)
    6060
    6161/** The socket identifier is not valid. */
    62 #define ENOTSOCK        (-10038)
     62#define ENOTSOCK  (-10038)
    6363
    6464/** The destination address required. */
    65 #define EDESTADDRREQ    (-10039)
     65#define EDESTADDRREQ  (-10039)
    6666
    6767/** Protocol is not supported.  */
    68 #define EPROTONOSUPPORT (-10043)
     68#define EPROTONOSUPPORT  (-10043)
    6969
    7070/** Socket type is not supported. */
    71 #define ESOCKTNOSUPPORT (-10044)
     71#define ESOCKTNOSUPPORT  (-10044)
    7272
    7373/** Protocol family is not supported. */
    74 #define EPFNOSUPPORT    (-10046)
     74#define EPFNOSUPPORT  (-10046)
    7575
    7676/** Address family is not supported. */
    77 #define EAFNOSUPPORT    (-10047)
     77#define EAFNOSUPPORT  (-10047)
    7878
    7979/** Address is already in use. */
    80 #define EADDRINUSE      (-10048)
     80#define EADDRINUSE  (-10048)
    8181
    8282/** The socket is not connected or bound. */
    83 #define ENOTCONN        (-10057)
     83#define ENOTCONN  (-10057)
    8484
    8585/** The requested operation was not performed. Try again later. */
    86 #define EAGAIN          (-11002)
     86#define EAGAIN  (-11002)
    8787
    88 /** No data.
    89  */
    90 #define NO_DATA         (-11004)
     88/** No data. */
     89#define NO_DATA (-11004)
    9190
    9291#endif
  • uspace/lib/c/include/event.h

    re778543 r17aca1c  
    3737
    3838#include <kernel/ipc/event_types.h>
    39 #include <ipc/ipc.h>
    4039
    4140extern int event_subscribe(event_type_t, sysarg_t);
  • uspace/lib/c/include/io/console.h

    re778543 r17aca1c  
    3636#define LIBC_IO_CONSOLE_H_
    3737
    38 #include <ipc/ipc.h>
    3938#include <bool.h>
    4039
  • uspace/lib/c/include/io/screenbuffer.h

    re778543 r17aca1c  
    3838#include <stdint.h>
    3939#include <sys/types.h>
    40 #include <ipc/ipc.h>
    4140#include <bool.h>
    4241
  • uspace/lib/c/include/ipc/adb.h

    re778543 r17aca1c  
    3232/** @file
    3333 * @brief ADB device interface.
    34  */ 
     34 */
    3535
    3636#ifndef LIBC_IPC_ADB_H_
    3737#define LIBC_IPC_ADB_H_
    3838
    39 #include <ipc/ipc.h>
     39#include <ipc/common.h>
    4040
    4141typedef enum {
    4242        ADB_REG_WRITE = IPC_FIRST_USER_METHOD
    4343} adb_request_t;
    44 
    4544
    4645typedef enum {
  • uspace/lib/c/include/ipc/arp.h

    re778543 r17aca1c  
    3939#define LIBC_ARP_MESSAGES_
    4040
    41 #include <ipc/ipc.h>
    4241#include <ipc/net.h>
    4342
  • uspace/lib/c/include/ipc/bd.h

    re778543 r17aca1c  
    3131 */
    3232/** @file
    33  */ 
     33 */
    3434
    3535#ifndef LIBC_IPC_BD_H_
    3636#define LIBC_IPC_BD_H_
    3737
    38 #include <ipc/ipc.h>
     38#include <ipc/common.h>
    3939
    4040typedef enum {
  • uspace/lib/c/include/ipc/char.h

    re778543 r17aca1c  
    3232/** @file
    3333 * @brief Character device interface.
    34  */ 
     34 */
    3535
    3636#ifndef LIBC_IPC_CHAR_H_
    3737#define LIBC_IPC_CHAR_H_
    3838
    39 #include <ipc/ipc.h>
     39#include <ipc/common.h>
    4040
    4141typedef enum {
    4242        CHAR_WRITE_BYTE = IPC_FIRST_USER_METHOD
    4343} char_request_t;
    44 
    4544
    4645typedef enum {
  • uspace/lib/c/include/ipc/clipboard.h

    re778543 r17aca1c  
    3636#define LIBC_IPC_CLIPBOARD_H_
    3737
    38 #include <ipc/ipc.h>
    39 
    4038typedef enum {
    4139        CLIPBOARD_PUT_DATA = IPC_FIRST_USER_METHOD,
  • uspace/lib/c/include/ipc/console.h

    re778543 r17aca1c  
    3636#define LIBC_IPC_CONSOLE_H_
    3737
    38 #include <ipc/ipc.h>
    3938#include <ipc/vfs.h>
    4039
  • uspace/lib/c/include/ipc/dev_iface.h

    re778543 r17aca1c  
    3030#define LIBC_IPC_DEV_IFACE_H_
    3131
    32 #include <ipc/ipc.h>
    3332#include <malloc.h>
    3433#include <unistd.h>
  • uspace/lib/c/include/ipc/devman.h

    re778543 r17aca1c  
    3030 * @{
    3131 */
    32  
     32
    3333#ifndef LIBC_IPC_DEVMAN_H_
    3434#define LIBC_IPC_DEVMAN_H_
    3535
     36#include <ipc/common.h>
    3637#include <adt/list.h>
    37 #include <ipc/ipc.h>
    38 #include <stdlib.h>
    39 #include <stdio.h>
    40 #include <str.h>
     38#include <malloc.h>
     39#include <mem.h>
    4140
    42 #define DEVMAN_NAME_MAXLEN 256
     41#define DEVMAN_NAME_MAXLEN  256
    4342
    4443typedef sysarg_t devman_handle_t;
     
    6766} match_id_list_t;
    6867
    69 
    70 static inline match_id_t * create_match_id()
     68static inline match_id_t *create_match_id(void)
    7169{
    7270        match_id_t *id = malloc(sizeof(match_id_t));
     
    8583}
    8684
    87 static inline void add_match_id(match_id_list_t *ids, match_id_t *id) 
     85static inline void add_match_id(match_id_list_t *ids, match_id_t *id)
    8886{
    8987        match_id_t *mid = NULL;
    90         link_t *link = ids->ids.next;   
     88        link_t *link = ids->ids.next;
    9189       
    9290        while (link != &ids->ids) {
     
    9896        }
    9997       
    100         list_insert_before(&id->link, link);   
     98        list_insert_before(&id->link, link);
    10199}
    102100
  • uspace/lib/c/include/ipc/devmap.h

    re778543 r17aca1c  
    3434#define DEVMAP_DEVMAP_H_
    3535
    36 #include <atomic.h>
    37 #include <ipc/ipc.h>
    38 #include <adt/list.h>
     36#include <ipc/common.h>
    3937
    4038#define DEVMAP_NAME_MAXLEN  255
  • uspace/lib/c/include/ipc/fb.h

    re778543 r17aca1c  
    3131 */
    3232/** @file
    33  */ 
     33 */
    3434
    3535#ifndef LIBC_FB_H_
    3636#define LIBC_FB_H_
    3737
    38 #include <ipc/ipc.h>
     38#include <ipc/common.h>
    3939
    4040typedef enum {
  • uspace/lib/c/include/ipc/icmp.h

    re778543 r17aca1c  
    3939#define LIBC_ICMP_MESSAGES_
    4040
    41 #include <ipc/ipc.h>
    4241#include <ipc/net.h>
    4342#include <sys/types.h>
    4443#include <sys/time.h>
    45 
    4644#include <net/icmp_codes.h>
    4745
  • uspace/lib/c/include/ipc/il.h

    re778543 r17aca1c  
    4040#define LIBC_IL_MESSAGES_H_
    4141
    42 #include <ipc/ipc.h>
    4342#include <ipc/net.h>
    4443
  • uspace/lib/c/include/ipc/ip.h

    re778543 r17aca1c  
    3939#define LIBC_IP_MESSAGES_H_
    4040
    41 #include <ipc/ipc.h>
    4241#include <ipc/net.h>
    43 
    4442#include <net/in.h>
    4543#include <net/ip_codes.h>
  • uspace/lib/c/include/ipc/ipc.h

    re778543 r17aca1c  
    3333 */
    3434
    35 #ifndef LIBIPC_IPC_H_
    36 #define LIBIPC_IPC_H_
    37 
     35#if ((defined(LIBC_ASYNC_H_)) && (!defined(LIBC_ASYNC_C_)))
     36        #error Do not intermix low-level IPC interface and async framework
     37#endif
     38
     39#ifndef LIBC_IPC_H_
     40#define LIBC_IPC_H_
     41
     42#include <sys/types.h>
     43#include <ipc/common.h>
     44#include <kernel/synch/synch.h>
    3845#include <task.h>
    39 #include <kernel/ipc/ipc.h>
    40 #include <kernel/ddi/irq.h>
    41 #include <sys/types.h>
    42 #include <kernel/synch/synch.h>
    43 
    44 #define IPC_FLAG_BLOCKING  0x01
    45 
    46 typedef struct {
    47         sysarg_t args[IPC_CALL_LEN];
    48         sysarg_t in_task_hash;
    49         sysarg_t in_phone_hash;
    50 } ipc_call_t;
    51 
    52 typedef sysarg_t ipc_callid_t;
    53 
    54 typedef void (* ipc_async_callback_t)(void *, int, ipc_call_t *);
     46
     47typedef void (*ipc_async_callback_t)(void *, int, ipc_call_t *);
    5548
    5649/*
     
    6053 * possible, the fast version is used.
    6154 */
     55
    6256#define ipc_call_sync_0_0(phoneid, method) \
    6357        ipc_call_sync_fast((phoneid), (method), 0, 0, 0, 0, 0, 0, 0, 0)
     
    189183    sysarg_t *);
    190184
    191 extern ipc_callid_t ipc_wait_cycle(ipc_call_t *, uint32_t, int);
    192 extern ipc_callid_t ipc_wait_for_call_timeout(ipc_call_t *, uint32_t);
     185extern ipc_callid_t ipc_wait_cycle(ipc_call_t *, sysarg_t, unsigned int);
    193186extern void ipc_poke(void);
    194187
    195 static inline ipc_callid_t ipc_wait_for_call(ipc_call_t *data)
    196 {
    197         return ipc_wait_for_call_timeout(data, SYNCH_NO_TIMEOUT);
    198 }
    199 
     188#define ipc_wait_for_call(data) \
     189        ipc_wait_for_call_timeout(data, SYNCH_NO_TIMEOUT);
     190
     191extern ipc_callid_t ipc_wait_for_call_timeout(ipc_call_t *, sysarg_t);
    200192extern ipc_callid_t ipc_trywait_for_call(ipc_call_t *);
    201193
     
    206198 * to m.
    207199 */
     200
    208201#define ipc_answer_0(callid, retval) \
    209202        ipc_answer_fast((callid), (retval), 0, 0, 0, 0)
     
    230223 * to m.
    231224 */
     225
    232226#define ipc_call_async_0(phoneid, method, private, callback, can_preempt) \
    233227        ipc_call_async_fast((phoneid), (method), 0, 0, 0, 0, (private), \
     
    255249
    256250extern void ipc_call_async_fast(int, sysarg_t, sysarg_t, sysarg_t, sysarg_t,
    257     sysarg_t, void *, ipc_async_callback_t, int);
     251    sysarg_t, void *, ipc_async_callback_t, bool);
    258252extern void ipc_call_async_slow(int, sysarg_t, sysarg_t, sysarg_t, sysarg_t,
    259     sysarg_t, sysarg_t, void *, ipc_async_callback_t, int);
    260 
    261 extern int ipc_connect_to_me(int, int, int, int, sysarg_t *, sysarg_t *);
    262 extern int ipc_connect_me_to(int, int, int, int);
    263 extern int ipc_connect_me_to_blocking(int, int, int, int);
     253    sysarg_t, sysarg_t, void *, ipc_async_callback_t, bool);
     254
     255extern int ipc_connect_to_me(int, sysarg_t, sysarg_t, sysarg_t, sysarg_t *,
     256    sysarg_t *);
     257extern int ipc_connect_me_to(int, sysarg_t, sysarg_t, sysarg_t);
     258extern int ipc_connect_me_to_blocking(int, sysarg_t, sysarg_t, sysarg_t);
     259
    264260extern int ipc_hangup(int);
    265 extern int ipc_register_irq(int, int, int, irq_code_t *);
    266 extern int ipc_unregister_irq(int, int);
    267 extern int ipc_forward_fast(ipc_callid_t, int, int, sysarg_t, sysarg_t, int);
    268 extern int ipc_forward_slow(ipc_callid_t, int, int, sysarg_t, sysarg_t,
    269     sysarg_t, sysarg_t, sysarg_t, int);
     261
     262extern int ipc_forward_fast(ipc_callid_t, int, sysarg_t, sysarg_t, sysarg_t,
     263    unsigned int);
     264extern int ipc_forward_slow(ipc_callid_t, int, sysarg_t, sysarg_t, sysarg_t,
     265    sysarg_t, sysarg_t, sysarg_t, unsigned int);
    270266
    271267/*
    272268 * User-friendly wrappers for ipc_share_in_start().
    273269 */
     270
    274271#define ipc_share_in_start_0_0(phoneid, dst, size) \
    275272        ipc_share_in_start((phoneid), (dst), (size), 0, NULL)
     
    281278        ipc_share_in_start((phoneid), (dst), (size), (arg), (flags))
    282279
    283 extern int ipc_share_in_start(int, void *, size_t, sysarg_t, int *);
    284 extern int ipc_share_in_finalize(ipc_callid_t, void *, int );
    285 extern int ipc_share_out_start(int, void *, int);
     280extern int ipc_share_in_start(int, void *, size_t, sysarg_t, unsigned int *);
     281extern int ipc_share_in_finalize(ipc_callid_t, void *, unsigned int);
     282extern int ipc_share_out_start(int, void *, unsigned int);
    286283extern int ipc_share_out_finalize(ipc_callid_t, void *);
    287284extern int ipc_data_read_start(int, void *, size_t);
  • uspace/lib/c/include/ipc/irc.h

    re778543 r17aca1c  
    3636#define LIBC_IRC_H_
    3737
    38 #include <ipc/ipc.h>
     38#include <ipc/common.h>
    3939
    4040typedef enum {
  • uspace/lib/c/include/ipc/kbd.h

    re778543 r17aca1c  
    3838#define LIBC_IPC_KBD_H_
    3939
    40 #include <ipc/ipc.h>
     40#include <ipc/common.h>
    4141#include <ipc/dev_iface.h>
    4242
  • uspace/lib/c/include/ipc/loader.h

    re778543 r17aca1c  
    3131 */
    3232/** @file
    33  */ 
     33 */
    3434
    3535#ifndef LIBC_IPC_LOADER_H_
    3636#define LIBC_IPC_LOADER_H_
    3737
    38 #include <ipc/ipc.h>
     38#include <ipc/common.h>
    3939
    4040typedef enum {
  • uspace/lib/c/include/ipc/mouse.h

    re778543 r17aca1c  
    3737#define LIBC_IPC_MOUSE_H_
    3838
    39 #include <ipc/ipc.h>
     39#include <ipc/common.h>
    4040
    4141typedef enum {
  • uspace/lib/c/include/ipc/net.h

    re778543 r17aca1c  
    3838#define LIBC_NET_MESSAGES_H_
    3939
    40 #include <ipc/ipc.h>
    4140#include <ipc/services.h>
    42 
    4341#include <net/device.h>
    4442#include <net/packet.h>
  • uspace/lib/c/include/ipc/net_net.h

    re778543 r17aca1c  
    3939#define LIBC_NET_NET_MESSAGES_H_
    4040
    41 #include <ipc/ipc.h>
    4241#include <ipc/net.h>
    4342
  • uspace/lib/c/include/ipc/netif.h

    re778543 r17aca1c  
    3838#define LIBC_NETIF_MESSAGES_H_
    3939
    40 #include <ipc/ipc.h>
    4140#include <ipc/net.h>
    4241
  • uspace/lib/c/include/ipc/nil.h

    re778543 r17aca1c  
    3838#define LIBC_NIL_MESSAGES_H_
    3939
    40 #include <ipc/ipc.h>
    4140#include <ipc/net.h>
    4241
  • uspace/lib/c/include/ipc/ns.h

    re778543 r17aca1c  
    3333 */
    3434
    35 #ifndef LIBIPC_NS_H_
    36 #define LIBIPC_NS_H_
     35#ifndef LIBC_NS_H_
     36#define LIBC_NS_H_
    3737
    38 #include <ipc/ipc.h>
     38#include <sys/types.h>
     39#include <ipc/common.h>
    3940
    4041typedef enum {
     
    4546} ns_request_t;
    4647
     48extern int service_register(sysarg_t);
     49extern int service_connect(sysarg_t, sysarg_t, sysarg_t);
     50extern int service_connect_blocking(sysarg_t, sysarg_t, sysarg_t);
     51
    4752#endif
    4853
  • uspace/lib/c/include/ipc/packet.h

    re778543 r17aca1c  
    3838#define LIBC_PACKET_MESSAGES_
    3939
    40 #include <ipc/ipc.h>
    4140#include <ipc/net.h>
    4241
  • uspace/lib/c/include/ipc/services.h

    re778543 r17aca1c  
    3535 */
    3636
    37 #ifndef LIBIPC_SERVICES_H_
    38 #define LIBIPC_SERVICES_H_
     37#ifndef LIBC_SERVICES_H_
     38#define LIBC_SERVICES_H_
    3939
    4040typedef enum {
     
    6666} services_t;
    6767
    68 /* Memory area to be received from NS */
    69 #define SERVICE_MEM_REALTIME    1
    70 #define SERVICE_MEM_KLOG        2
    71 
    7268#endif
    7369
  • uspace/lib/c/include/ipc/socket.h

    re778543 r17aca1c  
    3838#define LIBC_SOCKET_MESSAGES_H_
    3939
    40 #include <ipc/ipc.h>
    4140#include <ipc/net.h>
    4241
  • uspace/lib/c/include/ipc/tl.h

    re778543 r17aca1c  
    3939#define LIBC_TL_MESSAGES_H_
    4040
    41 #include <ipc/ipc.h>
    4241#include <ipc/net.h>
    4342
  • uspace/lib/c/include/ipc/vfs.h

    re778543 r17aca1c  
    3636#define LIBC_IPC_VFS_H_
    3737
    38 #include <ipc/ipc.h>
     38#include <ipc/common.h>
    3939#include <sys/types.h>
    4040#include <bool.h>
  • uspace/lib/c/include/libc.h

    re778543 r17aca1c  
    6262        __syscall6(p1, p2, p3, p4, p5, p6, id)
    6363
    64 extern void __main(void *pcb_ptr);
    65 extern void __exit(void);
    66 
    6764#endif
    6865
  • uspace/lib/c/include/loader/pcb.h

    re778543 r17aca1c  
    5252        /** Program entry point. */
    5353        entry_point_t entry;
    54 
     54       
    5555        /** Current working directory. */
    5656        char *cwd;
  • uspace/lib/c/include/malloc.h

    re778543 r17aca1c  
    3838#include <sys/types.h>
    3939
    40 extern void __heap_init(void);
    41 extern uintptr_t get_max_heap_addr(void);
    42 
    4340extern void *malloc(const size_t size)
    4441    __attribute__((malloc));
  • uspace/lib/c/include/net/modules.h

    re778543 r17aca1c  
    4343
    4444#include <async.h>
    45 
    46 #include <ipc/ipc.h>
    4745#include <ipc/services.h>
    48 
    4946#include <sys/time.h>
    5047
  • uspace/lib/c/include/setjmp.h

    re778543 r17aca1c  
    4141
    4242extern int setjmp(jmp_buf env);
    43 extern void longjmp(jmp_buf env,int val) __attribute__((__noreturn__));
     43extern void longjmp(jmp_buf env, int val) __attribute__((noreturn));
    4444
    4545#endif
  • uspace/lib/c/include/stdlib.h

    re778543 r17aca1c  
    4040#include <stacktrace.h>
    4141
    42 #define abort() \
    43         do { \
    44                 stacktrace_print(); \
    45                 _exit(1); \
    46         } while (0)
     42#define RAND_MAX  714025
    4743
    48 #define core() \
    49         *((int *) 0) = 0xbadbad;
    50 
    51 #define exit(status)  _exit((status))
    52 
    53 #define RAND_MAX  714025
     44#define rand()       random()
     45#define srand(seed)  srandom(seed)
    5446
    5547extern long int random(void);
    5648extern void srandom(unsigned int seed);
    5749
    58 static inline int rand(void)
    59 {
    60         return random();
    61 }
    62 
    63 static inline void srand(unsigned int seed)
    64 {
    65         srandom(seed);
    66 }
     50extern void abort(void) __attribute__((noreturn));
    6751
    6852#endif
  • uspace/lib/c/include/syscall.h

    re778543 r17aca1c  
    3232/**
    3333 * @file
    34  * @brief       Syscall function declaration for architectures that don't
    35  *              inline syscalls or architectures that handle syscalls
    36  *              according to the number of arguments.
     34 * @brief Syscall function declaration for architectures that don't
     35 *        inline syscalls or architectures that handle syscalls
     36 *        according to the number of arguments.
    3737 */
    3838
     
    4040#define LIBC_SYSCALL_H_
    4141
    42 #ifndef LIBARCH_SYSCALL_GENERIC
    43 #error "You can't include this file directly."
     42#ifndef LIBARCH_SYSCALL_GENERIC
     43        #error You cannot include this file directly
    4444#endif
    4545
     
    4747#include <kernel/syscall/syscall.h>
    4848
    49 #define __syscall0      __syscall
    50 #define __syscall1      __syscall
    51 #define __syscall2      __syscall
    52 #define __syscall3      __syscall
    53 #define __syscall4      __syscall
    54 #define __syscall5      __syscall
    55 #define __syscall6      __syscall
     49#define __syscall0  __syscall
     50#define __syscall1  __syscall
     51#define __syscall2  __syscall
     52#define __syscall3  __syscall
     53#define __syscall4  __syscall
     54#define __syscall5  __syscall
     55#define __syscall6  __syscall
    5656
    5757extern sysarg_t __syscall(const sysarg_t p1, const sysarg_t p2,
  • uspace/lib/c/include/thread.h

    re778543 r17aca1c  
    3636#define LIBC_THREAD_H_
    3737
    38 #include <kernel/proc/uarg.h>
    3938#include <libarch/thread.h>
    4039#include <sys/types.h>
     
    4241typedef uint64_t thread_id_t;
    4342
    44 extern void __thread_entry(void);
    45 extern void __thread_main(uspace_arg_t *);
    46 
    4743extern int thread_create(void (*)(void *), void *, const char *, thread_id_t *);
    48 extern void thread_exit(int) __attribute__ ((noreturn));
     44extern void thread_exit(int) __attribute__((noreturn));
    4945extern void thread_detach(thread_id_t);
    5046extern int thread_join(thread_id_t);
  • uspace/lib/c/include/tls.h

    re778543 r17aca1c  
    5757extern void tls_free_variant_1(tcb_t *, size_t);
    5858#endif
     59
    5960#ifdef CONFIG_TLS_VARIANT_2
    6061extern tcb_t *tls_alloc_variant_2(void **, size_t);
  • uspace/lib/c/include/udebug.h

    re778543 r17aca1c  
    3838#include <kernel/udebug/udebug.h>
    3939#include <sys/types.h>
    40 #include <libarch/types.h>
    4140
    4241typedef sysarg_t thash_t;
    4342
    44 int udebug_begin(int phoneid);
    45 int udebug_end(int phoneid);
    46 int udebug_set_evmask(int phoneid, udebug_evmask_t mask);
    47 int udebug_thread_read(int phoneid, void *buffer, size_t n,
    48         size_t *copied, size_t *needed);
    49 int udebug_name_read(int phoneid, void *buffer, size_t n,
    50         size_t *copied, size_t *needed);
    51 int udebug_areas_read(int phoneid, void *buffer, size_t n,
    52         size_t *copied, size_t *needed);
    53 int udebug_mem_read(int phoneid, void *buffer, uintptr_t addr, size_t n);
    54 int udebug_args_read(int phoneid, thash_t tid, sysarg_t *buffer);
    55 int udebug_regs_read(int phoneid, thash_t tid, void *buffer);
    56 int udebug_go(int phoneid, thash_t tid, udebug_event_t *ev_type,
    57         sysarg_t *val0, sysarg_t *val1);
    58 int udebug_stop(int phoneid, thash_t tid);
     43int udebug_begin(int);
     44int udebug_end(int);
     45int udebug_set_evmask(int, udebug_evmask_t);
     46int udebug_thread_read(int, void *, size_t , size_t *, size_t *);
     47int udebug_name_read(int, void *, size_t, size_t *, size_t *);
     48int udebug_areas_read(int, void *, size_t, size_t *, size_t *);
     49int udebug_mem_read(int, void *, uintptr_t, size_t);
     50int udebug_args_read(int, thash_t, sysarg_t *);
     51int udebug_regs_read(int, thash_t, void *);
     52int udebug_go(int, thash_t, udebug_event_t *, sysarg_t *, sysarg_t *);
     53int udebug_stop(int, thash_t);
    5954
    6055#endif
  • uspace/lib/c/include/unistd.h

    re778543 r17aca1c  
    4141
    4242#ifndef NULL
    43         #define NULL    ((void *) 0)
     43        #define NULL  ((void *) 0)
    4444#endif
    45 
    46 #define getpagesize()  (PAGE_SIZE)
    4745
    4846#ifndef SEEK_SET
     
    5755        #define SEEK_END  2
    5856#endif
     57
     58#define getpagesize()  (PAGE_SIZE)
    5959
    6060extern int dup2(int oldfd, int newfd);
     
    7474extern int chdir(const char *);
    7575
    76 extern void _exit(int) __attribute__((noreturn));
     76extern void exit(int) __attribute__((noreturn));
    7777extern int usleep(useconds_t);
    7878extern unsigned int sleep(unsigned int);
  • uspace/lib/c/include/vfs/vfs.h

    re778543 r17aca1c  
    5757extern int unmount(const char *);
    5858
    59 extern void __stdio_init(int filc, fdi_node_t *filv[]);
    60 extern void __stdio_done(void);
    61 
    6259extern int open_node(fdi_node_t *, int);
    6360extern int fd_phone(int);
Note: See TracChangeset for help on using the changeset viewer.