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 /bsps/i386/pc386/start/startAP.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 'bsps/i386/pc386/start/startAP.S')
-rw-r--r-- | bsps/i386/pc386/start/startAP.S | 39 |
1 files changed, 6 insertions, 33 deletions
diff --git a/bsps/i386/pc386/start/startAP.S b/bsps/i386/pc386/start/startAP.S index 0f81c03144..024c1f70fb 100644 --- a/bsps/i386/pc386/start/startAP.S +++ b/bsps/i386/pc386/start/startAP.S @@ -73,9 +73,12 @@ app_processor_start: */ .align 4 app_cpu_start: - .long 0 + .long 0 app_cpu_stack: - .long 0 + .long 0 +app_gdt_descr: + .word 0 /* GDT size */ + .long 0 /* GDT location */ setup_processor: movw %cs, %ax # Initialize the rest of @@ -87,7 +90,7 @@ setup_processor: | Bare PC machines boot in real mode! We have to turn protected mode on. +---------------------------------------------------------------------*/ - lgdt gdtptr - app_processor_start # load Global Descriptor Table + lgdt app_gdt_descr - app_processor_start # load Global Descriptor Table movl %cr0, %eax orl $CR0_PE, %eax @@ -113,33 +116,3 @@ start_32bit: movl $0, app_cpu_stack /* Switch to the higher level initialization routines */ ret - -/*----------------------------------------------------------------------------+ -| DATA section -+----------------------------------------------------------------------------*/ - -/************************** -* GLOBAL DESCRIPTOR TABLE * -**************************/ - - .p2align 4 -gdtptr: - /* we use the NULL descriptor to store the GDT pointer - a trick quite - nifty due to: Robert Collins (rcollins@x86.org) */ - .word gdtlen - 1 - .long gdtptr - .word 0x0000 - - /* code segment */ - .word 0xffff, 0 - .byte 0, 0x9f, 0xcf, 0 - - /* data segment */ - .word 0xffff, 0 - .byte 0, 0x93, 0xcf, 0 - - /* gs segment */ - .word 0xffff, 0 - .byte 0, 0x92, 0xcf, 0 - - .set gdtlen, . - gdtptr # length of GDT |