在arch/blackfin/kernel/process.c中有这样一个函数:
/*
* This gets run with P1 containing the
* function to call, and R1 containing
* the "args". Note P0 is clobbered on the way here.
*/
void
kernel_thread_helper(void);
__asm__(".section .text/n"
".align 4/n"
"_kernel_thread_helper:/n/t"
"/tsp += -12;/n/t"
"/tr0 = r1;/n/t" "/tcall (p1);/n/t" "/tcall _do_exit;/n" ".previous");
它将引发一个错误:
[Error ea5004] "c:/temp/acc06a8ef03000/acc06a8ef03001.s":67 Syntax Error in :
.align 2;
syntax error is at or near text '.align'.
Attempting error recovery by ignoring text until the ';'
Previous errors prevent assembly
Assembler totals: 1 error(s) and 0 warning(s)
cc3089: fatal error: Assembler failed
怎么看都找不到.align 2这行语句。
逐行屏蔽这些汇编语句后发现,问题出在
".previous"这行上,查了下.previous:
The
.PREVIOUS directive instructs the assembler to set the current section in memory to the section described immediately before the current one. The .PREVIOUS directive operates on a stack.
Syntax:
.PREVIOUS;
The following examples provide valid and invalid cases of the use of the consecutive .
PREVIOUS directives.
嘿嘿,原来少了个分号,影响到下面的C程序的生成了。
改为
".previous;"后搞定。