linux-4.4.1/ion_device_add_heap()
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
*参照元 [#k81d1f25]
#backlinks
*説明 [#i5f89de1]
-パス: [[linux-4.4.1/drivers/staging/android/ion/ion.c]]
-FIXME: これは何?
--説明
**引数 [#x9ef103d]
-struct ion_device *dev
--
--[[linux-4.4.1/ion_device]]
-struct ion_heap *heap
--
--[[linux-4.4.1/ion_heap]]
**返り値 [#jfbb7f55]
-なし
**参考 [#u03a713f]
*実装 [#offc3eb2]
void ion_device_add_heap(struct ion_device *dev, struct ...
{
struct dentry *debug_file;
if (!heap->ops->allocate || !heap->ops->free || ...
!heap->ops->unmap_dma)
pr_err("%s: can not add heap with invali...
__func__);
-最低限必要な操作(allocate, free, map_dma, unmap_dma)を...
--heap->ops は struct ion_heap_ops * 型の変数
--[[linux-4.4.1/ion_heap_ops]]
--[[linux-4.4.1/pr_err()]]
spin_lock_init(&heap->free_lock);
heap->free_list_size = 0;
-
--[[linux-4.4.1/spin_lock_init()]]
if (heap->flags & ION_HEAP_FLAG_DEFER_FREE)
ion_heap_init_deferred_free(heap);
-
--[[linux-4.4.1/ION_HEAP_FLAG_DEFER_FREE]]
--[[linux-4.4.1/ion_heap_init_deferred_free()]]
if ((heap->flags & ION_HEAP_FLAG_DEFER_FREE) || ...
ion_heap_init_shrinker(heap);
-
--[[linux-4.4.1/ion_heap_init_shrinker()]]
heap->dev = dev;
down_write(&dev->lock);
-
--[[linux-4.4.1/down_write()]]
/*
* use negative heap->id to reverse the priority...
* the list later attempt higher id numbers first
*/
plist_node_init(&heap->node, -heap->id);
plist_add(&heap->node, &dev->heaps);
debug_file = debugfs_create_file(heap->name, 0664,
dev->heaps_debug...
&debug_heap_fops);
-
--[[linux-4.4.1/plist_node_init()]]
--[[linux-4.4.1/plist_add()]]
--[[linux-4.4.1/debugfs_create_file()]]
if (!debug_file) {
char buf[256], *path;
path = dentry_path(dev->heaps_debug_root...
pr_err("Failed to create heap debugfs at...
path, heap->name);
-
--[[linux-4.4.1/dentry_path()]]
}
if (heap->shrinker.count_objects && heap->shrink...
char debug_name[64];
snprintf(debug_name, 64, "%s_shrink", he...
debug_file = debugfs_create_file(
debug_name, 0644, dev->heaps_deb...
&debug_shrink_fops);
-
--[[linux-4.4.1/snprintf()]]
--[[linux-4.4.1/debugfs_create_file()]]
--[[linux-4.4.1/debug_shrink_fops(global)]]
if (!debug_file) {
char buf[256], *path;
path = dentry_path(dev->heaps_de...
pr_err("Failed to create heap sh...
path, debug_name);
-
--[[linux-4.4.1/dentry_path()]]
}
}
up_write(&dev->lock);
-
--[[linux-4.4.1/up_write()]]
}
EXPORT_SYMBOL(ion_device_add_heap);
-
--[[linux-4.4.1/EXPORT_SYMBOL()]]
*コメント [#w731c83a]
終了行:
*参照元 [#k81d1f25]
#backlinks
*説明 [#i5f89de1]
-パス: [[linux-4.4.1/drivers/staging/android/ion/ion.c]]
-FIXME: これは何?
--説明
**引数 [#x9ef103d]
-struct ion_device *dev
--
--[[linux-4.4.1/ion_device]]
-struct ion_heap *heap
--
--[[linux-4.4.1/ion_heap]]
**返り値 [#jfbb7f55]
-なし
**参考 [#u03a713f]
*実装 [#offc3eb2]
void ion_device_add_heap(struct ion_device *dev, struct ...
{
struct dentry *debug_file;
if (!heap->ops->allocate || !heap->ops->free || ...
!heap->ops->unmap_dma)
pr_err("%s: can not add heap with invali...
__func__);
-最低限必要な操作(allocate, free, map_dma, unmap_dma)を...
--heap->ops は struct ion_heap_ops * 型の変数
--[[linux-4.4.1/ion_heap_ops]]
--[[linux-4.4.1/pr_err()]]
spin_lock_init(&heap->free_lock);
heap->free_list_size = 0;
-
--[[linux-4.4.1/spin_lock_init()]]
if (heap->flags & ION_HEAP_FLAG_DEFER_FREE)
ion_heap_init_deferred_free(heap);
-
--[[linux-4.4.1/ION_HEAP_FLAG_DEFER_FREE]]
--[[linux-4.4.1/ion_heap_init_deferred_free()]]
if ((heap->flags & ION_HEAP_FLAG_DEFER_FREE) || ...
ion_heap_init_shrinker(heap);
-
--[[linux-4.4.1/ion_heap_init_shrinker()]]
heap->dev = dev;
down_write(&dev->lock);
-
--[[linux-4.4.1/down_write()]]
/*
* use negative heap->id to reverse the priority...
* the list later attempt higher id numbers first
*/
plist_node_init(&heap->node, -heap->id);
plist_add(&heap->node, &dev->heaps);
debug_file = debugfs_create_file(heap->name, 0664,
dev->heaps_debug...
&debug_heap_fops);
-
--[[linux-4.4.1/plist_node_init()]]
--[[linux-4.4.1/plist_add()]]
--[[linux-4.4.1/debugfs_create_file()]]
if (!debug_file) {
char buf[256], *path;
path = dentry_path(dev->heaps_debug_root...
pr_err("Failed to create heap debugfs at...
path, heap->name);
-
--[[linux-4.4.1/dentry_path()]]
}
if (heap->shrinker.count_objects && heap->shrink...
char debug_name[64];
snprintf(debug_name, 64, "%s_shrink", he...
debug_file = debugfs_create_file(
debug_name, 0644, dev->heaps_deb...
&debug_shrink_fops);
-
--[[linux-4.4.1/snprintf()]]
--[[linux-4.4.1/debugfs_create_file()]]
--[[linux-4.4.1/debug_shrink_fops(global)]]
if (!debug_file) {
char buf[256], *path;
path = dentry_path(dev->heaps_de...
pr_err("Failed to create heap sh...
path, debug_name);
-
--[[linux-4.4.1/dentry_path()]]
}
}
up_write(&dev->lock);
-
--[[linux-4.4.1/up_write()]]
}
EXPORT_SYMBOL(ion_device_add_heap);
-
--[[linux-4.4.1/EXPORT_SYMBOL()]]
*コメント [#w731c83a]
ページ名: