linux-2.6.33/agp_allocate_memory()
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
*参照元 [#k0468d07]
#backlinks
*説明 [#kd36d210]
-パス: [[linux-2.6.33/drivers/char/agp/generic.c]]
-FIXME: これは何?
--説明
**引数 [#ffab187b]
-struct agp_bridge_data *bridge
--
--[[linux-2.6.33/agp_bridge_data]]
-size_t page_count
--
-u32 type
--
**返り値 [#nc6370ae]
-struct agp_memory *
--
--[[linux-2.6.33/agp_memory]]
**参考 [#l67c5b8c]
*実装 [#h22dd96a]
/**
* agp_allocate_memory - allocate a group of pages of ...
*
* @page_count: size_t argument of the number of pages
* @type: u32 argument of the type of memory to be alloc...
*
* Every agp bridge device will allow you to allocate AG...
* maps to physical ram. Any other type is device depen...
*
* It returns NULL whenever memory is unavailable.
*/
struct agp_memory *agp_allocate_memory(struct agp_bridge...
size_t page_count, u32 type)
{
int scratch_pages;
struct agp_memory *new;
size_t i;
if (!bridge)
return NULL;
if ((atomic_read(&bridge->current_memory_agp) + page_co...
return NULL;
-
--[[linux-2.6.33/atomic_read()]]
if (type >= AGP_USER_TYPES) {
new = agp_generic_alloc_user(page_count, type);
if (new)
new->bridge = bridge;
return new;
}
-
--[[linux-2.6.33/AGP_USER_TYPES]]
-
--[[linux-2.6.33/agp_generic_alloc_user()]]
if (type != 0) {
new = bridge->driver->alloc_by_type(page_count, type);
if (new)
new->bridge = bridge;
return new;
}
-bridge->driver は agp_bridge_driver 型のメンバ
--[[linux-2.6.33/agp_bridge_driver]]
scratch_pages = (page_count + ENTRIES_PER_PAGE - 1) / E...
new = agp_create_memory(scratch_pages);
if (new == NULL)
return NULL;
-
--[[linux-2.6.33/ENTRIES_PER_PAGE]]
-
--[[linux-2.6.33/agp_create_memory()]]
if (bridge->driver->agp_alloc_pages) {
if (bridge->driver->agp_alloc_pages(bridge, new, page_...
agp_free_memory(new);
return NULL;
}
new->bridge = bridge;
return new;
}
-
--[[linux-2.6.33/agp_free_memory()]]
for (i = 0; i < page_count; i++) {
struct page *page = bridge->driver->agp_alloc_page(bri...
if (page == NULL) {
agp_free_memory(new);
return NULL;
}
new->pages[i] = page;
new->page_count++;
}
new->bridge = bridge;
return new;
}
EXPORT_SYMBOL(agp_allocate_memory);
-モジュールのライセンスに関係なくシンボルを公開する。
--[[linux-2.6.33/EXPORT_SYMBOL()]]
*コメント [#j37f849e]
終了行:
*参照元 [#k0468d07]
#backlinks
*説明 [#kd36d210]
-パス: [[linux-2.6.33/drivers/char/agp/generic.c]]
-FIXME: これは何?
--説明
**引数 [#ffab187b]
-struct agp_bridge_data *bridge
--
--[[linux-2.6.33/agp_bridge_data]]
-size_t page_count
--
-u32 type
--
**返り値 [#nc6370ae]
-struct agp_memory *
--
--[[linux-2.6.33/agp_memory]]
**参考 [#l67c5b8c]
*実装 [#h22dd96a]
/**
* agp_allocate_memory - allocate a group of pages of ...
*
* @page_count: size_t argument of the number of pages
* @type: u32 argument of the type of memory to be alloc...
*
* Every agp bridge device will allow you to allocate AG...
* maps to physical ram. Any other type is device depen...
*
* It returns NULL whenever memory is unavailable.
*/
struct agp_memory *agp_allocate_memory(struct agp_bridge...
size_t page_count, u32 type)
{
int scratch_pages;
struct agp_memory *new;
size_t i;
if (!bridge)
return NULL;
if ((atomic_read(&bridge->current_memory_agp) + page_co...
return NULL;
-
--[[linux-2.6.33/atomic_read()]]
if (type >= AGP_USER_TYPES) {
new = agp_generic_alloc_user(page_count, type);
if (new)
new->bridge = bridge;
return new;
}
-
--[[linux-2.6.33/AGP_USER_TYPES]]
-
--[[linux-2.6.33/agp_generic_alloc_user()]]
if (type != 0) {
new = bridge->driver->alloc_by_type(page_count, type);
if (new)
new->bridge = bridge;
return new;
}
-bridge->driver は agp_bridge_driver 型のメンバ
--[[linux-2.6.33/agp_bridge_driver]]
scratch_pages = (page_count + ENTRIES_PER_PAGE - 1) / E...
new = agp_create_memory(scratch_pages);
if (new == NULL)
return NULL;
-
--[[linux-2.6.33/ENTRIES_PER_PAGE]]
-
--[[linux-2.6.33/agp_create_memory()]]
if (bridge->driver->agp_alloc_pages) {
if (bridge->driver->agp_alloc_pages(bridge, new, page_...
agp_free_memory(new);
return NULL;
}
new->bridge = bridge;
return new;
}
-
--[[linux-2.6.33/agp_free_memory()]]
for (i = 0; i < page_count; i++) {
struct page *page = bridge->driver->agp_alloc_page(bri...
if (page == NULL) {
agp_free_memory(new);
return NULL;
}
new->pages[i] = page;
new->page_count++;
}
new->bridge = bridge;
return new;
}
EXPORT_SYMBOL(agp_allocate_memory);
-モジュールのライセンスに関係なくシンボルを公開する。
--[[linux-2.6.33/EXPORT_SYMBOL()]]
*コメント [#j37f849e]
ページ名: