Changeset 3e6ff9a in mainline for uspace/lib/usb/include/usb/dma_buffer.h
- Timestamp:
- 2018-02-01T14:28:41Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e67c50a
- Parents:
- 77ded647
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usb/include/usb/dma_buffer.h
r77ded647 r3e6ff9a 32 32 * @brief USB host controller library: DMA buffer helpers 33 33 * 34 * Simplifies usage of bounce buffers .34 * Simplifies usage of bounce buffers 35 35 * 36 36 * Currently the minimum size allocated is a page, which is wasteful. Could be … … 46 46 47 47 typedef 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 */ 50 52 } dma_policy_t; 51 53 … … 56 58 57 59 extern int dma_buffer_alloc(dma_buffer_t *db, size_t size); 58 extern int dma_buffer_alloc_policy(dma_buffer_t *, size_t, constdma_policy_t *);60 extern int dma_buffer_alloc_policy(dma_buffer_t *, size_t, dma_policy_t *); 59 61 extern void dma_buffer_free(dma_buffer_t *); 60 62 extern uintptr_t dma_buffer_phys(const dma_buffer_t *, void *); 63 64 extern bool dma_buffer_check_policy(const void *, size_t, dma_policy_t *); 61 65 62 66 static inline int dma_buffer_is_set(dma_buffer_t *db)
Note:
See TracChangeset
for help on using the changeset viewer.