Ignore:
Timestamp:
2018-02-12T10:11:47Z (7 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5fe3f954
Parents:
2f762a7
git-author:
Ondřej Hlavatý <aearsis@…> (2018-02-05 03:28:50)
git-committer:
Ondřej Hlavatý <aearsis@…> (2018-02-12 10:11:47)
Message:

usb: rethinking DMA buffers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/drv/generic/remote_usbhc.c

    r2f762a7 r1d758fc  
    210210                        ? AS_AREA_WRITE : AS_AREA_READ;
    211211
    212                 const errno_t ret = async_share_out_start(exch, req->base, flags);
     212                const errno_t ret = async_share_out_start(exch, req->buffer.virt, flags);
    213213                if (ret != EOK) {
    214214                        async_forget(opening_request);
     
    374374                return;
    375375        }
    376         if (trans->request.base != NULL) {
    377                 as_area_destroy(trans->request.base);
     376        if (trans->request.buffer.virt != NULL) {
     377                as_area_destroy(trans->request.buffer.virt);
    378378        }
    379379
     
    422422        }
    423423
    424         if ((err = async_share_out_finalize(data_callid, &trans->request.base)))
     424        if ((err = async_share_out_finalize(data_callid, &trans->request.buffer.virt)))
    425425                return err;
    426426
    427427        /*
    428          * As we're going to check the mapping, we must make sure the memory is
    429          * actually mapped. We must do it right now, because the area might be
    430          * read-only or write-only, and we may be unsure later.
     428         * As we're going to get physical addresses of the mapping, we must make
     429         * sure the memory is actually mapped. We must do it right now, because
     430         * the area might be read-only or write-only, and we may be unsure
     431         * later.
    431432         */
    432433        if (flags & AS_AREA_READ) {
    433434                char foo = 0;
    434                 volatile const char *buf = trans->request.base + trans->request.offset;
     435                volatile const char *buf = trans->request.buffer.virt + trans->request.offset;
    435436                for (size_t i = 0; i < size; i += PAGE_SIZE)
    436437                        foo += buf[i];
    437438        } else {
    438                 volatile char *buf = trans->request.base + trans->request.offset;
     439                volatile char *buf = trans->request.buffer.virt + trans->request.offset;
    439440                for (size_t i = 0; i < size; i += PAGE_SIZE)
    440441                        buf[i] = 0xff;
     
    482483        } else {
    483484                /* The value was valid on the other side, for us, its garbage. */
    484                 trans->request.base = NULL;
     485                trans->request.buffer.virt = NULL;
    485486        }
    486487
Note: See TracChangeset for help on using the changeset viewer.