source: rtems/bsps/i386/pc386/start/getcpuid.c @ 85d6a760

5
Last change on this file since 85d6a760 was 85d6a760, checked in by Jan Sommer <jan.sommer@…>, on May 31, 2020 at 2:22:53 PM

bsp/pc386: Update GDT to work for SMP

Create a GS segment in the GDT for each processor for storing TLS.
This makes the GDT in startAP.S obsolete as all processors now share the
same GDT, which is passed to each AP at startup.

The correct segment for each processor is calculated in cpu_asm.S.

Update #3335

  • Property mode set to 100644
File size: 538 bytes
Line 
1/*
2 *  COPYRIGHT (c) 2011.
3 *  On-Line Applications Research Corporation (OAR).
4 *
5 *  The license and distribution terms for this file may be
6 *  found in the file LICENSE in this distribution or at
7 *  http://www.rtems.org/license/LICENSE.
8 */
9
10#include <rtems/score/cpu.h>
11
12#include <bsp/apic.h>
13#include <bsp/smp-imps.h>
14
15static int lapic_dummy = 0;
16unsigned imps_lapic_addr = ((unsigned)(&lapic_dummy)) - LAPIC_ID;
17
18uint32_t _CPU_SMP_Get_current_processor( void )
19{
20  return imps_apic_cpu_map[APIC_ID(IMPS_LAPIC_READ(LAPIC_ID))];
21}
22
Note: See TracBrowser for help on using the repository browser.