Changeset 92232331 in mainline
- Timestamp:
- 2017-11-16T10:19:02Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9280dd0
- Parents:
- 19d2ce01
- git-author:
- Jiri Svoboda <jiri@…> (2017-11-15 22:17:43)
- git-committer:
- Jiri Svoboda <jiri@…> (2017-11-16 10:19:02)
- Location:
- uspace/drv/char/msim-con
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/char/msim-con/msim-con.c
r19d2ce01 r92232331 43 43 static void msim_con_connection(ipc_callid_t, ipc_call_t *, void *); 44 44 45 static irq_pio_range_t msim_ranges[] = { 46 { 47 .base = 0, 48 .size = 1 49 } 50 }; 51 52 static irq_cmd_t msim_cmds[] = { 45 static irq_cmd_t msim_cmds_proto[] = { 53 46 { 54 47 .cmd = CMD_PIO_READ_8, … … 59 52 .cmd = CMD_ACCEPT 60 53 } 61 };62 63 static irq_code_t msim_kbd = {64 sizeof(msim_ranges) / sizeof(irq_pio_range_t),65 msim_ranges,66 sizeof(msim_cmds) / sizeof(irq_cmd_t),67 msim_cmds68 54 }; 69 55 … … 87 73 ddf_fun_t *fun = NULL; 88 74 bool subscribed = false; 75 irq_cmd_t *msim_cmds = NULL; 89 76 int rc; 77 78 msim_cmds = malloc(sizeof(msim_cmds_proto)); 79 if (msim_cmds == NULL) { 80 rc = ENOMEM; 81 goto error; 82 } 90 83 91 84 con->res = *res; … … 100 93 ddf_fun_set_conn_handler(fun, msim_con_connection); 101 94 102 msim_ranges[0].base = res->base; 95 con->irq_range[0].base = res->base; 96 con->irq_range[0].size = 1; 97 98 memcpy(msim_cmds, msim_cmds_proto, sizeof(msim_cmds_proto)); 103 99 msim_cmds[0].addr = (void *) res->base; 104 async_irq_subscribe(res->irq, msim_irq_handler, con, &msim_kbd); 100 101 con->irq_code.rangecount = 1; 102 con->irq_code.ranges = con->irq_range; 103 con->irq_code.cmdcount = sizeof(msim_cmds_proto) / sizeof(irq_cmd_t); 104 con->irq_code.cmds = msim_cmds; 105 106 async_irq_subscribe(res->irq, msim_irq_handler, con, &con->irq_code); 105 107 subscribed = true; 106 108 … … 117 119 if (fun != NULL) 118 120 ddf_fun_destroy(fun); 121 free(msim_cmds); 119 122 120 123 return rc; -
uspace/drv/char/msim-con/msim-con.h
r19d2ce01 r92232331 52 52 ddf_dev_t *dev; 53 53 msim_con_res_t res; 54 irq_pio_range_t irq_range[1]; 55 irq_code_t irq_code; 54 56 } msim_con_t; 55 57
Note:
See TracChangeset
for help on using the changeset viewer.