diff options
author | Jan Sommer <jan.sommer@dlr.de> | 2020-05-31 16:22:53 +0200 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2020-06-11 13:28:55 +1000 |
commit | 85d6a760f57e6f53c72cf8d15be20e3e4eaf4734 (patch) | |
tree | 21f2a8582414ad8810c8a52e553d27e1a790d9f1 /cpukit/score/cpu/i386/cpu_asm.S | |
parent | bsp/pc386: Turn start16.S into a startAP.S (diff) | |
download | rtems-85d6a760f57e6f53c72cf8d15be20e3e4eaf4734.tar.bz2 |
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
Diffstat (limited to 'cpukit/score/cpu/i386/cpu_asm.S')
-rw-r--r-- | cpukit/score/cpu/i386/cpu_asm.S | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/cpukit/score/cpu/i386/cpu_asm.S b/cpukit/score/cpu/i386/cpu_asm.S index 6b609ab4ce..9e1e848bbd 100644 --- a/cpukit/score/cpu/i386/cpu_asm.S +++ b/cpukit/score/cpu/i386/cpu_asm.S @@ -85,12 +85,13 @@ restore: movl REG_EBX(eax),ebx /* restore ebx */ movl REG_ESI(eax),esi /* restore source register */ movl REG_EDI(eax),edi /* restore destination register */ - movl REG_GS_0(eax), ecx /* restore gs segment */ + GET_CPU_ID ecx + movl REG_GS_0(eax), edx /* restore gs segment */ + movl edx, _Global_descriptor_table+24(,ecx,8) movl REG_GS_1(eax), edx - movl ecx, _Global_descriptor_table + 24 - movl edx, _Global_descriptor_table + 28 - movl $24, ecx - mov ecx, gs + movl edx, _Global_descriptor_table+28(,ecx,8) + leal 24(,ecx,8), edx + movl edx, gs ret /* |