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

本文介绍了一个出现在arch/blackfin/kernel/process.c文件中kernel_thread_helper函数的_asm语法错误,并详细记录了解决过程。错误提示为.align2语法错误,最终发现是由于.previous指令缺少分号导致的。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 
在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;"后搞定。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

嵌云阁主

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

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

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

打赏作者

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

抵扣说明:

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

余额充值