Changeset a35b458 in mainline for uspace/lib/c/include
- Timestamp:
- 2018-03-02T20:10:49Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f1380b7
- Parents:
- 3061bc1
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:38:31)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:10:49)
- Location:
- uspace/lib/c/include
- Files:
-
- 25 edited
-
adt/hash_table.h (modified) (1 diff)
-
adt/list.h (modified) (3 diffs)
-
as.h (modified) (1 diff)
-
async.h (modified) (2 diffs)
-
bitops.h (modified) (2 diffs)
-
device/hw_res.h (modified) (3 diffs)
-
device/hw_res_parsed.h (modified) (5 diffs)
-
fibril.h (modified) (1 diff)
-
fibril_synch.h (modified) (1 diff)
-
futex.h (modified) (5 diffs)
-
inet/addr.h (modified) (2 diffs)
-
io/charfield.h (modified) (2 diffs)
-
io/chargrid.h (modified) (1 diff)
-
io/console.h (modified) (1 diff)
-
io/kbd_event.h (modified) (1 diff)
-
io/keycode.h (modified) (3 diffs)
-
io/mode.h (modified) (1 diff)
-
io/pixelmap.h (modified) (4 diffs)
-
io/printf_core.h (modified) (1 diff)
-
ipc/devman.h (modified) (5 diffs)
-
ipc/graph.h (modified) (2 diffs)
-
ipc/output.h (modified) (1 diff)
-
ipc/vfs.h (modified) (1 diff)
-
loader/pcb.h (modified) (1 diff)
-
nic/nic.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/adt/hash_table.h
r3061bc1 ra35b458 51 51 /** Returns the hash of the key stored in the item (ie its lookup key). */ 52 52 size_t (*hash)(const ht_link_t *item); 53 53 54 54 /** Returns the hash of the key. */ 55 55 size_t (*key_hash)(void *key); 56 56 57 57 /** True if the items are equal (have the same lookup keys). */ 58 58 bool (*equal)(const ht_link_t *item1, const ht_link_t *item2); -
uspace/lib/c/include/adt/list.h
r3061bc1 ra35b458 231 231 link->prev->next = link->next; 232 232 } 233 233 234 234 link_initialize(link); 235 235 } … … 314 314 part1->prev->next = part2; 315 315 part2->prev->next = part1; 316 316 317 317 link_t *hlp = part1->prev; 318 318 319 319 part1->prev = part2->prev; 320 320 part2->prev = hlp; … … 378 378 { 379 379 unsigned long cnt = 0; 380 380 381 381 link_t *link = list_first(list); 382 382 while (link != NULL) { 383 383 if (cnt == n) 384 384 return link; 385 385 386 386 cnt++; 387 387 link = list_next(link, list); 388 388 } 389 389 390 390 return NULL; 391 391 } -
uspace/lib/c/include/as.h
r3061bc1 ra35b458 46 46 if (size == 0) 47 47 return 0; 48 48 49 49 return (size_t) ((size - 1) >> PAGE_WIDTH) + 1; 50 50 } -
uspace/lib/c/include/async.h
r3061bc1 ra35b458 82 82 */ 83 83 EXCHANGE_ATOMIC = 0, 84 84 85 85 /** Exchange management via mutual exclusion 86 86 * … … 90 90 */ 91 91 EXCHANGE_SERIALIZE = 1, 92 92 93 93 /** Exchange management via phone cloning 94 94 * -
uspace/lib/c/include/bitops.h
r3061bc1 ra35b458 66 66 { 67 67 unsigned int n = 0; 68 68 69 69 if (arg >> 16) { 70 70 arg >>= 16; 71 71 n += 16; 72 72 } 73 73 74 74 if (arg >> 8) { 75 75 arg >>= 8; 76 76 n += 8; 77 77 } 78 78 79 79 if (arg >> 4) { 80 80 arg >>= 4; 81 81 n += 4; 82 82 } 83 83 84 84 if (arg >> 2) { 85 85 arg >>= 2; 86 86 n += 2; 87 87 } 88 88 89 89 if (arg >> 1) { 90 90 arg >>= 1; 91 91 n += 1; 92 92 } 93 93 94 94 return n; 95 95 } … … 98 98 { 99 99 unsigned int n = 0; 100 100 101 101 if (arg >> 32) { 102 102 arg >>= 32; 103 103 n += 32; 104 104 } 105 105 106 106 return (n + fnzb32((uint32_t) arg)); 107 107 } -
uspace/lib/c/include/device/hw_res.h
r3061bc1 ra35b458 82 82 endianness_t endianness; 83 83 } mem_range; 84 84 85 85 struct { 86 86 uint64_t address; … … 89 89 endianness_t endianness; 90 90 } io_range; 91 91 92 92 struct { 93 93 int irq; 94 94 } interrupt; 95 95 96 96 union { 97 97 unsigned int dma8; … … 112 112 hw_res->resources = NULL; 113 113 } 114 114 115 115 hw_res->count = 0; 116 116 } -
uspace/lib/c/include/device/hw_res_parsed.h
r3061bc1 ra35b458 64 64 /** Start address */ 65 65 address64_t address; 66 66 67 67 /** Area size */ 68 68 size_t size; … … 82 82 /** Irq count */ 83 83 size_t count; 84 84 85 85 /** Array of IRQs */ 86 86 int *irqs; … … 100 100 /** Areas count */ 101 101 size_t count; 102 102 103 103 /** Array of areas */ 104 104 addr_range_t *ranges; … … 115 115 /** List of IRQs */ 116 116 irq_list_t irqs; 117 117 118 118 /** List of DMA channels */ 119 119 dma_list_t dma_channels; 120 120 121 121 /** List of memory areas */ 122 122 mem_range_list_t mem_ranges; 123 123 124 124 /** List of IO areas */ 125 125 io_range_list_t io_ranges; … … 136 136 if (list == NULL) 137 137 return; 138 138 139 139 free(list->irqs.irqs); 140 140 free(list->io_ranges.ranges); 141 141 free(list->mem_ranges.ranges); 142 142 free(list->dma_channels.channels); 143 143 144 144 memset(list, 0, sizeof(hw_res_list_parsed_t)); 145 145 } -
uspace/lib/c/include/fibril.h
r3061bc1 ra35b458 73 73 errno_t (*func)(void *); 74 74 tcb_t *tcb; 75 75 76 76 struct fibril *clean_after_me; 77 77 errno_t retval; 78 78 int flags; 79 79 80 80 fibril_owner_info_t *waits_for; 81 81 -
uspace/lib/c/include/fibril_synch.h
r3061bc1 ra35b458 61 61 } \ 62 62 } 63 63 64 64 #define FIBRIL_MUTEX_INITIALIZE(name) \ 65 65 fibril_mutex_t name = FIBRIL_MUTEX_INITIALIZER(name) -
uspace/lib/c/include/futex.h
r3061bc1 ra35b458 80 80 } \ 81 81 }) 82 82 83 83 #define futex_unlock(fut) \ 84 84 ({ \ … … 91 91 92 92 extern void futex_upgrade_all_and_wait(void); 93 93 94 94 #else 95 95 … … 99 99 #define futex_trylock(fut) futex_trydown((fut)) 100 100 #define futex_unlock(fut) (void) futex_up((fut)) 101 101 102 102 #endif 103 103 … … 130 130 if ((atomic_signed_t) atomic_predec(&futex->val) < 0) 131 131 return (errno_t) __SYSCALL1(SYS_FUTEX_SLEEP, (sysarg_t) &futex->val.count); 132 132 133 133 return EOK; 134 134 } … … 147 147 if ((atomic_signed_t) atomic_postinc(&futex->val) < 0) 148 148 return (errno_t) __SYSCALL1(SYS_FUTEX_WAKEUP, (sysarg_t) &futex->val.count); 149 149 150 150 return EOK; 151 151 } -
uspace/lib/c/include/inet/addr.h
r3061bc1 ra35b458 66 66 /** IP version */ 67 67 ip_ver_t version; 68 68 69 69 /** Address */ 70 70 union { … … 72 72 addr128_t addr6; 73 73 }; 74 74 75 75 /** Number of valid bits */ 76 76 uint8_t prefix; -
uspace/lib/c/include/io/charfield.h
r3061bc1 ra35b458 86 86 if (a1.type != a2.type) 87 87 return false; 88 88 89 89 switch (a1.type) { 90 90 case CHAR_ATTR_STYLE: … … 98 98 && (a1.val.rgb.fgcolor == a2.val.rgb.fgcolor); 99 99 } 100 100 101 101 return false; 102 102 } -
uspace/lib/c/include/io/chargrid.h
r3061bc1 ra35b458 49 49 size_t size; /**< Structure size */ 50 50 chargrid_flag_t flags; /**< Screenbuffer flags */ 51 51 52 52 sysarg_t cols; /**< Number of columns */ 53 53 sysarg_t rows; /**< Number of rows */ 54 54 55 55 sysarg_t col; /**< Current column */ 56 56 sysarg_t row; /**< Current row */ 57 57 bool cursor_visible; /**< Cursor visibility */ 58 58 59 59 char_attrs_t attrs; /**< Current attributes */ 60 60 61 61 sysarg_t top_row; /**< The first row in the cyclic buffer */ 62 62 charfield_t data[]; /**< Screen contents (cyclic buffer) */ -
uspace/lib/c/include/io/console.h
r3061bc1 ra35b458 49 49 /** Console input file */ 50 50 FILE *input; 51 51 52 52 /** Console output file */ 53 53 FILE *output; 54 54 55 55 /** Console input session */ 56 56 async_sess_t *input_sess; 57 57 58 58 /** Console output session */ 59 59 async_sess_t *output_sess; 60 60 61 61 /** Input request call with timeout */ 62 62 ipc_call_t input_call; 63 63 64 64 /** Input response with timeout */ 65 65 aid_t input_aid; -
uspace/lib/c/include/io/kbd_event.h
r3061bc1 ra35b458 48 48 /** List handle */ 49 49 link_t link; 50 50 51 51 /** Press or release event. */ 52 52 kbd_event_type_t type; 53 53 54 54 /** Keycode of the key that was pressed or released. */ 55 55 keycode_t key; 56 56 57 57 /** Bitmask of modifiers held. */ 58 58 keymod_t mods; 59 59 60 60 /** The character that was generated or '\0' for none. */ 61 61 wchar_t c; -
uspace/lib/c/include/io/keycode.h
r3061bc1 ra35b458 93 93 94 94 KC_CAPS_LOCK, 95 95 96 96 KC_A, 97 97 KC_S, … … 199 199 KC_N0, 200 200 KC_NPERIOD 201 201 202 202 } keycode_t; 203 203 … … 212 212 KM_NUM_LOCK = 0x080, 213 213 KM_SCROLL_LOCK = 0x100, 214 214 215 215 KM_SHIFT = KM_LSHIFT | KM_RSHIFT, 216 216 KM_CTRL = KM_LCTRL | KM_RCTRL, -
uspace/lib/c/include/io/mode.h
r3061bc1 ra35b458 55 55 sysarg_t index; 56 56 sysarg_t version; 57 57 58 58 sysarg_t refresh_rate; 59 59 aspect_ratio_t screen_aspect; 60 60 sysarg_t screen_width; 61 61 sysarg_t screen_height; 62 62 63 63 aspect_ratio_t cell_aspect; 64 64 cell_visual_t cell_visual; -
uspace/lib/c/include/io/pixelmap.h
r3061bc1 ra35b458 47 47 /* Pixels outside of a pixmap are PIXEL(0, 0, 0, 0) */ 48 48 PIXELMAP_EXTEND_TRANSPARENT_BLACK = 0, 49 49 50 50 /* The pixmap is repeated infinetely */ 51 51 PIXELMAP_EXTEND_TILE, 52 52 53 53 /* If outside of a pixmap, return closest pixel from the edge */ 54 54 PIXELMAP_EXTEND_SIDES, 55 55 56 56 /* If outside of a pixmap, return closest pixel from the edge, 57 57 * with alpha = 0 … … 125 125 transparent = transparent_outside; 126 126 } 127 127 128 128 if (y < 0) { 129 129 y = 0; … … 135 135 } 136 136 } 137 137 138 138 if (x < 0 || ((sysarg_t) x) >= pixmap->width || 139 139 y < 0 || ((sysarg_t) y) >= pixmap->height) … … 141 141 142 142 pixel_t pixel = pixelmap_get_pixel(pixmap, x, y); 143 143 144 144 if (transparent) 145 145 pixel = PIXEL(0, RED(pixel), GREEN(pixel), BLUE(pixel)); 146 146 147 147 return pixel; 148 148 } -
uspace/lib/c/include/io/printf_core.h
r3061bc1 ra35b458 43 43 /* String output function, returns number of printed characters or EOF */ 44 44 int (*str_write)(const char *, size_t, void *); 45 45 46 46 /* Wide string output function, returns number of printed characters or EOF */ 47 47 int (*wstr_write)(const wchar_t *, size_t, void *); 48 48 49 49 /* User data - output stream specification, state, locks, etc. */ 50 50 void *data; -
uspace/lib/c/include/ipc/devman.h
r3061bc1 ra35b458 46 46 /** Driver has not been started. */ 47 47 DRIVER_NOT_STARTED = 0, 48 48 49 49 /** 50 50 * Driver has been started, but has not registered as running and ready … … 52 52 */ 53 53 DRIVER_STARTING, 54 54 55 55 /** Driver is running and prepared to serve incomming requests. */ 56 56 DRIVER_RUNNING … … 110 110 match_id_t *mid = NULL; 111 111 link_t *link = ids->ids.head.next; 112 112 113 113 while (link != &ids->ids.head) { 114 114 mid = list_get_instance(link, match_id_t,link); … … 118 118 link = link->next; 119 119 } 120 120 121 121 list_insert_before(&id->link, link); 122 122 } … … 131 131 link_t *link = NULL; 132 132 match_id_t *id; 133 133 134 134 while (!list_empty(&ids->ids)) { 135 135 link = list_first(&ids->ids); -
uspace/lib/c/include/ipc/graph.h
r3061bc1 ra35b458 41 41 VISUALIZER_CLAIM = IPC_FIRST_USER_METHOD, 42 42 VISUALIZER_YIELD, 43 43 44 44 VISUALIZER_ENUMERATE_MODES, 45 45 VISUALIZER_GET_DEFAULT_MODE, … … 47 47 VISUALIZER_GET_MODE, 48 48 VISUALIZER_SET_MODE, 49 49 50 50 VISUALIZER_UPDATE_DAMAGED_REGION, 51 51 52 52 VISUALIZER_SUSPEND, 53 53 VISUALIZER_WAKE_UP, -
uspace/lib/c/include/ipc/output.h
r3061bc1 ra35b458 45 45 OUTPUT_GET_DIMENSIONS, 46 46 OUTPUT_GET_CAPS, 47 47 48 48 OUTPUT_FRONTBUF_CREATE, 49 49 OUTPUT_FRONTBUF_DESTROY, 50 50 51 51 OUTPUT_CURSOR_UPDATE, 52 52 OUTPUT_SET_STYLE, 53 53 OUTPUT_SET_COLOR, 54 54 OUTPUT_SET_RGB_COLOR, 55 55 56 56 OUTPUT_UPDATE, 57 57 OUTPUT_DAMAGE -
uspace/lib/c/include/ipc/vfs.h
r3061bc1 ra35b458 170 170 WALK_MAY_CREATE = (1 << 0), 171 171 WALK_MUST_CREATE = (1 << 1), 172 172 173 173 WALK_REGULAR = (1 << 2), 174 174 WALK_DIRECTORY = (1 << 3), 175 175 WALK_MOUNT_POINT = (1 << 4), 176 176 177 177 WALK_ALL_FLAGS = WALK_MAY_CREATE | WALK_MUST_CREATE | WALK_REGULAR | 178 178 WALK_DIRECTORY | WALK_MOUNT_POINT, -
uspace/lib/c/include/loader/pcb.h
r3061bc1 ra35b458 55 55 /** Program entry point. */ 56 56 entry_point_t entry; 57 57 58 58 /** Current working directory. */ 59 59 char *cwd; 60 60 61 61 /** Number of command-line arguments. */ 62 62 int argc; 63 63 /** Command-line arguments. */ 64 64 char **argv; 65 65 66 66 /** List of inbox files. */ 67 67 struct pcb_inbox_entry *inbox; 68 68 int inbox_entries; 69 69 70 70 /* 71 71 * ELF-specific data. 72 72 */ 73 73 74 74 /** Pointer to ELF dynamic section of the program. */ 75 75 void *dynamic; -
uspace/lib/c/include/nic/nic.h
r3061bc1 ra35b458 218 218 219 219 /* for cslip etc */ 220 220 221 221 /** Total compressed packets received. */ 222 222 unsigned long receive_compressed;
Note:
See TracChangeset
for help on using the changeset viewer.
