Changeset b0f00a9 in mainline for uspace/lib/c/include/ipc
- Timestamp:
- 2011-11-06T22:21:05Z (14 years ago)
- 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. - Location:
- uspace/lib/c/include/ipc
- Files:
-
- 2 added
- 15 edited
- 2 moved
-
bd.h (modified) (1 diff)
-
clipboard.h (modified) (1 diff)
-
common.h (modified) (2 diffs)
-
console.h (modified) (1 diff)
-
dev_iface.h (modified) (2 diffs)
-
devman.h (modified) (5 diffs)
-
il.h (modified) (1 diff)
-
input.h (added)
-
ipc.h (modified) (2 diffs)
-
kbdev.h (added)
-
loc.h (moved) (moved from uspace/lib/c/include/ipc/devmap.h ) (2 diffs)
-
mouseev.h (moved) (moved from uspace/lib/c/include/ipc/kbd.h ) (2 diffs)
-
net.h (modified) (4 diffs)
-
net_net.h (modified) (1 diff)
-
nil.h (modified) (1 diff)
-
ns.h (modified) (2 diffs)
-
serial_ctl.h (modified) (2 diffs)
-
services.h (modified) (1 diff)
-
vfs.h (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/ipc/bd.h
r2bdf8313 rb0f00a9 42 42 BD_GET_NUM_BLOCKS, 43 43 BD_READ_BLOCKS, 44 BD_WRITE_BLOCKS 44 BD_WRITE_BLOCKS, 45 BD_READ_TOC 45 46 } bd_request_t; 46 47 -
uspace/lib/c/include/ipc/clipboard.h
r2bdf8313 rb0f00a9 36 36 #define LIBC_IPC_CLIPBOARD_H_ 37 37 38 #include <ipc/common.h> 39 38 40 typedef enum { 39 41 CLIPBOARD_PUT_DATA = IPC_FIRST_USER_METHOD, -
uspace/lib/c/include/ipc/common.h
r2bdf8313 rb0f00a9 37 37 38 38 #include <sys/types.h> 39 #include <abi/ipc/ipc.h> 39 40 #include <atomic.h> 40 #include < kernel/ipc/ipc.h>41 #include <task.h> 41 42 42 43 #define IPC_FLAG_BLOCKING 0x01 … … 44 45 typedef struct { 45 46 sysarg_t args[IPC_CALL_LEN]; 46 sysarg_t in_task_hash;47 task_id_t in_task_id; 47 48 sysarg_t in_phone_hash; 48 49 } ipc_call_t; -
uspace/lib/c/include/ipc/console.h
r2bdf8313 rb0f00a9 48 48 CONSOLE_SET_COLOR, 49 49 CONSOLE_SET_RGB_COLOR, 50 CONSOLE_CURSOR_VISIBILITY, 51 CONSOLE_KCON_ENABLE 50 CONSOLE_CURSOR_VISIBILITY 52 51 } console_request_t; 53 52 -
uspace/lib/c/include/ipc/dev_iface.h
r2bdf8313 rb0f00a9 36 36 typedef enum { 37 37 HW_RES_DEV_IFACE = 0, 38 /** Character device interface */ 38 39 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 39 54 DEV_IFACE_MAX 40 55 } dev_inferface_idx_t; … … 48 63 DEV_IFACE_ID(DEV_FIRST_CUSTOM_METHOD_IDX) 49 64 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 50 75 51 76 #endif -
uspace/lib/c/include/ipc/devman.h
r2bdf8313 rb0f00a9 72 72 */ 73 73 typedef struct match_id_list { 74 li nk_t ids;74 list_t ids; 75 75 } match_id_list_t; 76 76 … … 95 95 { 96 96 match_id_t *mid = NULL; 97 link_t *link = ids->ids. next;97 link_t *link = ids->ids.head.next; 98 98 99 while (link != &ids->ids ) {99 while (link != &ids->ids.head) { 100 100 mid = list_get_instance(link, match_id_t,link); 101 101 if (mid->score < id->score) { 102 102 break; 103 } 103 } 104 104 link = link->next; 105 105 } … … 118 118 match_id_t *id; 119 119 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); 123 123 id = list_get_instance(link, match_id_t, link); 124 delete_match_id(id); 125 } 124 delete_match_id(id); 125 } 126 126 } 127 127 … … 130 130 DEVMAN_CLIENT, 131 131 DEVMAN_CONNECT_TO_DEVICE, 132 DEVMAN_CONNECT_FROM_ DEVMAP,132 DEVMAN_CONNECT_FROM_LOC, 133 133 DEVMAN_CONNECT_TO_PARENTS_DEVICE 134 134 } devman_interface_t; … … 138 138 DEVMAN_ADD_FUNCTION, 139 139 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 142 144 } driver_to_devman_t; 143 145 144 146 typedef 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, 147 153 } devman_to_driver_t; 148 154 149 155 typedef enum { 150 156 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 152 164 } client_to_devman_t; 153 165 -
uspace/lib/c/include/ipc/il.h
r2bdf8313 rb0f00a9 54 54 NET_IL_MTU_CHANGED, 55 55 56 /** 57 * Device address changed message 58 * @see il_addr_changed_msg() 59 */ 60 NET_IL_ADDR_CHANGED, 61 56 62 /** Packet received message. 57 63 * @see il_received_msg() -
uspace/lib/c/include/ipc/ipc.h
r2bdf8313 rb0f00a9 42 42 #include <sys/types.h> 43 43 #include <ipc/common.h> 44 #include <kernel/synch/synch.h> 44 #include <abi/ipc/methods.h> 45 #include <abi/synch.h> 45 46 #include <task.h> 46 47 … … 253 254 sysarg_t, sysarg_t, void *, ipc_async_callback_t, bool); 254 255 255 extern int ipc_connect_to_me(int, sysarg_t, sysarg_t, sysarg_t, sysarg_t *,256 extern int ipc_connect_to_me(int, sysarg_t, sysarg_t, sysarg_t, task_id_t *, 256 257 sysarg_t *); 258 extern int ipc_connect_me(int); 257 259 extern int ipc_connect_me_to(int, sysarg_t, sysarg_t, sysarg_t); 258 260 extern int ipc_connect_me_to_blocking(int, sysarg_t, sysarg_t, sysarg_t); -
uspace/lib/c/include/ipc/loc.h
r2bdf8313 rb0f00a9 1 1 /* 2 2 * Copyright (c) 2007 Josef Cejka 3 * Copyright (c) 2011 Jiri Svoboda 3 4 * All rights reserved. 4 5 * … … 27 28 */ 28 29 29 /** @addtogroup devmap30 /** @addtogroup loc 30 31 * @{ 31 32 */ 32 33 33 #ifndef DEVMAP_DEVMAP_H_34 #define DEVMAP_DEVMAP_H_34 #ifndef LIBC_IPC_LOC_H_ 35 #define LIBC_IPC_LOC_H_ 35 36 36 37 #include <ipc/common.h> 37 38 38 #define DEVMAP_NAME_MAXLEN 25539 #define LOC_NAME_MAXLEN 255 39 40 40 typedef sysarg_t devmap_handle_t; 41 typedef sysarg_t service_id_t; 42 typedef sysarg_t category_id_t; 41 43 42 44 typedef enum { 43 DEV_HANDLE_NONE,44 DEV_HANDLE_NAMESPACE,45 DEV_HANDLE_DEVICE46 } devmap_handle_type_t;45 LOC_OBJECT_NONE, 46 LOC_OBJECT_NAMESPACE, 47 LOC_OBJECT_SERVICE 48 } loc_object_type_t; 47 49 48 50 typedef 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; 63 72 64 /** Interface provided by devmap. 73 typedef enum { 74 LOC_EVENT_CAT_CHANGE = IPC_FIRST_USER_METHOD 75 } loc_event_t; 76 77 /** Ports provided by location service. 65 78 * 66 * Every process that connects to devmapmust ask one of following67 * interfacesotherwise connection will be refused.79 * Every process that connects to loc must ask one of following 80 * ports, otherwise connection will be refused. 68 81 * 69 82 */ 70 83 typedef 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, 75 88 /** Create new connection to instance of device that 76 89 is specified by second argument of call. */ 77 DEVMAP_CONNECT_TO_DEVICE78 } devmap_interface_t;90 LOC_CONNECT_TO_SERVICE 91 } loc_interface_t; 79 92 80 93 typedef 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; 84 97 85 98 #endif 99 100 /** @} 101 */ -
uspace/lib/c/include/ipc/mouseev.h
r2bdf8313 rb0f00a9 27 27 */ 28 28 29 /** @addtogroup kbdgen generic 30 * @brief HelenOS generic uspace keyboard handler. 31 * @ingroup kbd 29 /** @addtogroup mouse 30 * @brief 32 31 * @{ 33 32 */ … … 35 34 */ 36 35 37 #ifndef LIBC_IPC_ KBD_H_38 #define LIBC_IPC_ KBD_H_36 #ifndef LIBC_IPC_MOUSEEV_H_ 37 #define LIBC_IPC_MOUSEEV_H_ 39 38 40 39 #include <ipc/common.h> 40 #include <ipc/dev_iface.h> 41 41 42 42 typedef enum { 43 KBD_YIELD = IPC_FIRST_USER_METHOD,44 KBD_RECLAIM45 } kbd_request_t;43 MOUSEEV_YIELD = DEV_FIRST_CUSTOM_METHOD, 44 MOUSEEV_RECLAIM 45 } mouseev_request_t; 46 46 47 47 typedef 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; 50 51 51 52 #endif -
uspace/lib/c/include/ipc/net.h
r2bdf8313 rb0f00a9 277 277 * 278 278 */ 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)) 280 280 281 281 /** Return the packet identifier message argument. … … 298 298 * 299 299 */ 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)) 301 329 302 330 /** Return the maximum transmission unit message argument. … … 305 333 * 306 334 */ 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)) 329 336 330 337 /** Return the error service message argument. … … 335 342 #define IPC_GET_ERROR(call) ((services_t) IPC_GET_ARG4(call)) 336 343 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 344 344 /** Set the device identifier in the message answer. 345 345 * -
uspace/lib/c/include/ipc/net_net.h
r2bdf8313 rb0f00a9 43 43 /** Networking subsystem central module messages. */ 44 44 typedef enum { 45 /** Return s thegeneral configuration45 /** Return general configuration 46 46 * @see net_get_conf_req() 47 47 */ 48 48 NET_NET_GET_CONF = NET_FIRST, 49 /** Return s thedevice specific configuration49 /** Return device specific configuration 50 50 * @see net_get_device_conf_req() 51 51 */ 52 52 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 55 59 } net_messages; 56 60 -
uspace/lib/c/include/ipc/nil.h
r2bdf8313 rb0f00a9 70 70 */ 71 71 NET_NIL_BROADCAST_ADDR, 72 /** Device has changed address 73 * @see nil_addr_changed_msg() 74 */ 75 NET_NIL_ADDR_CHANGED 72 76 } nil_messages; 73 77 -
uspace/lib/c/include/ipc/ns.h
r2bdf8313 rb0f00a9 33 33 */ 34 34 35 #ifndef LIBC_ NS_H_36 #define LIBC_ NS_H_35 #ifndef LIBC_IPC_NS_H_ 36 #define LIBC_IPC_NS_H_ 37 37 38 #include <sys/types.h>39 38 #include <ipc/common.h> 40 39 … … 46 45 } ns_request_t; 47 46 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 52 47 #endif 53 48 -
uspace/lib/c/include/ipc/serial_ctl.h
r2bdf8313 rb0f00a9 32 32 #include <ipc/dev_iface.h> 33 33 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 * 39 41 */ 40 typedef enum { 42 typedef enum { 41 43 SERIAL_GET_COM_PROPS = DEV_FIRST_CUSTOM_METHOD, 42 44 SERIAL_SET_COM_PROPS … … 48 50 SERIAL_EVEN_PARITY = 3, 49 51 SERIAL_MARK_PARITY = 5, 50 SERIAL_SPACE_PARITY = 7 52 SERIAL_SPACE_PARITY = 7 51 53 } serial_parity_t; 52 54 -
uspace/lib/c/include/ipc/services.h
r2bdf8313 rb0f00a9 38 38 #define LIBC_SERVICES_H_ 39 39 40 #include <fourcc.h> 41 40 42 typedef 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', ' ') 63 58 } services_t; 64 59 -
uspace/lib/c/include/ipc/vfs.h
r2bdf8313 rb0f00a9 42 42 #define FS_NAME_MAXLEN 20 43 43 #define MAX_PATH_LEN (64 * 1024) 44 #define MAX_MNTOPTS_LEN 256 44 45 #define PLB_SIZE (2 * MAX_PATH_LEN) 45 46 … … 56 57 /** Unique identifier of the fs. */ 57 58 char name[FS_NAME_MAXLEN + 1]; 59 unsigned int instance; 58 60 bool concurrent_read_write; 59 61 bool write_retains_size; … … 62 64 typedef enum { 63 65 VFS_IN_OPEN = IPC_FIRST_USER_METHOD, 64 VFS_IN_OPEN_NODE,65 66 VFS_IN_READ, 66 67 VFS_IN_WRITE, … … 69 70 VFS_IN_FSTAT, 70 71 VFS_IN_CLOSE, 72 VFS_IN_PING, 71 73 VFS_IN_MOUNT, 72 74 VFS_IN_UNMOUNT, … … 77 79 VFS_IN_RENAME, 78 80 VFS_IN_STAT, 79 VFS_IN_DUP 81 VFS_IN_DUP, 82 VFS_IN_WAIT_HANDLE, 83 VFS_IN_MTAB_GET, 80 84 } vfs_in_request_t; 81 85
Note:
See TracChangeset
for help on using the changeset viewer.
