Changeset 9e9ced0 in mainline for uspace/lib/c/generic/ddi.c
- Timestamp:
- 2018-05-22T19:06:50Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d6c0016
- Parents:
- a86174ec
- git-author:
- Jakub Jermar <jakub@…> (2018-04-22 12:14:08)
- git-committer:
- Jakub Jermar <jakub@…> (2018-05-22 19:06:50)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/ddi.c
ra86174ec r9e9ced0 220 220 /** Enable PIO for specified HW resource wrt. to the PIO window. 221 221 * 222 * @param win PIO window. May be NULL if the resources are known to be 223 * absolute. 224 * @param res Resources specifying the I/O range wrt. to the PIO window. 225 * @param virt Virtual address for application's PIO operations. 222 * @param win PIO window. May be NULL if the resources are known to be 223 * absolute. 224 * @param res Resources specifying the I/O range wrt. to the PIO window. 225 * @param[out] virt Virtual address for application's PIO operations. 226 * @param[out] size If non-NULL, size of the enabled resource. 226 227 * 227 228 * @return EOK on success. … … 229 230 * 230 231 */ 231 errno_t pio_enable_resource(pio_window_t *win, hw_resource_t *res, void **virt) 232 errno_t pio_enable_resource(pio_window_t *win, hw_resource_t *res, void **virt, 233 size_t *size) 232 234 { 233 235 uintptr_t addr; 234 size_t s ize;236 size_t sz; 235 237 236 238 switch (res->type) { … … 242 244 addr += win->io.base; 243 245 } 244 s ize= res->res.io_range.size;246 sz = res->res.io_range.size; 245 247 break; 246 248 case MEM_RANGE: … … 251 253 addr += win->mem.base; 252 254 } 253 s ize= res->res.mem_range.size;255 sz = res->res.mem_range.size; 254 256 break; 255 257 default: … … 257 259 } 258 260 259 return pio_enable((void *) addr, size, virt); 261 if (size) 262 *size = sz; 263 264 return pio_enable((void *) addr, sz, virt); 260 265 } 261 266
Note:
See TracChangeset
for help on using the changeset viewer.