uclinux-2008R1-RC8(bf561)到VDSP5的移植(56): __grab_cache_page

 
快乐虾
http://blog.csdn.net/lights_joy/
lights@hb165.com
 
  
本文适用于
ADI bf561 DSP
uclinux-2008r1-rc8 (移植到vdsp5)
Visual DSP++ 5.0
  
 
欢迎转载,但请保留作者信息
 
在mm/filemap.c中有一个 __grab_cache_page函数,此函数同样引起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
          ___grab_cache_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
看看这个函数的代码:
/*
 * If the page was newly created, increment its refcount and add it to the
 * caller's lru-buffering pagevec. This function is specifically for
 * generic_file_write().
 */
static inline struct page *
__grab_cache_page(struct address_space *mapping, unsigned long index,
              struct page **cached_page, struct pagevec *lru_pvec)
{
     int err;
     struct page *page;
repeat:
     page = find_lock_page(mapping, index);
     if (!page) {
         if (!*cached_page) {
              *cached_page = page_cache_alloc(mapping);
              if (!*cached_page)
                   return NULL;
         }
         err = add_to_page_cache(*cached_page, mapping,
                       index, GFP_KERNEL);
         if (err == -EEXIST)
              goto repeat;
         if (err == 0) {
              page = *cached_page;
              page_cache_get(page);
              if (!pagevec_add(lru_pvec, page))
                   __pagevec_lru_add(lru_pvec);
              *cached_page = NULL;
         }
     }
     return page;
}
有了上次的经验,可以肯定问题发生在
              *cached_page = page_cache_alloc(mapping);
将之修改为:
              *cached_page = __alloc_pages(mapping_gfp_mask(mapping), 0,
                   NODE_DATA(0)->node_zonelists + gfp_zone(mapping_gfp_mask(mapping)));
搞定!
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

嵌云阁主

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值