Changes in uspace/lib/c/generic/ddi.c [a69d42e:848e880f] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/ddi.c
ra69d42e r848e880f 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] phys If non-NULL, physical address of the resource 227 * @param[out] size If non-NULL, size of the enabled resource. 226 228 * 227 229 * @return EOK on success. … … 229 231 * 230 232 */ 231 errno_t pio_enable_resource(pio_window_t *win, hw_resource_t *res, void **virt) 233 errno_t pio_enable_resource(pio_window_t *win, hw_resource_t *res, void **virt, 234 uintptr_t *phys, size_t *size) 232 235 { 233 236 uintptr_t addr; 234 size_t s ize;237 size_t sz; 235 238 236 239 switch (res->type) { … … 242 245 addr += win->io.base; 243 246 } 244 s ize= res->res.io_range.size;247 sz = res->res.io_range.size; 245 248 break; 246 249 case MEM_RANGE: … … 251 254 addr += win->mem.base; 252 255 } 253 s ize= res->res.mem_range.size;256 sz = res->res.mem_range.size; 254 257 break; 255 258 default: … … 257 260 } 258 261 259 return pio_enable((void *) addr, size, virt); 262 if (phys) 263 *phys = addr; 264 if (size) 265 *size = sz; 266 267 return pio_enable((void *) addr, sz, virt); 260 268 } 261 269
Note:
See TracChangeset
for help on using the changeset viewer.