Changeset 03362fbd in mainline for uspace/lib/c/include
- Timestamp:
- 2013-02-09T23:14:45Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 22dfd38
- Parents:
- b5d2e57 (diff), 005b765 (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:
-
- 25 added
- 33 edited
- 3 moved
-
adt/hash.h (added)
-
adt/hash_table.h (modified) (2 diffs)
-
adt/list.h (modified) (1 diff)
-
async.h (modified) (1 diff)
-
atomicdflt.h (modified) (1 diff)
-
bd.h (added)
-
bd_srv.h (added)
-
cfg.h (modified) (1 diff)
-
ddi.h (modified) (2 diffs)
-
device/battery_dev.h (added)
-
device/clock_dev.h (added)
-
device/graph_dev.h (added)
-
device/hw_res.h (modified) (1 diff)
-
devman.h (modified) (1 diff)
-
double_to_str.h (added)
-
fibril_synch.h (modified) (1 diff)
-
ieee_double.h (added)
-
inet/iplink_srv.h (modified) (1 diff)
-
io/charfield.h (moved) (moved from uspace/lib/fb/screenbuffer.h ) (6 diffs)
-
io/chargrid.h (added)
-
io/con_srv.h (added)
-
io/concaps.h (added)
-
io/console.h (modified) (2 diffs)
-
io/input.h (added)
-
io/kbd_event.h (added)
-
io/klog.h (modified) (1 diff)
-
io/log.h (modified) (1 diff)
-
io/logctl.h (added)
-
io/mode.h (added)
-
io/output.h (added)
-
io/pixel.h (added)
-
io/pixelmap.h (added)
-
io/verify.h (added)
-
io/visualizer.h (added)
-
io/window.h (added)
-
ipc/console.h (modified) (1 diff)
-
ipc/dev_iface.h (modified) (2 diffs)
-
ipc/graph.h (added)
-
ipc/input.h (modified) (1 diff)
-
ipc/ipc.h (modified) (3 diffs)
-
ipc/logger.h (added)
-
ipc/mouseev.h (modified) (1 diff)
-
ipc/output.h (added)
-
ipc/services.h (modified) (1 diff)
-
ipc/vfs.h (modified) (1 diff)
-
ipc/window.h (added)
-
loc.h (modified) (1 diff)
-
macros.h (modified) (2 diffs)
-
nic/nic.h (modified) (1 diff)
-
rtld/dynamic.h (modified) (1 diff)
-
sort.h (modified) (1 diff)
-
stack.h (moved) (moved from uspace/lib/c/include/bool.h ) (2 diffs)
-
stacktrace.h (modified) (1 diff)
-
stats.h (modified) (1 diff)
-
stdbool.h (moved) (moved from uspace/lib/posix/stdbool.h ) (2 diffs)
-
stdio.h (modified) (2 diffs)
-
str.h (modified) (4 diffs)
-
sys/stat.h (modified) (1 diff)
-
sys/time.h (modified) (4 diffs)
-
sysinfo.h (modified) (1 diff)
-
task.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/adt/hash_table.h
rb5d2e57 r03362fbd 1 1 /* 2 2 * Copyright (c) 2006 Jakub Jermar 3 * Copyright (c) 2012 Adam Hraska 4 * 3 5 * All rights reserved. 4 6 * … … 38 40 #include <adt/list.h> 39 41 #include <unistd.h> 40 #include <bool.h> 42 #include <stdbool.h> 43 #include <macros.h> 41 44 42 typedef unsigned long hash_count_t; 43 typedef unsigned long hash_index_t; 45 /** Opaque hash table link type. */ 46 typedef struct ht_link { 47 link_t link; 48 } ht_link_t; 44 49 45 50 /** Set of operations for hash table. */ 46 51 typedef struct { 47 /** Hash function. 48 * 49 * @param key Array of keys needed to compute hash index. 50 * All keys must be passed. 51 * 52 * @return Index into hash table. 53 * 54 */ 55 hash_index_t (*hash)(unsigned long key[]); 52 /** Returns the hash of the key stored in the item (ie its lookup key). */ 53 size_t (*hash)(const ht_link_t *item); 56 54 57 /** Hash table item comparison function. 58 * 59 * @param key Array of keys that will be compared with item. It is 60 * not necessary to pass all keys. 61 * 62 * @return True if the keys match, false otherwise. 63 * 64 */ 65 int (*compare)(unsigned long key[], hash_count_t keys, link_t *item); 55 /** Returns the hash of the key. */ 56 size_t (*key_hash)(void *key); 66 57 58 /** True if the items are equal (have the same lookup keys). */ 59 bool (*equal)(const ht_link_t *item1, const ht_link_t *item2); 60 61 /** Returns true if the key is equal to the item's lookup key. */ 62 bool (*key_equal)(void *key, const ht_link_t *item); 63 67 64 /** Hash table item removal callback. 65 * 66 * Must not invoke any mutating functions of the hash table. 68 67 * 69 68 * @param item Item that was removed from the hash table. 70 *71 69 */ 72 void (*remove_callback)( link_t *item);73 } hash_table_op erations_t;70 void (*remove_callback)(ht_link_t *item); 71 } hash_table_ops_t; 74 72 75 73 /** Hash table structure. */ 76 74 typedef struct { 77 list_t *entry; 78 hash_count_t entries; 79 hash_count_t max_keys; 80 hash_table_operations_t *op; 75 hash_table_ops_t *op; 76 list_t *bucket; 77 size_t bucket_cnt; 78 size_t full_item_cnt; 79 size_t item_cnt; 80 size_t max_load; 81 bool apply_ongoing; 81 82 } hash_table_t; 82 83 83 #define hash_table_get_inst ance(item, type, member) \84 list_get_instance((item), type, member)84 #define hash_table_get_inst(item, type, member) \ 85 member_to_inst((item), type, member) 85 86 86 extern bool hash_table_create(hash_table_t *, hash_count_t, hash_count_t, 87 hash_table_operations_t *); 87 extern bool hash_table_create(hash_table_t *, size_t, size_t, 88 hash_table_ops_t *); 89 extern void hash_table_destroy(hash_table_t *); 90 91 extern bool hash_table_empty(hash_table_t *); 92 extern size_t hash_table_size(hash_table_t *); 93 88 94 extern void hash_table_clear(hash_table_t *); 89 extern void hash_table_insert(hash_table_t *, unsigned long [], link_t *); 90 extern link_t *hash_table_find(hash_table_t *, unsigned long []); 91 extern void hash_table_remove(hash_table_t *, unsigned long [], hash_count_t); 92 extern void hash_table_destroy(hash_table_t *); 93 extern void hash_table_apply(hash_table_t *, void (*)(link_t *, void *), 94 void *); 95 extern void hash_table_insert(hash_table_t *, ht_link_t *); 96 extern bool hash_table_insert_unique(hash_table_t *, ht_link_t *); 97 extern ht_link_t *hash_table_find(const hash_table_t *, void *); 98 extern ht_link_t *hash_table_find_next(const hash_table_t *, ht_link_t *); 99 extern size_t hash_table_remove(hash_table_t *, void *); 100 extern void hash_table_remove_item(hash_table_t *, ht_link_t *); 101 extern void hash_table_apply(hash_table_t *, bool (*)(ht_link_t *, void *), 102 void *); 103 95 104 96 105 #endif -
uspace/lib/c/include/adt/list.h
rb5d2e57 r03362fbd 71 71 iterator != &(list).head; iterator = iterator->next) 72 72 73 /** Unlike list_foreach(), allows removing items while traversing a list. 74 * 75 * @code 76 * list_t mylist; 77 * typedef struct item { 78 * int value; 79 * link_t item_link; 80 * } item_t; 81 * 82 * //.. 83 * 84 * // Print each list element's value and remove the element from the list. 85 * list_foreach_safe(mylist, cur_link, next_link) { 86 * item_t *cur_item = list_get_instance(cur_link, item_t, item_link); 87 * printf("%d\n", cur_item->value); 88 * list_remove(cur_link); 89 * } 90 * @endcode 91 * 92 * @param list List to traverse. 93 * @param iterator Iterator to the current element of the list. 94 * The item this iterator points may be safely removed 95 * from the list. 96 * @param next_iter Iterator to the next element of the list. 97 */ 98 #define list_foreach_safe(list, iterator, next_iter) \ 99 for (link_t *iterator = (list).head.next, \ 100 *next_iter = iterator->next; \ 101 iterator != &(list).head; \ 102 iterator = next_iter, next_iter = iterator->next) 103 73 104 #define assert_link_not_used(link) \ 74 105 assert(((link)->prev == NULL) && ((link)->next == NULL)) 106 107 /** Returns true if the link is definitely part of a list. False if not sure. */ 108 static inline int link_in_use(link_t *link) 109 { 110 return link->prev != NULL && link->next != NULL; 111 } 75 112 76 113 /** Initialize doubly-linked circular list link -
uspace/lib/c/include/async.h
rb5d2e57 r03362fbd 44 44 #include <sys/time.h> 45 45 #include <atomic.h> 46 #include < bool.h>46 #include <stdbool.h> 47 47 #include <task.h> 48 48 -
uspace/lib/c/include/atomicdflt.h
rb5d2e57 r03362fbd 41 41 42 42 #include <stdint.h> 43 #include < bool.h>43 #include <stdbool.h> 44 44 45 45 typedef struct atomic { -
uspace/lib/c/include/cfg.h
rb5d2e57 r03362fbd 41 41 #include <adt/list.h> 42 42 #include <sys/types.h> 43 #include < bool.h>43 #include <stdbool.h> 44 44 45 45 /** -
uspace/lib/c/include/ddi.h
rb5d2e57 r03362fbd 36 36 #define LIBC_DDI_H_ 37 37 38 #include <stdbool.h> 38 39 #include <sys/types.h> 40 #include <sys/time.h> 39 41 #include <abi/ddi/irq.h> 40 42 #include <task.h> … … 50 52 extern int dmamem_unmap_anonymous(void *); 51 53 52 extern int iospace_enable(task_id_t, void *, unsigned long);53 54 extern int pio_enable(void *, size_t, void **); 55 56 typedef void (*trace_fnc)(const volatile void *place, uint32_t val, 57 volatile void* base, size_t size, void *data, bool write); 58 59 extern int pio_trace_enable(void *, size_t, trace_fnc, void *); 60 extern void pio_trace_log(const volatile void *, uint32_t val, bool write); 61 extern void pio_trace_disable(void *); 62 63 extern void pio_write_8(ioport8_t *, uint8_t); 64 extern void pio_write_16(ioport16_t *, uint16_t); 65 extern void pio_write_32(ioport32_t *, uint32_t); 66 67 extern uint8_t pio_read_8(const ioport8_t *); 68 extern uint16_t pio_read_16(const ioport16_t *); 69 extern uint32_t pio_read_32(const ioport32_t *); 70 71 static inline uint8_t pio_change_8( 72 ioport8_t *reg, uint8_t val, uint8_t mask, useconds_t delay) 73 { 74 uint8_t v = pio_read_8(reg); 75 udelay(delay); 76 pio_write_8(reg, (v & ~mask) | val); 77 return v; 78 } 79 80 static inline uint16_t pio_change_16( 81 ioport16_t *reg, uint16_t val, uint16_t mask, useconds_t delay) 82 { 83 uint16_t v = pio_read_16(reg); 84 udelay(delay); 85 pio_write_16(reg, (v & ~mask) | val); 86 return v; 87 } 88 89 static inline uint32_t pio_change_32( 90 ioport32_t *reg, uint32_t val, uint32_t mask, useconds_t delay) 91 { 92 uint32_t v = pio_read_32(reg); 93 udelay(delay); 94 pio_write_32(reg, (v & ~mask) | val); 95 return v; 96 } 97 98 static inline uint8_t pio_set_8(ioport8_t *r, uint8_t v, useconds_t d) 99 { 100 return pio_change_8(r, v, 0, d); 101 } 102 static inline uint16_t pio_set_16(ioport16_t *r, uint16_t v, useconds_t d) 103 { 104 return pio_change_16(r, v, 0, d); 105 } 106 static inline uint32_t pio_set_32(ioport32_t *r, uint32_t v, useconds_t d) 107 { 108 return pio_change_32(r, v, 0, d); 109 } 110 111 static inline uint8_t pio_clear_8(ioport8_t *r, uint8_t v, useconds_t d) 112 { 113 return pio_change_8(r, 0, v, d); 114 } 115 static inline uint16_t pio_clear_16(ioport16_t *r, uint16_t v, useconds_t d) 116 { 117 return pio_change_16(r, 0, v, d); 118 } 119 static inline uint32_t pio_clear_32(ioport32_t *r, uint32_t v, useconds_t d) 120 { 121 return pio_change_32(r, 0, v, d); 122 } 54 123 55 124 extern int irq_register(int, int, int, irq_code_t *); -
uspace/lib/c/include/device/hw_res.h
rb5d2e57 r03362fbd 38 38 #include <ipc/dev_iface.h> 39 39 #include <async.h> 40 #include < bool.h>40 #include <stdbool.h> 41 41 42 42 #define DMA_MODE_ON_DEMAND 0 -
uspace/lib/c/include/devman.h
rb5d2e57 r03362fbd 40 40 #include <ipc/loc.h> 41 41 #include <async.h> 42 #include < bool.h>42 #include <stdbool.h> 43 43 44 44 extern async_exch_t *devman_exchange_begin_blocking(devman_interface_t); -
uspace/lib/c/include/fibril_synch.h
rb5d2e57 r03362fbd 40 40 #include <libarch/tls.h> 41 41 #include <sys/time.h> 42 #include < bool.h>42 #include <stdbool.h> 43 43 44 44 typedef struct { -
uspace/lib/c/include/inet/iplink_srv.h
rb5d2e57 r03362fbd 38 38 #include <async.h> 39 39 #include <fibril_synch.h> 40 #include < bool.h>40 #include <stdbool.h> 41 41 #include <sys/types.h> 42 42 -
uspace/lib/c/include/io/charfield.h
rb5d2e57 r03362fbd 1 1 /* 2 2 * Copyright (c) 2006 Josef Cejka 3 * Copyright (c) 2011 Petr Koupy 3 4 * All rights reserved. 4 5 * … … 33 34 */ 34 35 35 #ifndef IMGMAP_SCREENBUFFER_H__36 #define IMGMAP_SCREENBUFFER_H__36 #ifndef LIBC_IO_CHARFIELD_H_ 37 #define LIBC_IO_CHARFIELD_H_ 37 38 38 39 #include <sys/types.h> 39 #include < bool.h>40 #include <stdbool.h> 40 41 #include <io/color.h> 41 42 #include <io/style.h> 42 #include "fb.h"43 #include <io/pixel.h> 43 44 44 45 typedef enum { 45 SCREENBUFFER_FLAG_NONE = 0,46 SCREENBUFFER_FLAG_SHARED= 147 } screenbuffer_flag_t;46 CHAR_FLAG_NONE = 0, 47 CHAR_FLAG_DIRTY = 1 48 } char_flags_t; 48 49 49 50 typedef enum { … … 52 53 CHAR_ATTR_RGB 53 54 } char_attr_type_t; 54 55 typedef enum {56 CHAR_FLAG_NONE = 0,57 CHAR_FLAG_DIRTY = 158 } char_flags_t;59 55 60 56 typedef struct { … … 65 61 66 62 typedef struct { 67 pixel_t bgcolor; /**< Background color */68 pixel_t fgcolor; /**< Foreground color */63 pixel_t bgcolor; 64 pixel_t fgcolor; 69 65 } char_attr_rgb_t; 70 66 … … 80 76 } char_attrs_t; 81 77 82 /** One field on screen. It contain one character and its attributes. */83 78 typedef struct { 84 wchar_t ch; /**< Character itself */85 char_attrs_t attrs; /**< Character attributes */86 char_flags_t flags; /**< Character flags */79 wchar_t ch; 80 char_attrs_t attrs; 81 char_flags_t flags; 87 82 } charfield_t; 88 83 89 /** Compare two sets of attributes.90 *91 * @param a1 First attribute.92 * @param a2 Second attribute.93 *94 * @return True on equality95 *96 */97 84 static inline bool attrs_same(char_attrs_t a1, char_attrs_t a2) 98 85 { … … 115 102 } 116 103 117 extern screenbuffer_t *screenbuffer_create(sysarg_t, sysarg_t,118 screenbuffer_flag_t);119 120 extern charfield_t *screenbuffer_field_at(screenbuffer_t *, sysarg_t, sysarg_t);121 extern bool screenbuffer_cursor_at(screenbuffer_t *, sysarg_t, sysarg_t);122 123 extern sysarg_t screenbuffer_get_top_row(screenbuffer_t *);124 125 extern sysarg_t screenbuffer_putchar(screenbuffer_t *, wchar_t, bool);126 extern sysarg_t screenbuffer_newline(screenbuffer_t *);127 extern sysarg_t screenbuffer_tabstop(screenbuffer_t *, sysarg_t);128 extern sysarg_t screenbuffer_backspace(screenbuffer_t *);129 130 extern void screenbuffer_clear(screenbuffer_t *);131 extern void screenbuffer_clear_row(screenbuffer_t *, sysarg_t);132 133 extern void screenbuffer_set_cursor(screenbuffer_t *, sysarg_t, sysarg_t);134 extern void screenbuffer_set_cursor_visibility(screenbuffer_t *, bool);135 extern bool screenbuffer_get_cursor_visibility(screenbuffer_t *);136 137 extern void screenbuffer_get_cursor(screenbuffer_t *, sysarg_t *, sysarg_t *);138 139 extern void screenbuffer_set_style(screenbuffer_t *, console_style_t);140 extern void screenbuffer_set_color(screenbuffer_t *, console_color_t,141 console_color_t, console_color_attr_t);142 extern void screenbuffer_set_rgb_color(screenbuffer_t *, pixel_t, pixel_t);143 144 104 #endif 145 105 -
uspace/lib/c/include/io/console.h
rb5d2e57 r03362fbd 37 37 38 38 #include <sys/time.h> 39 #include <io/concaps.h> 40 #include <io/kbd_event.h> 39 41 #include <io/keycode.h> 40 42 #include <async.h> 41 #include < bool.h>43 #include <stdbool.h> 42 44 #include <stdio.h> 43 44 typedef enum {45 CONSOLE_CAP_NONE = 0,46 CONSOLE_CAP_STYLE = 1,47 CONSOLE_CAP_INDEXED = 2,48 CONSOLE_CAP_RGB = 449 } console_caps_t;50 45 51 46 /** Console control structure. */ … … 69 64 aid_t input_aid; 70 65 } console_ctrl_t; 71 72 typedef enum {73 KEY_PRESS,74 KEY_RELEASE75 } kbd_event_type_t;76 77 /** Console event structure. */78 typedef struct {79 /** List handle */80 link_t link;81 82 /** Press or release event. */83 kbd_event_type_t type;84 85 /** Keycode of the key that was pressed or released. */86 keycode_t key;87 88 /** Bitmask of modifiers held. */89 keymod_t mods;90 91 /** The character that was generated or '\0' for none. */92 wchar_t c;93 } kbd_event_t;94 66 95 67 extern console_ctrl_t *console_init(FILE *, FILE *); -
uspace/lib/c/include/io/klog.h
rb5d2e57 r03362fbd 38 38 #include <sys/types.h> 39 39 #include <stdarg.h> 40 #include <io/verify.h> 40 41 41 42 extern size_t klog_write(const void *, size_t); 42 43 extern void klog_update(void); 43 extern int klog_printf(const char *, ...); 44 extern void klog_command(const void *, size_t); 45 extern int klog_printf(const char *, ...) 46 PRINTF_ATTRIBUTE(1, 2); 44 47 extern int klog_vprintf(const char *, va_list); 45 48 -
uspace/lib/c/include/io/log.h
rb5d2e57 r03362fbd 36 36 37 37 #include <stdarg.h> 38 #include <inttypes.h> 39 #include <io/verify.h> 38 40 41 /** Log message level. */ 39 42 typedef enum { 43 /** Fatal error, program is not able to recover at all. */ 40 44 LVL_FATAL, 45 /** Serious error but the program can recover from it. */ 41 46 LVL_ERROR, 47 /** Easily recoverable problem. */ 42 48 LVL_WARN, 49 /** Information message that ought to be printed by default. */ 43 50 LVL_NOTE, 51 /** Debugging purpose message. */ 44 52 LVL_DEBUG, 53 /** More detailed debugging message. */ 45 54 LVL_DEBUG2, 46 55 47 56 /** For checking range of values */ 48 57 LVL_LIMIT 49 58 } log_level_t; 50 59 51 extern int log_init(const char *, log_level_t); 52 extern void log_msg(log_level_t, const char *, ...); 53 extern void log_msgv(log_level_t, const char *, va_list); 60 /** Log itself (logging target). */ 61 typedef sysarg_t log_t; 62 /** Formatting directive for printing log_t. */ 63 #define PRIlogctx PRIxn 64 65 /** Default log (target). */ 66 #define LOG_DEFAULT ((log_t) -1) 67 68 /** Use when creating new top-level log. */ 69 #define LOG_NO_PARENT ((log_t) 0) 70 71 extern const char *log_level_str(log_level_t); 72 extern int log_level_from_str(const char *, log_level_t *); 73 74 extern int log_init(const char *); 75 extern log_t log_create(const char *, log_t); 76 77 extern void log_msg(log_t, log_level_t, const char *, ...) 78 PRINTF_ATTRIBUTE(3, 4); 79 extern void log_msgv(log_t, log_level_t, const char *, va_list); 54 80 55 81 #endif -
uspace/lib/c/include/ipc/console.h
rb5d2e57 r03362fbd 43 43 CONSOLE_GET_EVENT, 44 44 CONSOLE_GET_POS, 45 CONSOLE_ GOTO,45 CONSOLE_SET_POS, 46 46 CONSOLE_CLEAR, 47 47 CONSOLE_SET_STYLE, 48 48 CONSOLE_SET_COLOR, 49 49 CONSOLE_SET_RGB_COLOR, 50 CONSOLE_ CURSOR_VISIBILITY50 CONSOLE_SET_CURSOR_VISIBILITY 51 51 } console_request_t; 52 52 -
uspace/lib/c/include/ipc/dev_iface.h
rb5d2e57 r03362fbd 44 44 /** Character device interface */ 45 45 CHAR_DEV_IFACE, 46 47 /** Graphic device interface */ 48 GRAPH_DEV_IFACE, 46 49 47 50 /** Network interface controller interface */ … … 57 60 /** Interface provided by USB HID devices. */ 58 61 USBHID_DEV_IFACE, 62 /** Interface provided by Real Time Clock devices */ 63 CLOCK_DEV_IFACE, 64 /** Interface provided by battery powered devices */ 65 BATTERY_DEV_IFACE, 59 66 /** Interface provided by AHCI devices. */ 60 67 AHCI_DEV_IFACE, -
uspace/lib/c/include/ipc/input.h
rb5d2e57 r03362fbd 46 46 INPUT_EVENT_KEY = IPC_FIRST_USER_METHOD, 47 47 INPUT_EVENT_MOVE, 48 INPUT_EVENT_ABS_MOVE, 48 49 INPUT_EVENT_BUTTON 49 50 } input_notif_t; -
uspace/lib/c/include/ipc/ipc.h
rb5d2e57 r03362fbd 47 47 48 48 typedef void (*ipc_async_callback_t)(void *, int, ipc_call_t *); 49 50 /*51 * User-friendly wrappers for ipc_call_sync_fast() and ipc_call_sync_slow().52 * They are in the form ipc_call_sync_m_n(), where m denotes the number of53 * arguments of payload and n denotes number of return values. Whenever54 * possible, the fast version is used.55 */56 57 #define ipc_call_sync_0_0(phoneid, method) \58 ipc_call_sync_fast((phoneid), (method), 0, 0, 0, 0, 0, 0, 0, 0)59 #define ipc_call_sync_0_1(phoneid, method, res1) \60 ipc_call_sync_fast((phoneid), (method), 0, 0, 0, (res1), 0, 0, 0, 0)61 #define ipc_call_sync_0_2(phoneid, method, res1, res2) \62 ipc_call_sync_fast((phoneid), (method), 0, 0, 0, (res1), (res2), 0, 0, 0)63 #define ipc_call_sync_0_3(phoneid, method, res1, res2, res3) \64 ipc_call_sync_fast((phoneid), (method), 0, 0, 0, (res1), (res2), (res3), \65 0, 0)66 #define ipc_call_sync_0_4(phoneid, method, res1, res2, res3, res4) \67 ipc_call_sync_fast((phoneid), (method), 0, 0, 0, (res1), (res2), (res3), \68 (res4), 0)69 #define ipc_call_sync_0_5(phoneid, method, res1, res2, res3, res4, res5) \70 ipc_call_sync_fast((phoneid), (method), 0, 0, 0, (res1), (res2), (res3), \71 (res4), (res5))72 73 #define ipc_call_sync_1_0(phoneid, method, arg1) \74 ipc_call_sync_fast((phoneid), (method), (arg1), 0, 0, 0, 0, 0, 0, 0)75 #define ipc_call_sync_1_1(phoneid, method, arg1, res1) \76 ipc_call_sync_fast((phoneid), (method), (arg1), 0, 0, (res1), 0, 0, 0, 0)77 #define ipc_call_sync_1_2(phoneid, method, arg1, res1, res2) \78 ipc_call_sync_fast((phoneid), (method), (arg1), 0, 0, (res1), (res2), 0, \79 0, 0)80 #define ipc_call_sync_1_3(phoneid, method, arg1, res1, res2, res3) \81 ipc_call_sync_fast((phoneid), (method), (arg1), 0, 0, (res1), (res2), \82 (res3), 0, 0)83 #define ipc_call_sync_1_4(phoneid, method, arg1, res1, res2, res3, res4) \84 ipc_call_sync_fast((phoneid), (method), (arg1), 0, 0, (res1), (res2), \85 (res3), (res4), 0)86 #define ipc_call_sync_1_5(phoneid, method, arg1, res1, res2, res3, res4, \87 res5) \88 ipc_call_sync_fast((phoneid), (method), (arg1), 0, 0, (res1), (res2), \89 (res3), (res4), (res5))90 91 #define ipc_call_sync_2_0(phoneid, method, arg1, arg2) \92 ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), 0, 0, 0, 0, \93 0, 0)94 #define ipc_call_sync_2_1(phoneid, method, arg1, arg2, res1) \95 ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), 0, (res1), 0, 0, \96 0, 0)97 #define ipc_call_sync_2_2(phoneid, method, arg1, arg2, res1, res2) \98 ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), 0, (res1), \99 (res2), 0, 0, 0)100 #define ipc_call_sync_2_3(phoneid, method, arg1, arg2, res1, res2, res3) \101 ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), 0, (res1), \102 (res2), (res3), 0, 0)103 #define ipc_call_sync_2_4(phoneid, method, arg1, arg2, res1, res2, res3, \104 res4) \105 ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), 0, (res1), \106 (res2), (res3), (res4), 0)107 #define ipc_call_sync_2_5(phoneid, method, arg1, arg2, res1, res2, res3, \108 res4, res5)\109 ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), 0, (res1), \110 (res2), (res3), (res4), (res5))111 112 #define ipc_call_sync_3_0(phoneid, method, arg1, arg2, arg3) \113 ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), (arg3), 0, 0, 0, \114 0, 0)115 #define ipc_call_sync_3_1(phoneid, method, arg1, arg2, arg3, res1) \116 ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), (arg3), (res1), \117 0, 0, 0, 0)118 #define ipc_call_sync_3_2(phoneid, method, arg1, arg2, arg3, res1, res2) \119 ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), (arg3), (res1), \120 (res2), 0, 0, 0)121 #define ipc_call_sync_3_3(phoneid, method, arg1, arg2, arg3, res1, res2, \122 res3) \123 ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), (arg3), \124 (res1), (res2), (res3), 0, 0)125 #define ipc_call_sync_3_4(phoneid, method, arg1, arg2, arg3, res1, res2, \126 res3, res4) \127 ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), (arg3), \128 (res1), (res2), (res3), (res4), 0)129 #define ipc_call_sync_3_5(phoneid, method, arg1, arg2, arg3, res1, res2, \130 res3, res4, res5) \131 ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), (arg3), \132 (res1), (res2), (res3), (res4), (res5))133 134 #define ipc_call_sync_4_0(phoneid, method, arg1, arg2, arg3, arg4) \135 ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), (arg4), 0, \136 0, 0, 0, 0, 0)137 #define ipc_call_sync_4_1(phoneid, method, arg1, arg2, arg3, arg4, res1) \138 ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), (arg4), 0, \139 (res1), 0, 0, 0, 0)140 #define ipc_call_sync_4_2(phoneid, method, arg1, arg2, arg3, arg4, res1, res2) \141 ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), (arg4), 0, \142 (res1), (res2), 0, 0, 0)143 #define ipc_call_sync_4_3(phoneid, method, arg1, arg2, arg3, arg4, res1, res2, \144 res3) \145 ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), \146 (arg4), 0, (res1), (res2), (res3), 0, 0)147 #define ipc_call_sync_4_4(phoneid, method, arg1, arg2, arg3, arg4, res1, res2, \148 res3, res4) \149 ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), \150 (arg4), 0, (res1), (res2), (res3), (res4), 0)151 #define ipc_call_sync_4_5(phoneid, method, arg1, arg2, arg3, arg4, res1, res2, \152 res3, res4, res5) \153 ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), \154 (arg4), 0, (res1), (res2), (res3), (res4), (res5))155 156 #define ipc_call_sync_5_0(phoneid, method, arg1, arg2, arg3, arg4, arg5) \157 ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \158 (arg5), 0, 0, 0, 0, 0)159 #define ipc_call_sync_5_1(phoneid, method, arg1, arg2, arg3, arg4, arg5, res1) \160 ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \161 (arg5), (res1), 0, 0, 0, 0)162 #define ipc_call_sync_5_2(phoneid, method, arg1, arg2, arg3, arg4, arg5, res1, \163 res2) \164 ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), \165 (arg4), (arg5), (res1), (res2), 0, 0, 0)166 #define ipc_call_sync_5_3(phoneid, method, arg1, arg2, arg3, arg4, arg5, res1, \167 res2, res3) \168 ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), \169 (arg4), (arg5), (res1), (res2), (res3), 0, 0)170 #define ipc_call_sync_5_4(phoneid, method, arg1, arg2, arg3, arg4, arg5, res1, \171 res2, res3, res4) \172 ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), \173 (arg4), (arg5), (res1), (res2), (res3), (res4), 0)174 #define ipc_call_sync_5_5(phoneid, method, arg1, arg2, arg3, arg4, arg5, res1, \175 res2, res3, res4, res5) \176 ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), \177 (arg4), (arg5), (res1), (res2), (res3), (res4), (res5))178 179 extern int ipc_call_sync_fast(int, sysarg_t, sysarg_t, sysarg_t, sysarg_t,180 sysarg_t *, sysarg_t *, sysarg_t *, sysarg_t *, sysarg_t *);181 182 extern int ipc_call_sync_slow(int, sysarg_t, sysarg_t, sysarg_t, sysarg_t,183 sysarg_t, sysarg_t, sysarg_t *, sysarg_t *, sysarg_t *, sysarg_t *,184 sysarg_t *);185 49 186 50 extern ipc_callid_t ipc_wait_cycle(ipc_call_t *, sysarg_t, unsigned int); … … 254 118 sysarg_t, sysarg_t, void *, ipc_async_callback_t, bool); 255 119 256 extern int ipc_clone_establish(int);257 extern int ipc_connect_to_me(int, sysarg_t, sysarg_t, sysarg_t, task_id_t *,258 sysarg_t *);259 extern int ipc_connect_me_to(int, sysarg_t, sysarg_t, sysarg_t);260 extern int ipc_connect_me_to_blocking(int, sysarg_t, sysarg_t, sysarg_t);261 262 120 extern int ipc_hangup(int); 263 121 … … 267 125 sysarg_t, sysarg_t, sysarg_t, unsigned int); 268 126 269 /*270 * User-friendly wrappers for ipc_share_in_start().271 */272 273 #define ipc_share_in_start_0_0(phoneid, size, dst) \274 ipc_share_in_start((phoneid), (size), 0, NULL, (dst))275 #define ipc_share_in_start_0_1(phoneid, size, flags, dst) \276 ipc_share_in_start((phoneid), (size), 0, (flags), (dst))277 #define ipc_share_in_start_1_0(phoneid, size, arg, dst) \278 ipc_share_in_start((phoneid), (size), (arg), NULL, (dst))279 #define ipc_share_in_start_1_1(phoneid, size, arg, flags, dst) \280 ipc_share_in_start((phoneid), (size), (arg), (flags), (dst))281 282 extern int ipc_share_in_start(int, size_t, sysarg_t, unsigned int *, void **);283 extern int ipc_share_in_finalize(ipc_callid_t, void *, unsigned int);284 extern int ipc_share_out_start(int, void *, unsigned int);285 extern int ipc_share_out_finalize(ipc_callid_t, void **);286 extern int ipc_data_read_start(int, void *, size_t);287 extern int ipc_data_read_finalize(ipc_callid_t, const void *, size_t);288 extern int ipc_data_write_start(int, const void *, size_t);289 extern int ipc_data_write_finalize(ipc_callid_t, void *, size_t);290 291 127 extern int ipc_connect_kbox(task_id_t); 292 128 -
uspace/lib/c/include/ipc/mouseev.h
rb5d2e57 r03362fbd 47 47 typedef enum { 48 48 MOUSEEV_MOVE_EVENT = IPC_FIRST_USER_METHOD, 49 MOUSEEV_ABS_MOVE_EVENT, 49 50 MOUSEEV_BUTTON_EVENT 50 51 } mouseev_notif_t; -
uspace/lib/c/include/ipc/services.h
rb5d2e57 r03362fbd 45 45 SERVICE_VFS = FOURCC('v', 'f', 's', ' '), 46 46 SERVICE_LOC = FOURCC('l', 'o', 'c', ' '), 47 SERVICE_LOGGER = FOURCC('l', 'o', 'g', 'g'), 47 48 SERVICE_DEVMAN = FOURCC('d', 'e', 'v', 'n'), 48 49 SERVICE_IRC = FOURCC('i', 'r', 'c', ' '), -
uspace/lib/c/include/ipc/vfs.h
rb5d2e57 r03362fbd 38 38 #include <ipc/common.h> 39 39 #include <sys/types.h> 40 #include < bool.h>40 #include <stdbool.h> 41 41 42 42 #define FS_NAME_MAXLEN 20 -
uspace/lib/c/include/loc.h
rb5d2e57 r03362fbd 38 38 #include <ipc/loc.h> 39 39 #include <async.h> 40 #include < bool.h>40 #include <stdbool.h> 41 41 42 42 typedef void (*loc_cat_change_cb_t)(void); -
uspace/lib/c/include/macros.h
rb5d2e57 r03362fbd 38 38 #define min(a, b) ((a) < (b) ? (a) : (b)) 39 39 #define max(a, b) ((a) > (b) ? (a) : (b)) 40 #define abs(a) ((a) >= 0 ? (a) : (-a)) 41 40 42 41 43 #define KiB2SIZE(kb) ((kb) << 10) … … 52 54 | ((((uint64_t) (up)) & 0xffffffff) << 32)) 53 55 56 #ifndef member_to_inst 57 #define member_to_inst(ptr_member, type, member_identif) \ 58 ((type*) (((void*)(ptr_member)) - ((void*)&(((type*)0)->member_identif)))) 54 59 #endif 60 61 62 #endif 63 64 #define _paddname(line) PADD_ ## line ## __ 65 #define _padd(width, line) uint ## width ## _t _paddname(line) 66 #define PADD32 _padd(32, __LINE__) 67 #define PADD16 _padd(16, __LINE__) 68 #define PADD8 _padd(8, __LINE__) 55 69 56 70 /** @} -
uspace/lib/c/include/nic/nic.h
rb5d2e57 r03362fbd 40 40 41 41 #include <nic/eth_phys.h> 42 #include < bool.h>42 #include <stdbool.h> 43 43 44 44 /** Ethernet address length. */ -
uspace/lib/c/include/rtld/dynamic.h
rb5d2e57 r03362fbd 36 36 #define LIBC_RTLD_DYNAMIC_H_ 37 37 38 #include < bool.h>38 #include <stdbool.h> 39 39 #include <rtld/elf_dyn.h> 40 40 #include <libarch/rtld/dynamic.h> -
uspace/lib/c/include/sort.h
rb5d2e57 r03362fbd 37 37 38 38 #include <sys/types.h> 39 #include < bool.h>39 #include <stdbool.h> 40 40 41 41 typedef int (* sort_cmp_t)(void *, void *, void *); -
uspace/lib/c/include/stack.h
rb5d2e57 r03362fbd 1 1 /* 2 * Copyright (c) 20 06 Martin Decky2 * Copyright (c) 2012 Jakub Jermar 3 3 * All rights reserved. 4 4 * … … 33 33 */ 34 34 35 #ifndef LIBC_ BOOL_H_36 #define LIBC_ BOOL_H_35 #ifndef LIBC_STACK_H_ 36 #define LIBC_STACK_H_ 37 37 38 38 #include <libarch/types.h> 39 #include <abi/bool.h>40 39 41 #define false 0 42 #define true 1 40 extern size_t stack_size_get(void); 43 41 44 42 #endif -
uspace/lib/c/include/stacktrace.h
rb5d2e57 r03362fbd 38 38 39 39 #include <sys/types.h> 40 #include < bool.h>40 #include <stdbool.h> 41 41 42 42 typedef struct { -
uspace/lib/c/include/stats.h
rb5d2e57 r03362fbd 39 39 #include <thread.h> 40 40 #include <stdint.h> 41 #include < bool.h>41 #include <stdbool.h> 42 42 #include <sys/types.h> 43 43 #include <abi/sysinfo.h> -
uspace/lib/c/include/stdbool.h
rb5d2e57 r03362fbd 1 1 /* 2 * Copyright (c) 20 11 Jiri Zarevucky2 * Copyright (c) 2006 Martin Decky 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup lib posix29 /** @addtogroup libc 30 30 * @{ 31 31 */ 32 /** @file Boolean type and values.32 /** @file 33 33 */ 34 34 35 #ifndef POSIX_STDBOOL_H_36 #define POSIX_STDBOOL_H_35 #ifndef LIBC_BOOL_H_ 36 #define LIBC_BOOL_H_ 37 37 38 #ifdef LIBC_BOOL_H_ 38 #include <libarch/types.h> 39 #include <abi/bool.h> 39 40 40 #if (!defined(POSIX_STDIO_H_)) && \ 41 (!defined(POSIX_STDLIB_H_)) && \ 42 (!defined(POSIX_STRING_H_)) 43 #error "You can't include bool.h and stdbool.h at the same time." 41 #define false 0 42 #define true 1 43 44 #define __bool_true_false_are_defined 1 45 44 46 #endif 45 47 46 #endif /* LIBC_BOOL_H */ 47 48 #define LIBC_BOOL_H_ 49 50 #define bool _Bool 51 #define true 1 52 #define false 0 53 #define __bool_true_false_are_defined 1 54 55 #endif /* POSIX_STDBOOL_H_ */ 48 /** @} 49 */ -
uspace/lib/c/include/stdio.h
rb5d2e57 r03362fbd 39 39 #include <stdarg.h> 40 40 #include <str.h> 41 42 #ifndef NVERIFY_PRINTF 43 44 #define PRINTF_ATTRIBUTE(start, end) \ 45 __attribute__((format(gnu_printf, start, end))) 46 47 #else /* NVERIFY_PRINTF */ 48 49 #define PRINTF_ATTRIBUTE(start, end) 50 51 #endif /* NVERIFY_PRINTF */ 41 #include <io/verify.h> 42 #include <abi/klog.h> 52 43 53 44 #define EOF (-1) … … 61 52 int _n = snprintf(_buf, sizeof(_buf), fmt, ##__VA_ARGS__); \ 62 53 if (_n > 0) \ 63 (void) __SYSCALL3(SYS_KLOG, 1, (sysarg_t) _buf, str_size(_buf)); \54 (void) __SYSCALL3(SYS_KLOG, KLOG_WRITE, (sysarg_t) _buf, str_size(_buf)); \ 64 55 } 65 56 -
uspace/lib/c/include/str.h
rb5d2e57 r03362fbd 39 39 #include <mem.h> 40 40 #include <sys/types.h> 41 #include < bool.h>41 #include <stdbool.h> 42 42 43 43 #define U_SPECIAL '?' … … 56 56 57 57 extern wchar_t str_decode(const char *str, size_t *offset, size_t sz); 58 extern wchar_t str_decode_reverse(const char *str, size_t *offset, size_t sz); 58 59 extern int chr_encode(const wchar_t ch, char *str, size_t *offset, size_t sz); 59 60 … … 73 74 extern size_t wstr_nlength(const wchar_t *str, size_t size); 74 75 76 extern size_t chr_width(wchar_t ch); 77 extern size_t str_width(const char *str); 78 75 79 extern bool ascii_check(wchar_t ch); 76 80 extern bool chr_check(wchar_t ch); … … 78 82 extern int str_cmp(const char *s1, const char *s2); 79 83 extern int str_lcmp(const char *s1, const char *s2, size_t max_len); 84 85 extern bool str_test_prefix(const char *s, const char *p); 80 86 81 87 extern void str_cpy(char *dest, size_t size, const char *src); -
uspace/lib/c/include/sys/stat.h
rb5d2e57 r03362fbd 37 37 38 38 #include <sys/types.h> 39 #include < bool.h>39 #include <stdbool.h> 40 40 #include <ipc/vfs.h> 41 41 #include <ipc/loc.h> -
uspace/lib/c/include/sys/time.h
rb5d2e57 r03362fbd 1 1 /* 2 2 * Copyright (c) 2006 Ondrej Palkovsky 3 * Copyright (c) 2011 Petr Koupy 4 * Copyright (c) 2011 Jiri Zarevucky 3 5 * All rights reserved. 4 6 * … … 39 41 40 42 #define DST_NONE 0 43 #define ASCTIME_BUF_LEN 26 41 44 42 45 typedef long time_t; … … 45 48 typedef uint32_t useconds_t; 46 49 typedef uint32_t mseconds_t; 50 51 struct tm { 52 int tm_sec; /* Seconds [0,60]. */ 53 int tm_min; /* Minutes [0,59]. */ 54 int tm_hour; /* Hour [0,23]. */ 55 int tm_mday; /* Day of month [1,31]. */ 56 int tm_mon; /* Month of year [0,11]. */ 57 int tm_year; /* Years since 1900. */ 58 int tm_wday; /* Day of week [0,6] (Sunday = 0). */ 59 int tm_yday; /* Day of year [0,365]. */ 60 int tm_isdst; /* Daylight Savings flag. */ 61 }; 47 62 48 63 struct timeval { … … 61 76 extern int tv_gteq(struct timeval *tv1, struct timeval *tv2); 62 77 extern int gettimeofday(struct timeval *tv, struct timezone *tz); 78 extern int getuptime(struct timeval *tv); 63 79 64 80 extern void udelay(useconds_t); 81 82 extern time_t mktime(struct tm *tm); 83 extern int time_utc2tm(const time_t time, struct tm *result); 84 extern int time_utc2str(const time_t time, char *buf); 85 extern void time_tm2str(const struct tm *timeptr, char *buf); 86 extern int time_local2tm(const time_t time, struct tm *result); 87 extern int time_local2str(const time_t time, char *buf); 88 extern double difftime(time_t time1, time_t time0); 89 extern size_t strftime(char *restrict s, size_t maxsize, 90 const char *restrict format, const struct tm *restrict tm); 65 91 66 92 #endif -
uspace/lib/c/include/sysinfo.h
rb5d2e57 r03362fbd 37 37 38 38 #include <sys/types.h> 39 #include < bool.h>39 #include <stdbool.h> 40 40 #include <abi/sysinfo.h> 41 41 -
uspace/lib/c/include/task.h
rb5d2e57 r03362fbd 38 38 #include <sys/types.h> 39 39 #include <abi/proc/task.h> 40 #include <stdarg.h> 40 41 41 42 typedef enum { … … 48 49 extern int task_kill(task_id_t); 49 50 50 extern task_id_t task_spawn(const char *, const char *const[], int *);51 51 extern int task_spawnv(task_id_t *, const char *path, const char *const []); 52 52 extern int task_spawnvf(task_id_t *, const char *path, const char *const [], 53 53 int *const []); 54 extern int task_spawn(task_id_t *, const char *path, int, va_list ap); 54 55 extern int task_spawnl(task_id_t *, const char *path, ...); 55 56
Note:
See TracChangeset
for help on using the changeset viewer.
