Changeset 9e9ced0 in mainline
- 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)
- Location:
- uspace
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/pci/pciintel/pci.c
ra86174ec r9e9ced0 738 738 739 739 if (pio_enable_resource(&bus->pio_win, 740 &hw_resources.resources[0], 741 (void **) &bus->conf_space)) {740 &hw_resources.resources[0], (void **) &bus->conf_space, 741 NULL)) { 742 742 ddf_msg(LVL_ERROR, 743 743 "Failed to map configuration space."); … … 759 759 760 760 if (pio_enable_resource(&bus->pio_win, 761 &hw_resources.resources[0], 762 (void **) &bus->conf_addr_reg)) {761 &hw_resources.resources[0], (void **) &bus->conf_addr_reg, 762 NULL)) { 763 763 ddf_msg(LVL_ERROR, 764 764 "Failed to enable configuration ports."); … … 767 767 } 768 768 if (pio_enable_resource(&bus->pio_win, 769 &hw_resources.resources[1], 770 (void **) &bus->conf_data_reg)) {769 &hw_resources.resources[1], (void **) &bus->conf_data_reg, 770 NULL)) { 771 771 ddf_msg(LVL_ERROR, 772 772 "Failed to enable configuration ports."); -
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 -
uspace/lib/c/include/ddi.h
ra86174ec r9e9ced0 64 64 65 65 extern errno_t pio_enable_range(addr_range_t *, void **); 66 extern errno_t pio_enable_resource(pio_window_t *, hw_resource_t *, void **); 66 extern errno_t pio_enable_resource(pio_window_t *, hw_resource_t *, void **, 67 size_t *); 67 68 extern errno_t pio_enable(void *, size_t, void **); 68 69 extern errno_t pio_disable(void *, size_t); -
uspace/lib/virtio/virtio-pci.c
ra86174ec r9e9ced0 143 143 144 144 rc = pio_enable_resource(&pio_window, &hw_res.resources[j], 145 &vdev->bar[i].mapped_base );145 &vdev->bar[i].mapped_base, NULL); 146 146 if (rc == EOK) 147 147 vdev->bar[i].mapped = true;
Note:
See TracChangeset
for help on using the changeset viewer.