1 /* ----------------------------------------------------------------------- *
3 * Copyright (C) 1991, 1992 Linus Torvalds
4 * Copyright 2007 rPath, Inc. - All Rights Reserved
6 * This file is part of the Linux kernel, and is made available under
7 * the terms of the GNU General Public License version 2.
9 * ----------------------------------------------------------------------- */
12 * The actual transition into protected mode
16 #include <asm/processor-flags.h>
17 #include <asm/segment.h>
18 #include <linux/linkage.h>
24 * void protected_mode_jump(u32 entrypoint, u32 bootparams);
26 GLOBAL(protected_mode_jump)
27 movl %edx, %esi # Pointer to boot_params table
33 jmp 1f # Short jump to serialize on 386/486
40 orb $X86_CR0_PE, %dl # Protected mode
43 # Transition to 32-bit mode
44 .byte 0x66, 0xea # ljmpl opcode
45 2: .long in_pm32 # offset
46 .word __BOOT_CS # segment
47 ENDPROC(protected_mode_jump)
50 .section ".text32","ax"
52 # Set up data segments for flat 32-bit mode
58 # The 32-bit code sets up its own stack, but this way we do have
59 # a valid stack if some debugging hack wants to use it.
62 # Set up TR to make Intel VT happy
65 # Clear registers to allow for future extensions to the
66 # 32-bit boot protocol
73 # Set up LDTR to make Intel VT happy
76 jmpl *%eax # Jump to the 32-bit entrypoint