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


Ignore:
Timestamp:
2011-11-06T22:21:05Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
898e847
Parents:
2bdf8313 (diff), 7b5f4c9 (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:
2 added
15 edited
2 moved

Legend:

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

    r2bdf8313 rb0f00a9  
    4242        BD_GET_NUM_BLOCKS,
    4343        BD_READ_BLOCKS,
    44         BD_WRITE_BLOCKS
     44        BD_WRITE_BLOCKS,
     45        BD_READ_TOC
    4546} bd_request_t;
    4647
  • uspace/lib/c/include/ipc/clipboard.h

    r2bdf8313 rb0f00a9  
    3636#define LIBC_IPC_CLIPBOARD_H_
    3737
     38#include <ipc/common.h>
     39
    3840typedef enum {
    3941        CLIPBOARD_PUT_DATA = IPC_FIRST_USER_METHOD,
  • uspace/lib/c/include/ipc/common.h

    r2bdf8313 rb0f00a9  
    3737
    3838#include <sys/types.h>
     39#include <abi/ipc/ipc.h>
    3940#include <atomic.h>
    40 #include <kernel/ipc/ipc.h>
     41#include <task.h>
    4142
    4243#define IPC_FLAG_BLOCKING  0x01
     
    4445typedef struct {
    4546        sysarg_t args[IPC_CALL_LEN];
    46         sysarg_t in_task_hash;
     47        task_id_t in_task_id;
    4748        sysarg_t in_phone_hash;
    4849} ipc_call_t;
  • uspace/lib/c/include/ipc/console.h

    r2bdf8313 rb0f00a9  
    4848        CONSOLE_SET_COLOR,
    4949        CONSOLE_SET_RGB_COLOR,
    50         CONSOLE_CURSOR_VISIBILITY,
    51         CONSOLE_KCON_ENABLE
     50        CONSOLE_CURSOR_VISIBILITY
    5251} console_request_t;
    5352
  • uspace/lib/c/include/ipc/dev_iface.h

    r2bdf8313 rb0f00a9  
    3636typedef enum {
    3737        HW_RES_DEV_IFACE = 0,
     38        /** Character device interface */
    3839        CHAR_DEV_IFACE,
     40       
     41        /** Network interface controller interface */
     42        NIC_DEV_IFACE,
     43       
     44        /** Interface provided by any PCI device. */
     45        PCI_DEV_IFACE,
     46
     47        /** Interface provided by any USB device. */
     48        USB_DEV_IFACE,
     49        /** Interface provided by USB host controller. */
     50        USBHC_DEV_IFACE,
     51        /** Interface provided by USB HID devices. */
     52        USBHID_DEV_IFACE,
     53
    3954        DEV_IFACE_MAX
    4055} dev_inferface_idx_t;
     
    4863        DEV_IFACE_ID(DEV_FIRST_CUSTOM_METHOD_IDX)
    4964
     65/*
     66 * The first argument is actually method (as the "real" method is used
     67 * for indexing into interfaces.
     68 */
     69
     70#define DEV_IPC_GET_ARG1(call) IPC_GET_ARG2((call))
     71#define DEV_IPC_GET_ARG2(call) IPC_GET_ARG3((call))
     72#define DEV_IPC_GET_ARG3(call) IPC_GET_ARG4((call))
     73#define DEV_IPC_GET_ARG4(call) IPC_GET_ARG5((call))
     74
    5075
    5176#endif
  • uspace/lib/c/include/ipc/devman.h

    r2bdf8313 rb0f00a9  
    7272 */
    7373typedef struct match_id_list {
    74         link_t ids;
     74        list_t ids;
    7575} match_id_list_t;
    7676
     
    9595{
    9696        match_id_t *mid = NULL;
    97         link_t *link = ids->ids.next;
     97        link_t *link = ids->ids.head.next;
    9898       
    99         while (link != &ids->ids) {
     99        while (link != &ids->ids.head) {
    100100                mid = list_get_instance(link, match_id_t,link);
    101101                if (mid->score < id->score) {
    102102                        break;
    103                 }       
     103                }
    104104                link = link->next;
    105105        }
     
    118118        match_id_t *id;
    119119       
    120         while(!list_empty(&ids->ids)) {
    121                 link = ids->ids.next;
    122                 list_remove(link);             
     120        while (!list_empty(&ids->ids)) {
     121                link = list_first(&ids->ids);
     122                list_remove(link);
    123123                id = list_get_instance(link, match_id_t, link);
    124                 delete_match_id(id);           
    125         }       
     124                delete_match_id(id);
     125        }
    126126}
    127127
     
    130130        DEVMAN_CLIENT,
    131131        DEVMAN_CONNECT_TO_DEVICE,
    132         DEVMAN_CONNECT_FROM_DEVMAP,
     132        DEVMAN_CONNECT_FROM_LOC,
    133133        DEVMAN_CONNECT_TO_PARENTS_DEVICE
    134134} devman_interface_t;
     
    138138        DEVMAN_ADD_FUNCTION,
    139139        DEVMAN_ADD_MATCH_ID,
    140         DEVMAN_ADD_DEVICE_TO_CLASS
    141 
     140        DEVMAN_ADD_DEVICE_TO_CATEGORY,
     141        DEVMAN_DRV_FUN_ONLINE,
     142        DEVMAN_DRV_FUN_OFFLINE,
     143        DEVMAN_REMOVE_FUNCTION
    142144} driver_to_devman_t;
    143145
    144146typedef enum {
    145         DRIVER_ADD_DEVICE = IPC_FIRST_USER_METHOD
    146 
     147        DRIVER_DEV_ADD = IPC_FIRST_USER_METHOD,
     148        DRIVER_DEV_ADDED,
     149        DRIVER_DEV_REMOVE,
     150        DRIVER_DEV_GONE,
     151        DRIVER_FUN_ONLINE,
     152        DRIVER_FUN_OFFLINE,
    147153} devman_to_driver_t;
    148154
    149155typedef enum {
    150156        DEVMAN_DEVICE_GET_HANDLE = IPC_FIRST_USER_METHOD,
    151         DEVMAN_DEVICE_GET_HANDLE_BY_CLASS
     157        DEVMAN_DEV_GET_FUNCTIONS,
     158        DEVMAN_FUN_GET_CHILD,
     159        DEVMAN_FUN_GET_NAME,
     160        DEVMAN_FUN_ONLINE,
     161        DEVMAN_FUN_OFFLINE,
     162        DEVMAN_FUN_GET_PATH,
     163        DEVMAN_FUN_SID_TO_HANDLE
    152164} client_to_devman_t;
    153165
  • uspace/lib/c/include/ipc/il.h

    r2bdf8313 rb0f00a9  
    5454        NET_IL_MTU_CHANGED,
    5555       
     56        /**
     57         * Device address changed message
     58         * @see il_addr_changed_msg()
     59         */
     60        NET_IL_ADDR_CHANGED,
     61
    5662        /** Packet received message.
    5763         * @see il_received_msg()
  • uspace/lib/c/include/ipc/ipc.h

    r2bdf8313 rb0f00a9  
    4242#include <sys/types.h>
    4343#include <ipc/common.h>
    44 #include <kernel/synch/synch.h>
     44#include <abi/ipc/methods.h>
     45#include <abi/synch.h>
    4546#include <task.h>
    4647
     
    253254    sysarg_t, sysarg_t, void *, ipc_async_callback_t, bool);
    254255
    255 extern int ipc_connect_to_me(int, sysarg_t, sysarg_t, sysarg_t, sysarg_t *,
     256extern int ipc_connect_to_me(int, sysarg_t, sysarg_t, sysarg_t, task_id_t *,
    256257    sysarg_t *);
     258extern int ipc_connect_me(int);
    257259extern int ipc_connect_me_to(int, sysarg_t, sysarg_t, sysarg_t);
    258260extern int ipc_connect_me_to_blocking(int, sysarg_t, sysarg_t, sysarg_t);
  • uspace/lib/c/include/ipc/loc.h

    r2bdf8313 rb0f00a9  
    11/*
    22 * Copyright (c) 2007 Josef Cejka
     3 * Copyright (c) 2011 Jiri Svoboda
    34 * All rights reserved.
    45 *
     
    2728 */
    2829
    29 /** @addtogroup devmap
     30/** @addtogroup loc
    3031 * @{
    3132 */
    3233
    33 #ifndef DEVMAP_DEVMAP_H_
    34 #define DEVMAP_DEVMAP_H_
     34#ifndef LIBC_IPC_LOC_H_
     35#define LIBC_IPC_LOC_H_
    3536
    3637#include <ipc/common.h>
    3738
    38 #define DEVMAP_NAME_MAXLEN  255
     39#define LOC_NAME_MAXLEN  255
    3940
    40 typedef sysarg_t devmap_handle_t;
     41typedef sysarg_t service_id_t;
     42typedef sysarg_t category_id_t;
    4143
    4244typedef enum {
    43         DEV_HANDLE_NONE,
    44         DEV_HANDLE_NAMESPACE,
    45         DEV_HANDLE_DEVICE
    46 } devmap_handle_type_t;
     45        LOC_OBJECT_NONE,
     46        LOC_OBJECT_NAMESPACE,
     47        LOC_OBJECT_SERVICE
     48} loc_object_type_t;
    4749
    4850typedef enum {
    49         DEVMAP_DRIVER_REGISTER = IPC_FIRST_USER_METHOD,
    50         DEVMAP_DRIVER_UNREGISTER,
    51         DEVMAP_DEVICE_REGISTER,
    52         DEVMAP_DEVICE_UNREGISTER,
    53         DEVMAP_DEVICE_GET_HANDLE,
    54         DEVMAP_NAMESPACE_GET_HANDLE,
    55         DEVMAP_HANDLE_PROBE,
    56         DEVMAP_NULL_CREATE,
    57         DEVMAP_NULL_DESTROY,
    58         DEVMAP_GET_NAMESPACE_COUNT,
    59         DEVMAP_GET_DEVICE_COUNT,
    60         DEVMAP_GET_NAMESPACES,
    61         DEVMAP_GET_DEVICES
    62 } devmap_request_t;
     51        LOC_SERVER_REGISTER = IPC_FIRST_USER_METHOD,
     52        LOC_SERVER_UNREGISTER,
     53        LOC_SERVICE_ADD_TO_CAT,
     54        LOC_SERVICE_REGISTER,
     55        LOC_SERVICE_UNREGISTER,
     56        LOC_SERVICE_GET_ID,
     57        LOC_SERVICE_GET_NAME,
     58        LOC_NAMESPACE_GET_ID,
     59        LOC_CALLBACK_CREATE,
     60        LOC_CATEGORY_GET_ID,
     61        LOC_CATEGORY_GET_NAME,
     62        LOC_CATEGORY_GET_SVCS,
     63        LOC_ID_PROBE,
     64        LOC_NULL_CREATE,
     65        LOC_NULL_DESTROY,
     66        LOC_GET_NAMESPACE_COUNT,
     67        LOC_GET_SERVICE_COUNT,
     68        LOC_GET_CATEGORIES,
     69        LOC_GET_NAMESPACES,
     70        LOC_GET_SERVICES
     71} loc_request_t;
    6372
    64 /** Interface provided by devmap.
     73typedef enum {
     74        LOC_EVENT_CAT_CHANGE = IPC_FIRST_USER_METHOD
     75} loc_event_t;
     76
     77/** Ports provided by location service.
    6578 *
    66  * Every process that connects to devmap must ask one of following
    67  * interfaces otherwise connection will be refused.
     79 * Every process that connects to loc must ask one of following
     80 * ports, otherwise connection will be refused.
    6881 *
    6982 */
    7083typedef enum {
    71         /** Connect as device driver */
    72         DEVMAP_DRIVER = 1,
    73         /** Connect as client */
    74         DEVMAP_CLIENT,
     84        /** Service supplier (server) port */
     85        LOC_PORT_SUPPLIER = 1,
     86        /** Service consumer (client) port */
     87        LOC_PORT_CONSUMER,
    7588        /** Create new connection to instance of device that
    7689            is specified by second argument of call. */
    77         DEVMAP_CONNECT_TO_DEVICE
    78 } devmap_interface_t;
     90        LOC_CONNECT_TO_SERVICE
     91} loc_interface_t;
    7992
    8093typedef struct {
    81         devmap_handle_t handle;
    82         char name[DEVMAP_NAME_MAXLEN + 1];
    83 } dev_desc_t;
     94        service_id_t id;
     95        char name[LOC_NAME_MAXLEN + 1];
     96} loc_sdesc_t;
    8497
    8598#endif
     99
     100/** @}
     101 */
  • uspace/lib/c/include/ipc/mouseev.h

    r2bdf8313 rb0f00a9  
    2727 */
    2828
    29 /** @addtogroup kbdgen generic
    30  * @brief HelenOS generic uspace keyboard handler.
    31  * @ingroup kbd
     29/** @addtogroup mouse
     30 * @brief
    3231 * @{
    3332 */
     
    3534 */
    3635
    37 #ifndef LIBC_IPC_KBD_H_
    38 #define LIBC_IPC_KBD_H_
     36#ifndef LIBC_IPC_MOUSEEV_H_
     37#define LIBC_IPC_MOUSEEV_H_
    3938
    4039#include <ipc/common.h>
     40#include <ipc/dev_iface.h>
    4141
    4242typedef enum {
    43         KBD_YIELD = IPC_FIRST_USER_METHOD,
    44         KBD_RECLAIM
    45 } kbd_request_t;
     43        MOUSEEV_YIELD = DEV_FIRST_CUSTOM_METHOD,
     44        MOUSEEV_RECLAIM
     45} mouseev_request_t;
    4646
    4747typedef enum {
    48         KBD_EVENT = IPC_FIRST_USER_METHOD
    49 } kbd_notif_t;
     48        MOUSEEV_MOVE_EVENT = IPC_FIRST_USER_METHOD,
     49        MOUSEEV_BUTTON_EVENT
     50} mouseev_notif_t;
    5051
    5152#endif
  • uspace/lib/c/include/ipc/net.h

    r2bdf8313 rb0f00a9  
    277277 *
    278278 */
    279 #define IPC_GET_DEVICE(call)  ((device_id_t) IPC_GET_ARG1(call))
     279#define IPC_GET_DEVICE(call)  ((nic_device_id_t) IPC_GET_ARG1(call))
    280280
    281281/** Return the packet identifier message argument.
     
    298298 *
    299299 */
    300 #define IPC_GET_STATE(call)  ((device_state_t) IPC_GET_ARG2(call))
     300#define IPC_GET_STATE(call)  ((nic_device_state_t) IPC_GET_ARG2(call))
     301
     302/** Return the device handle argument
     303 *
     304 * @param[in] call Message call structure
     305 *
     306 */
     307#define IPC_GET_DEVICE_HANDLE(call) ((devman_handle_t) IPC_GET_ARG2(call))
     308
     309/** Return the device driver service message argument.
     310 *
     311 * @param[in] call Message call structure.
     312 *
     313 */
     314#define IPC_GET_SERVICE(call)  ((services_t) IPC_GET_ARG3(call))
     315
     316/** Return the target service message argument.
     317 *
     318 * @param[in] call Message call structure.
     319 *
     320 */
     321#define IPC_GET_TARGET(call)  ((services_t) IPC_GET_ARG3(call))
     322
     323/** Return the sender service message argument.
     324 *
     325 * @param[in] call Message call structure.
     326 *
     327 */
     328#define IPC_GET_SENDER(call)  ((services_t) IPC_GET_ARG3(call))
    301329
    302330/** Return the maximum transmission unit message argument.
     
    305333 *
    306334 */
    307 #define IPC_GET_MTU(call)  ((size_t) IPC_GET_ARG2(call))
    308 
    309 /** Return the device driver service message argument.
    310  *
    311  * @param[in] call Message call structure.
    312  *
    313  */
    314 #define IPC_GET_SERVICE(call)  ((services_t) IPC_GET_ARG3(call))
    315 
    316 /** Return the target service message argument.
    317  *
    318  * @param[in] call Message call structure.
    319  *
    320  */
    321 #define IPC_GET_TARGET(call)  ((services_t) IPC_GET_ARG3(call))
    322 
    323 /** Return the sender service message argument.
    324  *
    325  * @param[in] call Message call structure.
    326  *
    327  */
    328 #define IPC_GET_SENDER(call)  ((services_t) IPC_GET_ARG3(call))
     335#define IPC_GET_MTU(call)  ((size_t) IPC_GET_ARG3(call))
    329336
    330337/** Return the error service message argument.
     
    335342#define IPC_GET_ERROR(call)  ((services_t) IPC_GET_ARG4(call))
    336343
    337 /** Return the phone message argument.
    338  *
    339  * @param[in] call Message call structure.
    340  *
    341  */
    342 #define IPC_GET_PHONE(call)  ((int) IPC_GET_ARG5(call))
    343 
    344344/** Set the device identifier in the message answer.
    345345 *
  • uspace/lib/c/include/ipc/net_net.h

    r2bdf8313 rb0f00a9  
    4343/** Networking subsystem central module messages. */
    4444typedef enum {
    45         /** Returns the general configuration
     45        /** Return general configuration
    4646         * @see net_get_conf_req()
    4747         */
    4848        NET_NET_GET_CONF = NET_FIRST,
    49         /** Returns the device specific configuration
     49        /** Return device specific configuration
    5050         * @see net_get_device_conf_req()
    5151         */
    5252        NET_NET_GET_DEVICE_CONF,
    53         /** Starts the networking stack. */
    54         NET_NET_STARTUP,
     53        /** Return number of mastered devices */
     54        NET_NET_GET_DEVICES_COUNT,
     55        /** Return names and device IDs of all devices */
     56        NET_NET_GET_DEVICES,
     57        /** Notify the networking service about a ready device */
     58        NET_NET_DRIVER_READY
    5559} net_messages;
    5660
  • uspace/lib/c/include/ipc/nil.h

    r2bdf8313 rb0f00a9  
    7070         */
    7171        NET_NIL_BROADCAST_ADDR,
     72        /** Device has changed address
     73         * @see nil_addr_changed_msg()
     74         */
     75        NET_NIL_ADDR_CHANGED
    7276} nil_messages;
    7377
  • uspace/lib/c/include/ipc/ns.h

    r2bdf8313 rb0f00a9  
    3333 */
    3434
    35 #ifndef LIBC_NS_H_
    36 #define LIBC_NS_H_
     35#ifndef LIBC_IPC_NS_H_
     36#define LIBC_IPC_NS_H_
    3737
    38 #include <sys/types.h>
    3938#include <ipc/common.h>
    4039
     
    4645} ns_request_t;
    4746
    48 extern int service_register(sysarg_t);
    49 extern int service_connect(sysarg_t, sysarg_t, sysarg_t);
    50 extern int service_connect_blocking(sysarg_t, sysarg_t, sysarg_t);
    51 
    5247#endif
    5348
  • uspace/lib/c/include/ipc/serial_ctl.h

    r2bdf8313 rb0f00a9  
    3232#include <ipc/dev_iface.h>
    3333
    34 /** ipc methods for getting/setting serial communication properties
    35  *      1st ipc arg: baud rate
    36  *      2nd ipc arg: parity
    37  *      3rd ipc arg: number of bits in one word
    38  *      4th ipc arg: number of stop bits
     34/** IPC methods for getting/setting serial communication properties
     35 *
     36 * 1st IPC arg: baud rate
     37 * 2nd IPC arg: parity
     38 * 3rd IPC arg: number of bits in one word
     39 * 4th IPC arg: number of stop bits
     40 *
    3941 */
    40 typedef enum { 
     42typedef enum {
    4143        SERIAL_GET_COM_PROPS = DEV_FIRST_CUSTOM_METHOD,
    4244        SERIAL_SET_COM_PROPS
     
    4850        SERIAL_EVEN_PARITY = 3,
    4951        SERIAL_MARK_PARITY = 5,
    50         SERIAL_SPACE_PARITY = 7 
     52        SERIAL_SPACE_PARITY = 7
    5153} serial_parity_t;
    5254
  • uspace/lib/c/include/ipc/services.h

    r2bdf8313 rb0f00a9  
    3838#define LIBC_SERVICES_H_
    3939
     40#include <fourcc.h>
     41
    4042typedef enum {
    41         SERVICE_NONE = 0,
    42         SERVICE_LOAD,
    43         SERVICE_PCI,
    44         SERVICE_VIDEO,
    45         SERVICE_CONSOLE,
    46         SERVICE_VFS,
    47         SERVICE_DEVMAP,
    48         SERVICE_DEVMAN,
    49         SERVICE_IRC,
    50         SERVICE_CLIPBOARD,
    51         SERVICE_NETWORKING,
    52         SERVICE_LO,
    53         SERVICE_NE2000,
    54         SERVICE_ETHERNET,
    55         SERVICE_NILDUMMY,
    56         SERVICE_IP,
    57         SERVICE_ARP,
    58         SERVICE_RARP,
    59         SERVICE_ICMP,
    60         SERVICE_UDP,
    61         SERVICE_TCP,
    62         SERVICE_SOCKET
     43        SERVICE_NONE       = 0,
     44        SERVICE_LOAD       = FOURCC('l', 'o', 'a', 'd'),
     45        SERVICE_VFS        = FOURCC('v', 'f', 's', ' '),
     46        SERVICE_LOC        = FOURCC('l', 'o', 'c', ' '),
     47        SERVICE_DEVMAN     = FOURCC('d', 'e', 'v', 'n'),
     48        SERVICE_IRC        = FOURCC('i', 'r', 'c', ' '),
     49        SERVICE_CLIPBOARD  = FOURCC('c', 'l', 'i', 'p'),
     50        SERVICE_NETWORKING = FOURCC('n', 'e', 't', ' '),
     51        SERVICE_ETHERNET   = FOURCC('e', 't', 'h', ' '),
     52        SERVICE_NILDUMMY   = FOURCC('n', 'i', 'l', 'd'),
     53        SERVICE_IP         = FOURCC('i', 'p', 'v', '4'),
     54        SERVICE_ARP        = FOURCC('a', 'r', 'p', ' '),
     55        SERVICE_ICMP       = FOURCC('i', 'c', 'm', 'p'),
     56        SERVICE_UDP        = FOURCC('u', 'd', 'p', ' '),
     57        SERVICE_TCP        = FOURCC('t', 'c', 'p', ' ')
    6358} services_t;
    6459
  • uspace/lib/c/include/ipc/vfs.h

    r2bdf8313 rb0f00a9  
    4242#define FS_NAME_MAXLEN  20
    4343#define MAX_PATH_LEN    (64 * 1024)
     44#define MAX_MNTOPTS_LEN 256
    4445#define PLB_SIZE        (2 * MAX_PATH_LEN)
    4546
     
    5657        /** Unique identifier of the fs. */
    5758        char name[FS_NAME_MAXLEN + 1];
     59        unsigned int instance;
    5860        bool concurrent_read_write;
    5961        bool write_retains_size;
     
    6264typedef enum {
    6365        VFS_IN_OPEN = IPC_FIRST_USER_METHOD,
    64         VFS_IN_OPEN_NODE,
    6566        VFS_IN_READ,
    6667        VFS_IN_WRITE,
     
    6970        VFS_IN_FSTAT,
    7071        VFS_IN_CLOSE,
     72        VFS_IN_PING,
    7173        VFS_IN_MOUNT,
    7274        VFS_IN_UNMOUNT,
     
    7779        VFS_IN_RENAME,
    7880        VFS_IN_STAT,
    79         VFS_IN_DUP
     81        VFS_IN_DUP,
     82        VFS_IN_WAIT_HANDLE,
     83        VFS_IN_MTAB_GET,
    8084} vfs_in_request_t;
    8185
Note: See TracChangeset for help on using the changeset viewer.