Skip to content

Commit

Permalink
arch/x86_64: The AP retrieves this_task after storing the CPU private…
Browse files Browse the repository at this point in the history
… 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 <[email protected]>

x86_64/intel64: fix SMP compilation warnings

Signed-off-by: p-szafonimateusz <[email protected]>
  • Loading branch information
xianglyc committed Oct 16, 2024
1 parent c59c6b0 commit 9bcb38a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions arch/x86_64/src/intel64/intel64_cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down
7 changes: 4 additions & 3 deletions arch/x86_64/src/intel64/intel64_cpustart.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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();
Expand Down

0 comments on commit 9bcb38a

Please sign in to comment.