1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /* ----------------------------------------------------------------------- *
4 * Copyright (C) 1991, 1992 Linus Torvalds
5 * Copyright 2007 rPath, Inc. - All Rights Reserved
7 * ----------------------------------------------------------------------- */
10 * The actual transition into protected mode
14 #include <asm/processor-flags.h>
15 #include <asm/segment.h>
16 #include <linux/linkage.h>
22 * void protected_mode_jump(u32 entrypoint, u32 bootparams);
24 SYM_FUNC_START_NOALIGN(protected_mode_jump)
25 movl %edx, %esi # Pointer to boot_params table
31 jmp 1f # Short jump to serialize on 386/486
38 orb $X86_CR0_PE, %dl # Protected mode
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)
48 .section ".text32","ax"
49 SYM_FUNC_START_LOCAL_NOALIGN(.Lin_pm32)
50 # Set up data segments for flat 32-bit mode
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.
60 # Set up TR to make Intel VT happy
63 # Clear registers to allow for future extensions to the
64 # 32-bit boot protocol
71 # Set up LDTR to make Intel VT happy
74 jmpl *%eax # Jump to the 32-bit entrypoint
75 SYM_FUNC_END(.Lin_pm32)