~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/x86/realmode/rm/trampoline_32.S

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 /*
  3  *
  4  *      Trampoline.S    Derived from Setup.S by Linus Torvalds
  5  *
  6  *      4 Jan 1997 Michael Chastain: changed to gnu as.
  7  *
  8  *      This is only used for booting secondary CPUs in SMP machine
  9  *
 10  *      Entry: CS:IP point to the start of our code, we are
 11  *      in real mode with no stack, but the rest of the
 12  *      trampoline page to make our stack and everything else
 13  *      is a mystery.
 14  *
 15  *      We jump into arch/x86/kernel/head_32.S.
 16  *
 17  *      On entry to trampoline_start, the processor is in real mode
 18  *      with 16-bit addressing and 16-bit data.  CS has some value
 19  *      and IP is zero.  Thus, we load CS to the physical segment
 20  *      of the real mode code before doing anything further.
 21  */
 22 
 23 #include <linux/linkage.h>
 24 #include <asm/segment.h>
 25 #include <asm/page_types.h>
 26 #include "realmode.h"
 27 
 28         .text
 29         .code16
 30 
 31         .balign PAGE_SIZE
 32 SYM_CODE_START(trampoline_start)
 33         wbinvd                  # Needed for NUMA-Q should be harmless for others
 34 
 35         LJMPW_RM(1f)
 36 1:
 37         mov     %cs, %ax        # Code and data in the same place
 38         mov     %ax, %ds
 39 
 40         cli                     # We should be safe anyway
 41 
 42         movl    tr_start, %eax  # where we need to go
 43 
 44         /*
 45          * GDT tables in non default location kernel can be beyond 16MB and
 46          * lgdt will not be able to load the address as in real mode default
 47          * operand size is 16bit. Use lgdtl instead to force operand size
 48          * to 32 bit.
 49          */
 50         lidtl   tr_idt                  # load idt with 0, 0
 51         lgdtl   tr_gdt                  # load gdt with whatever is appropriate
 52 
 53         movw    $1, %dx                 # protected mode (PE) bit
 54         lmsw    %dx                     # into protected mode
 55 
 56         ljmpl   $__BOOT_CS, $pa_startup_32
 57 SYM_CODE_END(trampoline_start)
 58 
 59         .section ".text32","ax"
 60         .code32
 61 SYM_CODE_START(startup_32)                      # note: also used from wakeup_asm.S
 62         jmp     *%eax
 63 SYM_CODE_END(startup_32)
 64 
 65         .bss
 66         .balign 8
 67 SYM_DATA_START(trampoline_header)
 68         SYM_DATA_LOCAL(tr_start,        .space 4)
 69         SYM_DATA_LOCAL(tr_gdt_pad,      .space 2)
 70         SYM_DATA_LOCAL(tr_gdt,          .space 6)
 71 SYM_DATA_END(trampoline_header)
 72         
 73 #include "trampoline_common.S"

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php