uclinux-2008R1-RC8(bf561)到VDSP5的移植(51):fork.c编译失败

出现一个莫明奇妙的编译错误:

../../kernel/fork.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 _copy_process).
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 "../../kernel/fork.c".
Compilation aborted.
cc3089: fatal error: Compilation failed
Tool failed with exit/exception code: 1.
Build was unsuccessful.

注释掉所有代码,一步步往上添加,问题出在copy_process函数,进一步查找终于发现问题在于这个函数中的这个语句:

if (unlikely(!cpu_isset(task_cpu(p), p->cpus_allowed) ||
!cpu_online(task_cpu(p))))
set_task_cpu(p, smp_processor_id());

当不加这行时没有错误。当加上这个语句时,出现上述错误。

回顾一下unlikely的定义:

#define unlikely(x) expected_false(!!(x))

确实是做优化用的,既然此处编译不过,就去了它,改为:

if (/*unlikely(*/!cpu_isset(task_cpu(p), p->cpus_allowed) ||
!cpu_online(task_cpu(p))/*)*/)
set_task_cpu(p, smp_processor_id());

时间: 2024-09-13 16:32:28

uclinux-2008R1-RC8(bf561)到VDSP5的移植(51):fork.c编译失败的相关文章

uclinux-2008R1-RC8(bf561)到VDSP5的移植(62)

uclinux-2008R1-RC8(bf561)到VDSP5的移植(62):Failed to open '#include' file 'bf561.h' 在include/asm/mach/blackfin.h文件中,有这样的语句: #include "bf561.h" #include "mem_map.h" #include "defBF561.h" #include "anomaly.h" 当在asm文件中包含这个

uclinux-2008R1-RC8(bf561)到VDSP5的移植(58)

uclinux-2008R1-RC8(bf561)到VDSP5的移植(58): unable to open an initial console blog. 碰到一个郁闷的问题,提示" unable to open an initial console"后再没有下文了. 搜了下这个错误出现的位置,在init_post函数中: if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0)

uclinux-2008R1-RC8(bf561)到VDSP5的移植(57)

clinux-2008R1-RC8(bf561)到VDSP5的移植(57):_NSIG_WORDS_is_unsupported_size 在include/linux/signal.h中使用了一个函数_NSIG_WORDS_is_unsupported_size,其使用过程大致如下所示: static inline int sigisemptyset(sigset_t *set) { extern void _NSIG_WORDS_is_unsupported_size(void); swit

uclinux-2008R1-RC8(bf561)到VDSP5的移植(43)

uclinux-2008R1-RC8(bf561)到VDSP5的移植(43):__builtin_return_address的问题 __builtin_return_address (LEVEL):这是GCC的内建函数,用于返回当前函数或其调用者的返回地址,参数LEVEL 指定在栈上搜索框架的个数,0 表示当前函数的返回地址,1 表示当前函数的调用者的返回地址,依此类推.在VDSP中,通过FP的循环取值可以完成相似的功能(参见以前的文章<使用FP取得函数的调用堆栈>).查了下内核对此函数的使

uclinux-2008R1-RC8(bf561)到VDSP5的移植(24):CONFIG_NR_CPUS

uclinux内核将bf561的每一个核都视为一个独立的CPU,因此在config.h中补上定义: // 多核支持 #define CONFIG_SMP 1 #define CONFIG_NR_CPUS 2

uclinux-2008R1-RC8(bf561)到VDSP5的移植(1):前言

1 目标 将uclinux-2008R1-RC8(bf561)移植到VDSP5上. 让uclinux支持双核. 2 原则 1.首先注释掉所有的声明和实现,但是保留#include和#define这样的语句. 2.逐步添加所需要的功能. 3.smp相关的部分参考linux-2.6.19的内核. 4.使用VDSP库.

uclinux-2008R1-RC8(bf561)到VDSP5的移植(3):Head.s

uclinux系统的入口点为head.s,因此先将此文件添加到corea.dlb,先改下语法错误. 1 时钟配置 因为没有使用引导程序,因此在内核启动时需要重新配置CPU的运行速度.在config.h中添加以下定义: // 时钟配置 #define CONFIG_CLKIN_HZ 27000000 // 晶振频率 #define CONFIG_VCO_MULT 22 // 内核倍频 #define CONFIG_CCLK_DIV 1 // 内核分频 #define CONFIG_SCLK_DIV

uclinux-2008R1-RC8(bf561)到VDSP5的移植(37):_cplb_mgr

在uclinux内核中,提供了一个函数:_cplb_mgr,此函数位于 arch/blackfin/kernel/cpu-nompu/cplbmgr.s,它的作用是当bf561发生cplb miss exception的时候替换掉最后的cache范围.在vdsp5中同样提供了一个_cplb_mgr的函数,而且VDSP在默认情况下会使用自己的库中的函数,从而造成内核错误. 因此,我们需要在config.h中增加一个定义: #define _cplb_mgr _uclinux_cplb_mgr #d

uclinux-2008R1-RC8(bf561)到VDSP5的移植(2):代码注释

因为uclinux内核是个庞然大物,为避免一开始就遭受打击,所以就决定先将所有的代码注释掉.但是与此同时要保留各个文件之间的依赖关系,因此必须保留#include这样的语句.再考虑到uclinux是通过宏定义来控制各种功能实现的,且宏定义几乎不会对移植造成任何困扰,所以也保留了#if #define这样的语句. 以下就是自己写的一小段代码,用于实现上述功能,在VS2005下可以使用. // hprocess.cpp : 定义控制台应用程序的入口点.//#include "stdafx.h&quo