Changeset 432a269 in mainline for uspace/lib/c/generic
- Timestamp:
- 2011-09-16T21:13:57Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3a11f17
- Parents:
- c0e53ff (diff), fd07e526 (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/generic
- Files:
-
- 1 added
- 2 deleted
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/adt/hash_table.c
rc0e53ff r432a269 152 152 153 153 if (keys == h->max_keys) { 154 link_t *cur;155 156 154 /* 157 155 * All keys are known, hash_table_find() can be used to find the … … 159 157 */ 160 158 161 cur = hash_table_find(h, key);159 link_t *cur = hash_table_find(h, key); 162 160 if (cur) { 163 161 list_remove(cur); … … 174 172 hash_index_t chain; 175 173 for (chain = 0; chain < h->entries; chain++) { 176 link_t *cur; 177 178 for (cur = h->entry[chain].head.next; cur != &h->entry[chain].head; 174 for (link_t *cur = h->entry[chain].head.next; 175 cur != &h->entry[chain].head; 179 176 cur = cur->next) { 180 177 if (h->op->compare(key, keys, cur)) { -
uspace/lib/c/generic/adt/list.c
rc0e53ff r432a269 50 50 * @param list List to look in. 51 51 * 52 * @return true if link is contained in head, false otherwise.52 * @return true if link is contained in list, false otherwise. 53 53 * 54 54 */ -
uspace/lib/c/generic/as.c
rc0e53ff r432a269 123 123 * @retval ENOENT Mapping not found. 124 124 */ 125 int as_get_physical_mapping( void *address, uintptr_t *frame)125 int as_get_physical_mapping(const void *address, uintptr_t *frame) 126 126 { 127 127 uintptr_t tmp_frame; -
uspace/lib/c/generic/async.c
rc0e53ff r432a269 118 118 #define CONN_HASH_TABLE_BUCKETS 32 119 119 120 /** Session data */ 121 struct async_sess { 122 /** List of inactive exchanges */ 123 list_t exch_list; 124 125 /** Exchange management style */ 126 exch_mgmt_t mgmt; 127 128 /** Session identification */ 129 int phone; 130 131 /** First clone connection argument */ 132 sysarg_t arg1; 133 134 /** Second clone connection argument */ 135 sysarg_t arg2; 136 137 /** Third clone connection argument */ 138 sysarg_t arg3; 139 140 /** Exchange mutex */ 141 fibril_mutex_t mutex; 142 143 /** Number of opened exchanges */ 144 atomic_t refcnt; 145 146 /** Mutex for stateful connections */ 147 fibril_mutex_t remote_state_mtx; 148 149 /** Data for stateful connections */ 150 void *remote_state_data; 151 }; 152 153 /** Exchange data */ 154 struct async_exch { 155 /** Link into list of inactive exchanges */ 156 link_t sess_link; 157 158 /** Link into global list of inactive exchanges */ 159 link_t global_link; 160 161 /** Session pointer */ 162 async_sess_t *sess; 163 164 /** Exchange identification */ 165 int phone; 166 }; 167 120 168 /** Async framework global futex */ 121 169 atomic_t async_futex = FUTEX_INITIALIZER; … … 134 182 ipc_call_t call; 135 183 } msg_t; 184 185 /** Message data */ 186 typedef struct { 187 awaiter_t wdata; 188 189 /** If reply was received. */ 190 bool done; 191 192 /** Pointer to where the answer data is stored. */ 193 ipc_call_t *dataptr; 194 195 sysarg_t retval; 196 } amsg_t; 136 197 137 198 /* Client connection data */ -
uspace/lib/c/generic/io/console.c
rc0e53ff r432a269 87 87 { 88 88 async_exch_t *exch = async_exchange_begin(ctrl->output_sess); 89 async_ msg_0(exch, CONSOLE_CLEAR);89 async_req_0_0(exch, CONSOLE_CLEAR); 90 90 async_exchange_end(exch); 91 91 } … … 103 103 { 104 104 async_exch_t *exch = async_exchange_begin(ctrl->output_sess); 105 async_ msg_1(exch, CONSOLE_SET_STYLE, style);106 async_exchange_end(exch); 107 } 108 109 void console_set_color(console_ctrl_t *ctrl, uint8_t fg_color, uint8_t bg_color,105 async_req_1_0(exch, CONSOLE_SET_STYLE, style); 106 async_exchange_end(exch); 107 } 108 109 void console_set_color(console_ctrl_t *ctrl, uint8_t bgcolor, uint8_t fgcolor, 110 110 uint8_t flags) 111 111 { 112 112 async_exch_t *exch = async_exchange_begin(ctrl->output_sess); 113 async_ msg_3(exch, CONSOLE_SET_COLOR, fg_color, bg_color, flags);114 async_exchange_end(exch); 115 } 116 117 void console_set_rgb_color(console_ctrl_t *ctrl, uint32_t fg_color,118 uint32_t bg_color)119 { 120 async_exch_t *exch = async_exchange_begin(ctrl->output_sess); 121 async_ msg_2(exch, CONSOLE_SET_RGB_COLOR, fg_color, bg_color);113 async_req_3_0(exch, CONSOLE_SET_COLOR, bgcolor, fgcolor, flags); 114 async_exchange_end(exch); 115 } 116 117 void console_set_rgb_color(console_ctrl_t *ctrl, uint32_t bgcolor, 118 uint32_t fgcolor) 119 { 120 async_exch_t *exch = async_exchange_begin(ctrl->output_sess); 121 async_req_2_0(exch, CONSOLE_SET_RGB_COLOR, bgcolor, fgcolor); 122 122 async_exchange_end(exch); 123 123 } … … 126 126 { 127 127 async_exch_t *exch = async_exchange_begin(ctrl->output_sess); 128 async_ msg_1(exch, CONSOLE_CURSOR_VISIBILITY, (show != false));128 async_req_1_0(exch, CONSOLE_CURSOR_VISIBILITY, (show != false)); 129 129 async_exchange_end(exch); 130 130 } … … 151 151 { 152 152 async_exch_t *exch = async_exchange_begin(ctrl->output_sess); 153 async_ msg_2(exch, CONSOLE_GOTO, col, row);153 async_req_2_0(exch, CONSOLE_GOTO, col, row); 154 154 async_exchange_end(exch); 155 155 } -
uspace/lib/c/generic/io/io.c
rc0e53ff r432a269 418 418 419 419 bytes_used = stream->buf_head - stream->buf_tail; 420 if (bytes_used == 0)421 return;422 420 423 421 /* If buffer has prefetched read data, we need to seek back. */ 424 if ( stream->buf_state == _bs_read)422 if (bytes_used > 0 && stream->buf_state == _bs_read) 425 423 lseek(stream->fd, - (ssize_t) bytes_used, SEEK_CUR); 426 424 427 425 /* If buffer has unwritten data, we need to write them out. */ 428 if ( stream->buf_state == _bs_write)426 if (bytes_used > 0 && stream->buf_state == _bs_write) 429 427 (void) _fwrite(stream->buf_tail, 1, bytes_used, stream); 430 428 -
uspace/lib/c/generic/private/async.h
rc0e53ff r432a269 43 43 #include <bool.h> 44 44 45 /** Session data */46 struct _async_sess {47 /** List of inactive exchanges */48 list_t exch_list;49 50 /** Exchange management style */51 exch_mgmt_t mgmt;52 53 /** Session identification */54 int phone;55 56 /** First clone connection argument */57 sysarg_t arg1;58 59 /** Second clone connection argument */60 sysarg_t arg2;61 62 /** Third clone connection argument */63 sysarg_t arg3;64 65 /** Exchange mutex */66 fibril_mutex_t mutex;67 68 /** Number of opened exchanges */69 atomic_t refcnt;70 71 /** Mutex for stateful connections */72 fibril_mutex_t remote_state_mtx;73 74 /** Data for stateful connections */75 void *remote_state_data;76 };77 78 /** Exchange data */79 struct _async_exch {80 /** Link into list of inactive exchanges */81 link_t sess_link;82 83 /** Link into global list of inactive exchanges */84 link_t global_link;85 86 /** Session pointer */87 async_sess_t *sess;88 89 /** Exchange identification */90 int phone;91 };92 93 45 /** Structures of this type are used to track the timeout events. */ 94 46 typedef struct { … … 129 81 } awaiter_t; 130 82 131 /** Message data */132 typedef struct {133 awaiter_t wdata;134 135 /** If reply was received. */136 bool done;137 138 /** Pointer to where the answer data is stored. */139 ipc_call_t *dataptr;140 141 sysarg_t retval;142 } amsg_t;143 144 83 extern void __async_init(void); 145 84 extern void async_insert_timeout(awaiter_t *); -
uspace/lib/c/generic/vfs/vfs.c
rc0e53ff r432a269 654 654 async_exch_t *exch = vfs_exchange_begin(); 655 655 656 req = async_send_ 0(exch, VFS_IN_UNLINK, NULL);656 req = async_send_1(exch, VFS_IN_UNLINK, lflag, NULL); 657 657 rc = async_data_write_start(exch, pa, pa_size); 658 658 if (rc != EOK) {
Note:
See TracChangeset
for help on using the changeset viewer.