*参照元 [#cad365d3] #backlinks *説明 [#b1c9e4e4] -パス: [[linux-2.6.33/drivers/char/agp/generic.c]] -FIXME: これは何? --説明 **引数 [#mbd86e64] -size_t size -確保するメモリの大きさ(バイト単位) -struct agp_memory *mem --確保したメモリを返すために使う、AGP メモリ情報のポインタ。 --[[linux-2.6.33/agp_memory]] **返り値 [#bc2442f0] -なし **参考 [#i6a3be71] *実装 [#rdac7e92] /* * Use kmalloc if possible for the page list. Otherwise fall back to * vmalloc. This speeds things up and also saves memory for small AGP * regions. */ void agp_alloc_page_array(size_t size, struct agp_memory *mem) { mem->pages = NULL; mem->vmalloc_flag = false; if (size <= 2*PAGE_SIZE) mem->pages = kmalloc(size, GFP_KERNEL | __GFP_NORETRY); -確保したいメモリのサイズが 2ページ以下なら kmalloc() でメモリを確保する。 --[[linux-2.6.33/kmalloc()]] --[[linux-2.6.33/GFP_KERNEL]] --[[linux-2.6.33/__GFP_NORETRY]] if (mem->pages == NULL) { mem->pages = vmalloc(size); mem->vmalloc_flag = true; } -kmalloc() が失敗するか、確保したいメモリのサイズが 2ページより大きければ vmalloc() でメモリを確保する。 --[[linux-2.6.33/vmalloc()]] } EXPORT_SYMBOL(agp_alloc_page_array); -モジュールのライセンスに関係なくシンボルを公開する。 --[[linux-2.6.33/EXPORT_SYMBOL()]] *コメント [#a33c3b36]