Ignore:
Timestamp:
2018-02-01T14:28:41Z (6 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e67c50a
Parents:
77ded647
Message:

usb: dma_buffer check policy function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usb/include/usb/dma_buffer.h

    r77ded647 r3e6ff9a  
    3232 * @brief USB host controller library: DMA buffer helpers
    3333 *
    34  * Simplifies usage of bounce buffers.
     34 * Simplifies usage of bounce buffers
    3535 *
    3636 * Currently the minimum size allocated is a page, which is wasteful. Could be
     
    4646
    4747typedef const struct dma_policy {
    48         bool use64;             /**< Whether to use more than initial 4GiB of memory */
    49         size_t alignment;       /**< What alignment is needed. At most PAGE_SIZE. */
     48        unsigned flags;
     49
     50#define DMA_POLICY_F_4GiB       (1<<0)  /**< Must use only 32-bit addresses */
     51#define DMA_POLICY_F_CONTIGUOUS (1<<1)  /**< Pages must follow each other physically */
    5052} dma_policy_t;
    5153
     
    5658
    5759extern int dma_buffer_alloc(dma_buffer_t *db, size_t size);
    58 extern int dma_buffer_alloc_policy(dma_buffer_t *, size_t, const dma_policy_t *);
     60extern int dma_buffer_alloc_policy(dma_buffer_t *, size_t, dma_policy_t *);
    5961extern void dma_buffer_free(dma_buffer_t *);
    6062extern uintptr_t dma_buffer_phys(const dma_buffer_t *, void *);
     63
     64extern bool dma_buffer_check_policy(const void *, size_t, dma_policy_t *);
    6165
    6266static inline int dma_buffer_is_set(dma_buffer_t *db)
Note: See TracChangeset for help on using the changeset viewer.