*参照元 [#k14b590d] #backlinks *説明 [#tc0032f7] -パス: [[linux-4.4.1/drivers/staging/android/ion/ion_priv.h]] -FIXME: これは何? --ION ヒープから確保した ION バッファ --ION ヒープ: [[linux-4.4.1/ion_heap]] --バッファ確保: [[linux-4.4.1/ion_buffer_create()]] --バッファ解放: [[linux-4.4.1/ion_buffer_destroy()]] --[[linux-4.4.1/ion_heap]] **参考 [#cb8f9876] *実装 [#f17c5f19] /** * 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; - --[[linux-4.4.1/kref]] union { struct rb_node node; struct list_head list; }; - --[[linux-4.4.1/rb_node]] --[[linux-4.4.1/list_head]] struct ion_device *dev; struct ion_heap *heap; - --[[linux-4.4.1/ion_device]] --[[linux-4.4.1/ion_heap]] unsigned long flags; unsigned long private_flags; size_t size; union { void *priv_virt; ion_phys_addr_t priv_phys; }; - --[[linux-4.4.1/ion_phys_addr_t]] struct mutex lock; int kmap_cnt; void *vaddr; int dmap_cnt; - --[[linux-4.4.1/mutex]] struct sg_table *sg_table; struct page **pages; struct list_head vmas; - --[[linux-4.4.1/sg_table]] --[[linux-4.4.1/page]] --[[linux-4.4.1/list_head]] /* used to track orphaned buffers */ int handle_count; char task_comm[TASK_COMM_LEN]; pid_t pid; - --[[linux-4.4.1/pid_t]] }; *コメント [#t1b4e2a7]