Changeset c4fb95d3 in mainline for uspace/lib/c/include/ipc


Ignore:
Timestamp:
2011-02-18T20:04:56Z (15 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d011038
Parents:
87e373b (diff), 8b1ea2d4 (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/ipc
Files:
1 added
28 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/include/ipc/adb.h

    r87e373b rc4fb95d3  
    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

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

    r87e373b rc4fb95d3  
    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

    r87e373b rc4fb95d3  
    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

    r87e373b rc4fb95d3  
    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

    r87e373b rc4fb95d3  
    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

    r87e373b rc4fb95d3  
    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

    r87e373b rc4fb95d3  
    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;
     44
     45typedef enum {
     46        /** Invalid value for debugging purposes */
     47        fun_invalid = 0,
     48        /** Function to which child devices attach */
     49        fun_inner,
     50        /** Fuction exported to external clients (leaf function) */
     51        fun_exposed
     52} fun_type_t;
    4553
    4654/** Ids of device models used for device-to-driver matching.
     
    6775} match_id_list_t;
    6876
    69 
    70 static inline match_id_t * create_match_id()
     77static inline match_id_t *create_match_id(void)
    7178{
    7279        match_id_t *id = malloc(sizeof(match_id_t));
     
    8592}
    8693
    87 static inline void add_match_id(match_id_list_t *ids, match_id_t *id) 
     94static inline void add_match_id(match_id_list_t *ids, match_id_t *id)
    8895{
    8996        match_id_t *mid = NULL;
    90         link_t *link = ids->ids.next;   
     97        link_t *link = ids->ids.next;
    9198       
    9299        while (link != &ids->ids) {
     
    98105        }
    99106       
    100         list_insert_before(&id->link, link);   
     107        list_insert_before(&id->link, link);
    101108}
    102109
     
    129136typedef enum {
    130137        DEVMAN_DRIVER_REGISTER = IPC_FIRST_USER_METHOD,
    131         DEVMAN_ADD_CHILD_DEVICE,
     138        DEVMAN_ADD_FUNCTION,
    132139        DEVMAN_ADD_MATCH_ID,
    133140        DEVMAN_ADD_DEVICE_TO_CLASS
  • uspace/lib/c/include/ipc/devmap.h

    r87e373b rc4fb95d3  
    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

    r87e373b rc4fb95d3  
    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

    r87e373b rc4fb95d3  
    3333/** @file
    3434 * ICMP module messages.
    35  * @see icmp_interface.h
     35 * @see icmp_remote.h
    3636 */
    3737
     
    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
    4846/** ICMP module messages. */
    4947typedef enum {
    50         /** Sends echo request. @see icmp_echo() */
     48        /** Send echo request. @see icmp_echo() */
    5149        NET_ICMP_ECHO = NET_ICMP_FIRST,
    5250       
    5351        /**
    54          * Sends destination unreachable error message.
     52         * Send destination unreachable error message.
    5553         * @see icmp_destination_unreachable_msg()
    5654         */
     
    5856       
    5957        /**
    60          * Sends source quench error message.
     58         * Send source quench error message.
    6159         * @see icmp_source_quench_msg()
    6260         */
     
    6462       
    6563        /**
    66          * Sends time exceeded error message.
     64         * Send time exceeded error message.
    6765         * @see icmp_time_exceeded_msg()
    6866         */
     
    7068       
    7169        /**
    72          * Sends parameter problem error message.
     70         * Send parameter problem error message.
    7371         * @see icmp_parameter_problem_msg()
    7472         */
    75         NET_ICMP_PARAMETERPROB,
    76        
    77         /** Initializes new connection. */
    78         NET_ICMP_INIT
    79 } icmp_messages;
     73        NET_ICMP_PARAMETERPROB
     74} icmp_messages_t;
    8075
    8176/** @name ICMP specific message parameters definitions */
  • uspace/lib/c/include/ipc/il.h

    r87e373b rc4fb95d3  
    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

    r87e373b rc4fb95d3  
    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

    r87e373b rc4fb95d3  
    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_phone_hash;
    49 } ipc_call_t;
    50 
    51 typedef sysarg_t ipc_callid_t;
    52 
    53 typedef void (* ipc_async_callback_t)(void *, int, ipc_call_t *);
     46
     47typedef void (*ipc_async_callback_t)(void *, int, ipc_call_t *);
    5448
    5549/*
     
    5953 * possible, the fast version is used.
    6054 */
     55
    6156#define ipc_call_sync_0_0(phoneid, method) \
    6257        ipc_call_sync_fast((phoneid), (method), 0, 0, 0, 0, 0, 0, 0, 0)
     
    188183    sysarg_t *);
    189184
    190 extern ipc_callid_t ipc_wait_cycle(ipc_call_t *, uint32_t, int);
    191 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);
    192186extern void ipc_poke(void);
    193187
    194 static inline ipc_callid_t ipc_wait_for_call(ipc_call_t *data)
    195 {
    196         return ipc_wait_for_call_timeout(data, SYNCH_NO_TIMEOUT);
    197 }
    198 
     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);
    199192extern ipc_callid_t ipc_trywait_for_call(ipc_call_t *);
    200193
     
    205198 * to m.
    206199 */
     200
    207201#define ipc_answer_0(callid, retval) \
    208202        ipc_answer_fast((callid), (retval), 0, 0, 0, 0)
     
    229223 * to m.
    230224 */
     225
    231226#define ipc_call_async_0(phoneid, method, private, callback, can_preempt) \
    232227        ipc_call_async_fast((phoneid), (method), 0, 0, 0, 0, (private), \
     
    254249
    255250extern void ipc_call_async_fast(int, sysarg_t, sysarg_t, sysarg_t, sysarg_t,
    256     sysarg_t, void *, ipc_async_callback_t, int);
     251    sysarg_t, void *, ipc_async_callback_t, bool);
    257252extern void ipc_call_async_slow(int, sysarg_t, sysarg_t, sysarg_t, sysarg_t,
    258     sysarg_t, sysarg_t, void *, ipc_async_callback_t, int);
    259 
    260 extern int ipc_connect_to_me(int, int, int, int, sysarg_t *);
    261 extern int ipc_connect_me_to(int, int, int, int);
    262 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
    263260extern int ipc_hangup(int);
    264 extern int ipc_register_irq(int, int, int, irq_code_t *);
    265 extern int ipc_unregister_irq(int, int);
    266 extern int ipc_forward_fast(ipc_callid_t, int, int, sysarg_t, sysarg_t, int);
    267 extern int ipc_forward_slow(ipc_callid_t, int, int, sysarg_t, sysarg_t,
    268     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);
    269266
    270267/*
    271268 * User-friendly wrappers for ipc_share_in_start().
    272269 */
     270
    273271#define ipc_share_in_start_0_0(phoneid, dst, size) \
    274272        ipc_share_in_start((phoneid), (dst), (size), 0, NULL)
     
    280278        ipc_share_in_start((phoneid), (dst), (size), (arg), (flags))
    281279
    282 extern int ipc_share_in_start(int, void *, size_t, sysarg_t, int *);
    283 extern int ipc_share_in_finalize(ipc_callid_t, void *, int );
    284 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);
    285283extern int ipc_share_out_finalize(ipc_callid_t, void *);
    286284extern int ipc_data_read_start(int, void *, size_t);
  • uspace/lib/c/include/ipc/irc.h

    r87e373b rc4fb95d3  
    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

    r87e373b rc4fb95d3  
    3838#define LIBC_IPC_KBD_H_
    3939
    40 #include <ipc/ipc.h>
     40#include <ipc/common.h>
    4141
    4242typedef enum {
  • uspace/lib/c/include/ipc/loader.h

    r87e373b rc4fb95d3  
    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

    r87e373b rc4fb95d3  
    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

    r87e373b rc4fb95d3  
    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

    r87e373b rc4fb95d3  
    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

    r87e373b rc4fb95d3  
    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

    r87e373b rc4fb95d3  
    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

    r87e373b rc4fb95d3  
    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

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

    r87e373b rc4fb95d3  
    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

    r87e373b rc4fb95d3  
    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

    r87e373b rc4fb95d3  
    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

    r87e373b rc4fb95d3  
    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>
Note: See TracChangeset for help on using the changeset viewer.