Changeset 3a0a4d8 in mainline for uspace/lib/c/include
- Timestamp:
- 2013-09-12T07:54:05Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 95027b5
- Parents:
- 47f5a77 (diff), 64f3d3b (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:
-
- 4 added
- 15 edited
-
adt/list.h (modified) (4 diffs)
-
async.h (modified) (2 diffs)
-
cfg.h (modified) (2 diffs)
-
corecfg.h (added)
-
ddi.h (modified) (4 diffs)
-
device/hw_res.h (modified) (2 diffs)
-
device/hw_res_parsed.h (modified) (1 diff)
-
device/pio_window.h (added)
-
devman.h (modified) (2 diffs)
-
inet/addr.h (modified) (1 diff)
-
inet/dnsr.h (modified) (1 diff)
-
ipc/corecfg.h (added)
-
ipc/dev_iface.h (modified) (3 diffs)
-
ipc/devman.h (modified) (3 diffs)
-
ipc/services.h (modified) (1 diff)
-
ipc/vfs.h (modified) (2 diffs)
-
macros.h (modified) (1 diff)
-
sys/statfs.h (added)
-
vfs/vfs.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/adt/list.h
r47f5a77 r3a0a4d8 1 1 /* 2 2 * Copyright (c) 2001-2004 Jakub Jermar 3 * Copyright (c) 201 1Jiri Svoboda3 * Copyright (c) 2013 Jiri Svoboda 4 4 * All rights reserved. 5 5 * … … 65 65 66 66 #define list_get_instance(link, type, member) \ 67 ((type *) (((void *)(link)) - ((void *) &(((type *) NULL)->member)))) 68 69 #define list_foreach(list, iterator) \ 70 for (link_t *iterator = (list).head.next; \ 71 iterator != &(list).head; iterator = iterator->next) 67 ((type *) (((void *)(link)) - list_link_to_void(&(((type *) NULL)->member)))) 68 69 #define list_foreach(list, member, itype, iterator) \ 70 for (itype *iterator = NULL; iterator == NULL; iterator = (itype *) 1) \ 71 for (link_t *_link = (list).head.next; \ 72 iterator = list_get_instance(_link, itype, member), \ 73 _link != &(list).head; _link = _link->next) 72 74 73 75 /** Unlike list_foreach(), allows removing items while traversing a list. 74 * 76 * 75 77 * @code 76 78 * list_t mylist; … … 238 240 static inline link_t *list_last(list_t *list) 239 241 { 240 return ((list->head.prev == &list->head) ? NULL : list->head.prev); 242 return (list->head.prev == &list->head) ? NULL : list->head.prev; 243 } 244 245 /** Get next item in list. 246 * 247 * @param link Current item link 248 * @param list List containing @a link 249 * 250 * @return Next item or NULL if @a link is the last item. 251 * 252 */ 253 static inline link_t *list_next(link_t *link, const list_t *list) 254 { 255 return (link->next == &list->head) ? NULL : link->next; 256 } 257 258 /** Get previous item in list. 259 * 260 * @param link Current item link 261 * @param list List containing @a link 262 * 263 * @return Previous item or NULL if @a link is the first item. 264 * 265 */ 266 static inline link_t *list_prev(link_t *link, const list_t *list) 267 { 268 return (link->prev == &list->head) ? NULL : link->prev; 241 269 } 242 270 … … 308 336 unsigned int cnt = 0; 309 337 310 list_foreach(*list, link) { 338 link_t *link = list_first(list); 339 while (link != NULL) { 311 340 if (cnt == n) 312 341 return link; 313 342 314 343 cnt++; 344 link = list_next(link, list); 315 345 } 316 346 317 347 return NULL; 348 } 349 350 /** Verify that argument type is a pointer to link_t (at compile time). 351 * 352 * This can be used to check argument type in a macro. 353 */ 354 static inline const void *list_link_to_void(const link_t *link) 355 { 356 return link; 318 357 } 319 358 -
uspace/lib/c/include/async.h
r47f5a77 r3a0a4d8 399 399 extern int async_data_read_start(async_exch_t *, void *, size_t); 400 400 extern bool async_data_read_receive(ipc_callid_t *, size_t *); 401 extern bool async_data_read_receive_call(ipc_callid_t *, ipc_call_t *, size_t *); 401 402 extern int async_data_read_finalize(ipc_callid_t, const void *, size_t); 402 403 … … 437 438 extern int async_data_write_start(async_exch_t *, const void *, size_t); 438 439 extern bool async_data_write_receive(ipc_callid_t *, size_t *); 440 extern bool async_data_write_receive_call(ipc_callid_t *, ipc_call_t *, size_t *); 439 441 extern int async_data_write_finalize(ipc_callid_t, void *, size_t); 440 442 -
uspace/lib/c/include/cfg.h
r47f5a77 r3a0a4d8 80 80 81 81 #define cfg_file_foreach(file, cur) \ 82 list_foreach((file)->sections, (cur))82 list_foreach((file)->sections, link, const cfg_section_t, (cur)) 83 83 84 84 #define cfg_section_instance(cur) \ … … 86 86 87 87 #define cfg_section_foreach(section, cur) \ 88 list_foreach((section)->entries, (cur))88 list_foreach((section)->entries, link, const cfg_entry_t, (cur)) 89 89 90 90 #define cfg_entry_instance(cur) \ -
uspace/lib/c/include/ddi.h
r47f5a77 r3a0a4d8 42 42 #include <task.h> 43 43 44 #define DMAMEM_16MiB ((uintptr_t) UINT64_C(0xffffffffff000000)) 45 #define DMAMEM_4GiB ((uintptr_t) UINT64_C(0xffffffff00000000)) 46 44 47 extern int device_assign_devno(void); 45 48 46 extern int physmem_map( void *, size_t, unsigned int, void **);49 extern int physmem_map(uintptr_t, size_t, unsigned int, void **); 47 50 48 extern int dmamem_map(void *, size_t, unsigned int, unsigned int, void **);49 extern int dmamem_map_anonymous(size_t, u nsigned int, unsigned int, void **,50 void **);51 extern int dmamem_map(void *, size_t, unsigned int, unsigned int, uintptr_t *); 52 extern int dmamem_map_anonymous(size_t, uintptr_t, unsigned int, unsigned int, 53 uintptr_t *, void **); 51 54 extern int dmamem_unmap(void *, size_t); 52 55 extern int dmamem_unmap_anonymous(void *); … … 69 72 extern uint32_t pio_read_32(const ioport32_t *); 70 73 71 static inline uint8_t pio_change_8( 72 ioport8_t *reg, uint8_t val, uint8_t mask,useconds_t delay)74 static inline uint8_t pio_change_8(ioport8_t *reg, uint8_t val, uint8_t mask, 75 useconds_t delay) 73 76 { 74 77 uint8_t v = pio_read_8(reg); … … 78 81 } 79 82 80 static inline uint16_t pio_change_16( 81 ioport16_t *reg, uint16_t val,uint16_t mask, useconds_t delay)83 static inline uint16_t pio_change_16(ioport16_t *reg, uint16_t val, 84 uint16_t mask, useconds_t delay) 82 85 { 83 86 uint16_t v = pio_read_16(reg); … … 87 90 } 88 91 89 static inline uint32_t pio_change_32( 90 ioport32_t *reg, uint32_t val,uint32_t mask, useconds_t delay)92 static inline uint32_t pio_change_32(ioport32_t *reg, uint32_t val, 93 uint32_t mask, useconds_t delay) 91 94 { 92 95 uint32_t v = pio_read_32(reg); -
uspace/lib/c/include/device/hw_res.h
r47f5a77 r3a0a4d8 53 53 HW_RES_ENABLE_INTERRUPT, 54 54 HW_RES_DMA_CHANNEL_SETUP, 55 HW_RES_DMA_CHANNEL_REMAIN, 55 56 } hw_res_method_t; 56 57 … … 115 116 116 117 extern int hw_res_dma_channel_setup(async_sess_t *, unsigned int, uint32_t, 117 uint16_t, uint8_t); 118 uint32_t, uint8_t); 119 extern int hw_res_dma_channel_remain(async_sess_t *, unsigned); 118 120 119 121 #endif -
uspace/lib/c/include/device/hw_res_parsed.h
r47f5a77 r3a0a4d8 139 139 } 140 140 141 extern int hw_res_list_parse(hw_resource_list_t *, hw_res_list_parsed_t *, int); 141 extern int hw_res_list_parse(const hw_resource_list_t *, 142 hw_res_list_parsed_t *, int); 142 143 extern int hw_res_get_list_parsed(async_sess_t *, hw_res_list_parsed_t *, int); 143 144 -
uspace/lib/c/include/devman.h
r47f5a77 r3a0a4d8 61 61 unsigned int); 62 62 extern int devman_fun_get_child(devman_handle_t, devman_handle_t *); 63 extern int devman_dev_get_parent(devman_handle_t, devman_handle_t *); 63 64 extern int devman_dev_get_functions(devman_handle_t, devman_handle_t **, 64 65 size_t *); 66 extern int devman_fun_get_match_id(devman_handle_t, size_t, char *, size_t, 67 unsigned int *); 65 68 extern int devman_fun_get_name(devman_handle_t, char *, size_t); 66 69 extern int devman_fun_get_driver_name(devman_handle_t, char *, size_t); … … 71 74 extern int devman_add_device_to_category(devman_handle_t, const char *); 72 75 extern int devman_fun_sid_to_handle(service_id_t, devman_handle_t *); 76 extern int devman_get_drivers(devman_handle_t **, size_t *); 77 extern int devman_driver_get_devices(devman_handle_t, devman_handle_t **, 78 size_t *); 79 extern int devman_driver_get_handle(const char *, devman_handle_t *); 80 extern int devman_driver_get_match_id(devman_handle_t, size_t, char *, size_t, 81 unsigned int *); 82 extern int devman_driver_get_name(devman_handle_t, char *, size_t); 83 extern int devman_driver_get_state(devman_handle_t, driver_state_t *); 84 extern int devman_driver_load(devman_handle_t); 73 85 74 86 #endif -
uspace/lib/c/include/inet/addr.h
r47f5a77 r3a0a4d8 73 73 extern void addr128(const addr128_t, addr128_t); 74 74 75 extern int addr48_compare(const addr48_t, const addr48_t); 75 76 extern int addr128_compare(const addr128_t, const addr128_t); 77 78 extern void addr48_solicited_node(const addr128_t, addr48_t); 76 79 77 80 extern void host2addr128_t_be(const addr128_t, addr128_t); -
uspace/lib/c/include/inet/dnsr.h
r47f5a77 r3a0a4d8 51 51 52 52 extern int dnsr_init(void); 53 extern int dnsr_name2host(const char *, dnsr_hostinfo_t ** );53 extern int dnsr_name2host(const char *, dnsr_hostinfo_t **, uint16_t); 54 54 extern void dnsr_hostinfo_destroy(dnsr_hostinfo_t *); 55 55 extern int dnsr_get_srvaddr(inet_addr_t *); -
uspace/lib/c/include/ipc/dev_iface.h
r47f5a77 r3a0a4d8 36 36 typedef enum { 37 37 HW_RES_DEV_IFACE = 0, 38 PIO_WINDOW_DEV_IFACE, 39 38 40 /** Character device interface */ 39 41 CHAR_DEV_IFACE, … … 41 43 /** Graphic device interface */ 42 44 GRAPH_DEV_IFACE, 45 46 /** Audio device mixer interface */ 47 AUDIO_MIXER_IFACE, 48 /** Audio device pcm buffer interface */ 49 AUDIO_PCM_BUFFER_IFACE, 43 50 44 51 /** Network interface controller interface */ … … 54 61 /** Interface provided by USB HID devices. */ 55 62 USBHID_DEV_IFACE, 63 56 64 /** Interface provided by Real Time Clock devices */ 57 65 CLOCK_DEV_IFACE, 66 58 67 /** Interface provided by battery powered devices */ 59 68 BATTERY_DEV_IFACE, 69 60 70 /** Interface provided by AHCI devices. */ 61 71 AHCI_DEV_IFACE, -
uspace/lib/c/include/ipc/devman.h
r47f5a77 r3a0a4d8 42 42 43 43 typedef sysarg_t devman_handle_t; 44 45 typedef enum { 46 /** Driver has not been started. */ 47 DRIVER_NOT_STARTED = 0, 48 49 /** 50 * Driver has been started, but has not registered as running and ready 51 * to receive requests. 52 */ 53 DRIVER_STARTING, 54 55 /** Driver is running and prepared to serve incomming requests. */ 56 DRIVER_RUNNING 57 } driver_state_t; 44 58 45 59 typedef enum { … … 155 169 DEVMAN_DEVICE_GET_HANDLE = IPC_FIRST_USER_METHOD, 156 170 DEVMAN_DEV_GET_FUNCTIONS, 171 DEVMAN_DEV_GET_PARENT, 157 172 DEVMAN_FUN_GET_CHILD, 173 DEVMAN_FUN_GET_MATCH_ID, 158 174 DEVMAN_FUN_GET_NAME, 159 175 DEVMAN_FUN_GET_DRIVER_NAME, … … 161 177 DEVMAN_FUN_OFFLINE, 162 178 DEVMAN_FUN_GET_PATH, 163 DEVMAN_FUN_SID_TO_HANDLE 179 DEVMAN_FUN_SID_TO_HANDLE, 180 DEVMAN_GET_DRIVERS, 181 DEVMAN_DRIVER_GET_DEVICES, 182 DEVMAN_DRIVER_GET_HANDLE, 183 DEVMAN_DRIVER_GET_MATCH_ID, 184 DEVMAN_DRIVER_GET_NAME, 185 DEVMAN_DRIVER_GET_STATE, 186 DEVMAN_DRIVER_LOAD 164 187 } client_to_devman_t; 165 188 -
uspace/lib/c/include/ipc/services.h
r47f5a77 r3a0a4d8 53 53 } services_t; 54 54 55 #define SERVICE_NAME_CORECFG "corecfg" 55 56 #define SERVICE_NAME_DNSR "net/dnsr" 56 57 #define SERVICE_NAME_INET "net/inet" -
uspace/lib/c/include/ipc/vfs.h
r47f5a77 r3a0a4d8 82 82 VFS_IN_WAIT_HANDLE, 83 83 VFS_IN_MTAB_GET, 84 VFS_IN_STATFS 84 85 } vfs_in_request_t; 85 86 … … 98 99 VFS_OUT_LOOKUP, 99 100 VFS_OUT_DESTROY, 101 VFS_OUT_STATFS, 100 102 VFS_OUT_LAST 101 103 } vfs_out_request_t; -
uspace/lib/c/include/macros.h
r47f5a77 r3a0a4d8 40 40 #define abs(a) ((a) >= 0 ? (a) : -(a)) 41 41 42 #define ARRAY_SIZE(array) (sizeof(array) / sizeof(array[0])) 42 43 43 44 #define KiB2SIZE(kb) ((kb) << 10) -
uspace/lib/c/include/vfs/vfs.h
r47f5a77 r3a0a4d8 44 44 #include "vfs_mtab.h" 45 45 46 46 47 enum vfs_change_state_type { 47 48 VFS_PASS_HANDLE 48 49 }; 50 49 51 50 52 extern char *absolutize(const char *, size_t *); … … 61 63 extern async_exch_t *vfs_exchange_begin(void); 62 64 extern void vfs_exchange_end(async_exch_t *); 63 64 65 #endif 65 66
Note:
See TracChangeset
for help on using the changeset viewer.
