主题 : 关于vivi源代码中,main模块中调用的reset_handler()函数 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 1491
精华: 0
发帖: 16
金钱: 160 两
威望: 16 点
综合积分: 32 分
注册时间: 2008-09-03
最后登录: 2009-07-29
楼主  发表于: 2008-09-24 00:21

 关于vivi源代码中,main模块中调用的reset_handler()函数

make生成了vivi,虽然/lib目录下有一个reset_handle.c文件,可是/lib/下并没有生成reset_handle.o文件,其他.o文件都正确生成了
/init/下main.o文件也生成了,显然是没有链接/lib/reset_handle.o
估计是链接某个库中提供的reset_handler()函数吧,那具体是哪个库文件呢
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
1楼  发表于: 2008-09-25 21:54
这个c档在s3c244x平台上不会用到,也不会被编译
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 1491
精华: 0
发帖: 16
金钱: 160 两
威望: 16 点
综合积分: 32 分
注册时间: 2008-09-03
最后登录: 2009-07-29
2楼  发表于: 2008-09-27 10:10
可是/init/main.c这个文件编译通过了啊,main.c里的main函数就调用了reset_handler(),如果没有reset_handler()的实现,main.c编译不会通过啊
级别: 新手上路
UID: 1491
精华: 0
发帖: 16
金钱: 160 两
威望: 16 点
综合积分: 32 分
注册时间: 2008-09-03
最后登录: 2009-07-29
3楼  发表于: 2008-09-27 10:23
:)
谢谢kasim的提醒
我终于明白了
原来在/include/reset_handle.h 中有如下这段代码
#ifdef CONFIG_RESET_HANDLING
void reset_handler(void);
#else
#define reset_handler()    (void)(0)
#endif
而在/include/autoconfi.h中
#undef CONFIG_RESET_HANDLING
所以main模块编译通过了
级别: 新手上路
UID: 1491
精华: 0
发帖: 16
金钱: 160 两
威望: 16 点
综合积分: 32 分
注册时间: 2008-09-03
最后登录: 2009-07-29
4楼  发表于: 2008-09-27 13:00
(void)(0); 是不是相当于一条nop指令呢
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
5楼  发表于: 2008-09-27 14:52
是的
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."