-
Notifications
You must be signed in to change notification settings - Fork 5.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bsp: cvitek: fix cvitek/c906_little build warning #9865
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,8 @@ | |
|
||
#include <encoding.h> | ||
|
||
extern int rt_hw_tick_isr(void); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这个可以直接引用头文件嘛?extern声明方式比较偷懒,之前遇到过因为函数参数发生变化,导致每个extern位置都需要改一遍的情况,不利于维护 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
extern void rt_hw_irq_isr(void); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 针对 rt_hw_tick_isr & rt_hw_irq_isr, 我认为比较好的做法是参考 定义 weak 函数的目的实际上就是允许不同的 bsp 可以根据自己的需要在自己的 bsp 中重载其实现,如果没有重载则使用 weak 函数。 而使用 extern 方式则会强制要求 bsp 必须实现重载,不够灵活。 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这2个函数,是强制需要bsp实现的。 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 好吧,那先不搞 weak There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 首先我搜索发现使用 'rv64'(libcpu/risc-v/rv64) 的 bsp 总共有三个:
其中在 如此看来, 另外 综上所述,我觉得最好的解决方案,还是将 btw, 我目前觉得 rv64 这个 libcpu 应该标记为 NOT RECOMMEND 了,当然这是后话。 |
||
|
||
struct exception_stack_frame | ||
{ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我觉得
bsp/cvitek/c906_little/board/tick.h
实际上是不需要的。tick_isr 和 rt_hw_tick_init 是 定义在
libcpu/risc-v/common64/tick.c
而且是不可重载的。同时这两个函数已经通过
libcpu/risc-v/common64/tick.h
导出,所以 bsp 应该直接 includelibcpu/risc-v/common64/tick.h
这个文件,而不是自己再定义一份bsp/cvitek/c906_little/board/tick.h
。There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
小核现在用的并不是common64中的代码,用的是common+rv64中的代码。这个代码使用与RV64,里面没有对tick做适配,都是每个bsp自己实现
https://github.com/RT-Thread/rt-thread/blob/master/libcpu/risc-v/SConscript
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
嗯,是我看错了。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
请将
bsp/cvitek/c906_little/board/tick.h
中的 tick_isr 删掉,这个函数对于 rv64 根本不存在的。其实 bsp/k210 也有类似的问题。