歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux基礎 >> 關於Linux

uclinux-2008R1-RC8(bf561)到VDSP5的移植(49):kernel_thread_helper的問題

在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;"後搞定。

Copyright © Linux教程網 All Rights Reserved