注释此函数,struct page *agp_generic_alloc_page(struct agp_bridge_data *bridge) { struct page * page; page = alloc_page(GFP_KERNEL | GFP_DMA32 | __GFP_ZERO); if (page == NULL) return NULL; map_page_into_agp(page); get_page(page); atomic_inc(&agp_bridge->current_memory_agp); return page; }
时间: 2023-09-09 17:13:39 浏览: 98
/*
struct page *agp_generic_alloc_page(struct agp_bridge_data *bridge) {
// This function is used to allocate one page of memory for use by AGP.
// It allocates a page with GFP_KERNEL and GFP_DMA32 flags and zeroes it out.
// It then maps the page into the AGP aperture and increments the reference count.
// Finally, it returns a pointer to the allocated page.
struct page * page;
page = alloc_page(GFP_KERNEL | GFP_DMA32 | __GFP_ZERO);
if (page == NULL)
return NULL;
map_page_into_agp(page);
get_page(page);
atomic_inc(&agp_bridge->current_memory_agp);
return page;
}
*/
这段代码是用于在AGP中分配一个页面的函数。具体来说,它使用GFP_KERNEL和GFP_DMA32标志分配了一个页面,并将其清零。然后将页面映射到AGP孔中,并递增了页面的引用计数。最后,它返回指向分配的页面的指针。
为了注释掉这个函数,可以将整个函数体的代码用 /* 和 */ 包围起来,或者将函数名和花括号之间的代码删除。例如:
```
/*
struct page *agp_generic_alloc_page(struct agp_bridge_data *bridge) {
// This function is used to allocate one page of memory for use by AGP.
// It allocates a page with GFP_KERNEL and GFP_DMA32 flags and zeroes it out.
// It then maps the page into the AGP aperture and increments the reference count.
// Finally, it returns a pointer to the allocated page.
struct page * page;
page = alloc_page(GFP_KERNEL | GFP_DMA32 | __GFP_ZERO);
if (page == NULL)
return NULL;
map_page_into_agp(page);
get_page(page);
atomic_inc(&agp_bridge->current_memory_agp);
return page;
}
*/
```
阅读全文