快乐虾
http://blog.csdn.net/lights_joy/
本文适用于
ADI bf561 DSP
优视BF561EVB开发板
uclinux-2008r1-rc8 (移植到vdsp5)
Visual DSP++ 5.0
欢迎转载,但请保留作者信息
在VDSP下编译mm/filemap.c时,发生了一个VDSP编译器错误:
../../mm/filemap.c
At end of source: : internal error: Uncaught exception Assertion failed raised
at ../../../bril/optimiser/dominators.c:910 (in pass
cleanup_scalar_stores_nonopt during compilation of
_find_or_create_page). Please submit a bug report with this message,
the command line used, type of machine and the output of the
compiler when you add -ED -v to the command line. Please also send
us the pre-processed file that is generated by the -ED option (the
file generated is named <original_filename>.i)
1 catastrophic error detected in the compilation of "../../mm/filemap.c".
Compilation aborted.
cc3089: fatal error: Compilation failed
又是和优化相关的错误!
因为刚修改了find_or_create_page函数,直接在此函数中进一步排查,错误发生在下面这一行:
cached_page =
__page_cache_alloc(gfp_mask);
在这里cached_page是一个局部变量,而__page_cache_alloc则是一个内联函数:
static
inline struct page *__page_cache_alloc(gfp_t gfp)
{
return alloc_pages(gfp, 0);
}
而alloc_pages是一个宏定义:
#define
alloc_pages(gfp_mask, order) /
alloc_pages_node(numa_node_id(), gfp_mask, order)
调用
alloc_pages_node函数:
static
inline struct page *alloc_pages_node(int nid, gfp_t gfp_mask,
unsigned int order)
{
if (unlikely(order >= MAX_ORDER))
return NULL;
/* Unknown node is current node */
if (nid < 0)
nid = numa_node_id();
return __alloc_pages(gfp_mask, order,
NODE_DATA(nid)->node_zonelists + gfp_zone(gfp_mask));
}
不知道是不是连续两个inline的调用造成了VDSP编译的成败?
从这一系列的调用过程可以看出,实际最后使用的是
__alloc_pages函数,调用此函数时order参数为0。且由于不可能使用NUMA,因此nid实际为0。
因此直接将find_or_create_page函数中的调用改为:
cached_page = __alloc_pages(gfp_mask, 0,
NODE_DATA(0)->node_zonelists + gfp_zone(gfp_mask));
搞定!