Skip to content

Conversation

@liYony
Copy link
Contributor

@liYony liYony commented Dec 10, 2024

拉取/合并请求描述:(PR description)

[

单核在setup.c 文件中#include <smp_call.h> 会找不到rt_hw_spinlock_t定义,必须要打开RT_USING_SMP宏才能include此文件。

为什么提交这份PR (why to submit this PR)

你的解决方案是什么 (what is your solution)

请提供验证的bsp和config (provide the config and bsp)

  • BSP:

  • .config:

  • action:

]

当前拉取/合并请求的状态 Intent for your PR

必须选择一项 Choose one (Mandatory):

  • 本拉取/合并请求是一个草稿版本 This PR is for a code-review and is intended to get feedback
  • 本拉取/合并请求是一个成熟版本 This PR is mature, and ready to be integrated into the repo

代码质量 Code Quality:

我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:

  • 已经仔细查看过代码改动的对比 Already check the difference between PR and old code
  • 代码风格正确,包括缩进空格,命名及其他风格 Style guide is adhered to, including spacing, naming and other styles
  • 没有垃圾代码,代码尽量精简,不包含#if 0代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up
  • 所有变更均有原因及合理的,并且不会影响到其他软件组件代码或BSP All modifications are justified and not affect other components or BSP
  • 对难懂代码均提供对应的注释 I've commented appropriately where code is tricky
  • 代码是高质量的 Code in this PR is of high quality
  • 已经使用formatting 等源码格式化工具确保格式符合RT-Thread代码规范 This PR complies with RT-Thread code specification
  • 如果是新增bsp, 已经添加ci检查到.github/workflows/bsp_buildings.yml 详细请参考链接BSP自查

@github-actions github-actions bot added Arch: ARM/AArch64 BSP related with arm libcpu labels Dec 10, 2024
@unicornx unicornx self-requested a review December 10, 2024 23:35
@unicornx
Copy link
Contributor

unicornx commented Dec 12, 2024

两个问题:

1:请补全 commit 信息。具体要求参考:https://github.com/plctlab/plct-rt-thread/tree/notes/0.notes#%E5%A6%82%E4%BD%95%E6%8F%90%E4%BA%A4-git-commit

2:我查了一下代码,造成编译不过的原因在于 ./libcpu/aarch64/common/include/cpuport.hrt_hw_spinlock_t 的定义依赖于 RT_USING_SMP 的定义:

#ifdef RT_USING_SMP

/**
 * Spinlock
 */

typedef struct
{
    rt_uint32_t value;
} rt_hw_spinlock_t;

#endif /* RT_USING_SMP */

包含的路径大致如下:假设 -> 表示 #include
rtthread.h -> rtdef.h -> rttypes.h -> cpuport.h

以上是备忘。

既然 smp_call.h 本身的内容和 RT_USING_SMP 强相关,是否可以直接在 smp_call.h 中直接将内容用 RT_USING_SMP 括起来。参考 https://elixir.bootlin.com/linux/v6.12.4/source/include/linux/smp.h#L114

#ifndef __SMP_IPI_H__
#define __SMP_IPI_H__
#include <rtthread.h>

#ifdef RT_USING_SMP
/* callback of smp call */
......
#endif // RT_USING_SMP

#endif // __SMP_IPI_H__

Copy link
Contributor

@unicornx unicornx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

请参考 comments

@unicornx
Copy link
Contributor

已经在 #9835 中解决了,关闭这个 PR

@unicornx unicornx closed this Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Arch: ARM/AArch64 BSP related with arm libcpu

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants