You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by li...@apache.org on 2024/10/16 14:09:06 UTC
(nuttx) branch master updated: arch/x86_64: The AP retrieves this_task after storing the CPU private data
This is an automated email from the ASF dual-hosted git repository.
ligd pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new eb27ebba8a arch/x86_64: The AP retrieves this_task after storing the CPU private data
eb27ebba8a is described below
commit eb27ebba8adfe29644a7b890f86e6f16941921dc
Author: liwenxiang1 <li...@xiaomi.com>
AuthorDate: Mon Oct 14 16:58:36 2024 +0800
arch/x86_64: The AP retrieves this_task after storing the CPU private data
this_task obtains the CPU ID through the GS register, so the initial value of GS needs to be configured in x86_64_cpu_priv_set
Signed-off-by: liwenxiang1 <li...@xiaomi.com>
x86_64/intel64: fix SMP compilation warnings
Signed-off-by: p-szafonimateusz <p-...@xiaomi.com>
---
arch/x86_64/src/intel64/intel64_cpu.c | 4 ++--
arch/x86_64/src/intel64/intel64_cpustart.c | 7 ++++---
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/arch/x86_64/src/intel64/intel64_cpu.c b/arch/x86_64/src/intel64/intel64_cpu.c
index 5e6e33f9df..30fcd95f32 100644
--- a/arch/x86_64/src/intel64/intel64_cpu.c
+++ b/arch/x86_64/src/intel64/intel64_cpu.c
@@ -49,8 +49,8 @@
* Public Data
****************************************************************************/
-extern volatile uint32_t g_cpu_count;
-volatile static spinlock_t g_ap_boot;
+extern volatile uint32_t g_cpu_count;
+static spinlock_t g_ap_boot;
/* CPU private data */
diff --git a/arch/x86_64/src/intel64/intel64_cpustart.c b/arch/x86_64/src/intel64/intel64_cpustart.c
index 26715398b4..ec78ccc720 100644
--- a/arch/x86_64/src/intel64/intel64_cpustart.c
+++ b/arch/x86_64/src/intel64/intel64_cpustart.c
@@ -127,11 +127,9 @@ static int x86_64_ap_startup(int cpu)
void x86_64_ap_boot(void)
{
- struct tcb_s *tcb = this_task();
+ struct tcb_s *tcb;
uint8_t cpu = 0;
- UNUSED(tcb);
-
/* Do some checking on CPU compatibilities at the top of this function */
x86_64_check_and_enable_capability();
@@ -148,6 +146,9 @@ void x86_64_ap_boot(void)
x86_64_cpu_priv_set(cpu);
+ tcb = this_task();
+ UNUSED(tcb);
+
/* Configure interrupts */
up_irqinitialize();