Changeset ab936440 in mainline for uspace/drv/char/msim-con/msim-con.c
- Timestamp:
- 2019-02-12T20:42:42Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f31ca47
- Parents:
- 7f7817a9 (diff), 4805495 (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. - git-author:
- Matthieu Riolo <matthieu.riolo@…> (2019-02-12 20:26:18)
- git-committer:
- Matthieu Riolo <matthieu.riolo@…> (2019-02-12 20:42:42)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/char/msim-con/msim-con.c
r7f7817a9 rab936440 43 43 static void msim_con_connection(ipc_call_t *, void *); 44 44 45 static errno_t msim_con_read(chardev_srv_t *, void *, size_t, size_t *); 45 static errno_t msim_con_read(chardev_srv_t *, void *, size_t, size_t *, 46 chardev_flags_t); 46 47 static errno_t msim_con_write(chardev_srv_t *, const void *, size_t, size_t *); 47 48 … … 85 86 irq_cmd_t *msim_cmds = NULL; 86 87 errno_t rc; 88 bool bound = false; 87 89 88 90 circ_buf_init(&con->cbuf, con->buf, msim_con_buf_size, 1); … … 143 145 } 144 146 145 ddf_fun_add_to_category(fun, "console"); 147 bound = true; 148 149 rc = ddf_fun_add_to_category(fun, "console"); 150 if (rc != EOK) { 151 ddf_msg(LVL_ERROR, "Error adding function 'a' to category " 152 "'console'."); 153 goto error; 154 } 146 155 147 156 return EOK; … … 149 158 if (CAP_HANDLE_VALID(con->irq_handle)) 150 159 async_irq_unsubscribe(con->irq_handle); 160 if (bound) 161 ddf_fun_unbind(fun); 151 162 if (fun != NULL) 152 163 ddf_fun_destroy(fun); … … 175 186 /** Read from msim console device */ 176 187 static errno_t msim_con_read(chardev_srv_t *srv, void *buf, size_t size, 177 size_t *nread )188 size_t *nread, chardev_flags_t flags) 178 189 { 179 190 msim_con_t *con = (msim_con_t *) srv->srvs->sarg; … … 184 195 fibril_mutex_lock(&con->buf_lock); 185 196 186 while (circ_buf_nused(&con->cbuf) == 0) 197 while ((flags & chardev_f_nonblock) == 0 && 198 circ_buf_nused(&con->cbuf) == 0) 187 199 fibril_condvar_wait(&con->buf_cv, &con->buf_lock); 188 200
Note:
See TracChangeset
for help on using the changeset viewer.