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>
21 .globl protected_mode_jump
22 .type protected_mode_jump, @function
27 * void protected_mode_jump(u32 entrypoint, u32 bootparams);
30 movl %edx, %esi # Pointer to boot_params table
36 jmp 1f # Short jump to serialize on 386/486
43 orb $X86_CR0_PE, %dl # Protected mode
46 # Transition to 32-bit mode
47 .byte 0x66, 0xea # ljmpl opcode
48 2: .long in_pm32 # offset
49 .word __BOOT_CS # segment
51 .size protected_mode_jump, .-protected_mode_jump
54 .type in_pm32, @function
56 # Set up data segments for flat 32-bit mode
62 # The 32-bit code sets up its own stack, but this way we do have
63 # a valid stack if some debugging hack wants to use it.
66 # Set up TR to make Intel VT happy
69 # Clear registers to allow for future extensions to the
70 # 32-bit boot protocol
77 # Set up LDTR to make Intel VT happy
80 jmpl *%eax # Jump to the 32-bit entrypoint
82 .size in_pm32, .-in_pm32