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

TOMOYO Linux Cross Reference
Linux/arch/x86/boot/pmjump.S

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ 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.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0-only */
  2 /* ----------------------------------------------------------------------- *
  3  *
  4  *   Copyright (C) 1991, 1992 Linus Torvalds
  5  *   Copyright 2007 rPath, Inc. - All Rights Reserved
  6  *
  7  * ----------------------------------------------------------------------- */
  8 
  9 /*
 10  * The actual transition into protected mode
 11  */
 12 
 13 #include <asm/boot.h>
 14 #include <asm/processor-flags.h>
 15 #include <asm/segment.h>
 16 #include <linux/linkage.h>
 17 
 18         .text
 19         .code16
 20 
 21 /*
 22  * void protected_mode_jump(u32 entrypoint, u32 bootparams);
 23  */
 24 SYM_FUNC_START_NOALIGN(protected_mode_jump)
 25         movl    %edx, %esi              # Pointer to boot_params table
 26 
 27         xorl    %ebx, %ebx
 28         movw    %cs, %bx
 29         shll    $4, %ebx
 30         addl    %ebx, 2f
 31         jmp     1f                      # Short jump to serialize on 386/486
 32 1:
 33 
 34         movw    $__BOOT_DS, %cx
 35         movw    $__BOOT_TSS, %di
 36 
 37         movl    %cr0, %edx
 38         orb     $X86_CR0_PE, %dl        # Protected mode
 39         movl    %edx, %cr0
 40 
 41         # Transition to 32-bit mode
 42         .byte   0x66, 0xea              # ljmpl opcode
 43 2:      .long   .Lin_pm32               # offset
 44         .word   __BOOT_CS               # segment
 45 SYM_FUNC_END(protected_mode_jump)
 46 
 47         .code32
 48         .section ".text32","ax"
 49 SYM_FUNC_START_LOCAL_NOALIGN(.Lin_pm32)
 50         # Set up data segments for flat 32-bit mode
 51         movl    %ecx, %ds
 52         movl    %ecx, %es
 53         movl    %ecx, %fs
 54         movl    %ecx, %gs
 55         movl    %ecx, %ss
 56         # The 32-bit code sets up its own stack, but this way we do have
 57         # a valid stack if some debugging hack wants to use it.
 58         addl    %ebx, %esp
 59 
 60         # Set up TR to make Intel VT happy
 61         ltr     %di
 62 
 63         # Clear registers to allow for future extensions to the
 64         # 32-bit boot protocol
 65         xorl    %ecx, %ecx
 66         xorl    %edx, %edx
 67         xorl    %ebx, %ebx
 68         xorl    %ebp, %ebp
 69         xorl    %edi, %edi
 70 
 71         # Set up LDTR to make Intel VT happy
 72         lldt    %cx
 73 
 74         jmpl    *%eax                   # Jump to the 32-bit entrypoint
 75 SYM_FUNC_END(.Lin_pm32)

~ [ 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