参照元

説明

参考

実装

/**
 * struct ion_buffer - metadata for a particular buffer
 * @ref:                reference count
 * @node:               node in the ion_device buffers tree
 * @dev:                back pointer to the ion_device
 * @heap:               back pointer to the heap the buffer came from
 * @flags:              buffer specific flags
 * @private_flags:      internal buffer specific flags
 * @size:               size of the buffer
 * @priv_virt:          private data to the buffer representable as
 *                      a void *
 * @priv_phys:          private data to the buffer representable as
 *                      an ion_phys_addr_t (and someday a phys_addr_t)
 * @lock:               protects the buffers cnt fields
 * @kmap_cnt:           number of times the buffer is mapped to the kernel
 * @vaddr:              the kernel mapping if kmap_cnt is not zero
 * @dmap_cnt:           number of times the buffer is mapped for dma
 * @sg_table:           the sg table for the buffer if dmap_cnt is not zero
 * @pages:              flat array of pages in the buffer -- used by fault
 *                      handler and only valid for buffers that are faulted in
 * @vmas:               list of vma's mapping this buffer
 * @handle_count:       count of handles referencing this buffer
 * @task_comm:          taskcomm of last client to reference this buffer in a
 *                      handle, used for debugging
 * @pid:                pid of last client to reference this buffer in a
 *                      handle, used for debugging
*/
struct ion_buffer {
        struct kref ref;
        union {
                struct rb_node node;
                struct list_head list;
        };
        struct ion_device *dev;
        struct ion_heap *heap;
        unsigned long flags;
        unsigned long private_flags;
        size_t size;
        union {
                void *priv_virt;
                ion_phys_addr_t priv_phys;
        };
        struct mutex lock;
        int kmap_cnt;
        void *vaddr;
        int dmap_cnt;
        struct sg_table *sg_table;
        struct page **pages;
        struct list_head vmas;
        /* used to track orphaned buffers */
        int handle_count;
        char task_comm[TASK_COMM_LEN];
        pid_t pid;
};

コメント


トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS