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 * arch/i386/boot/pmjump.S
14 * The actual transition into protected mode
18 #include <asm/processor-flags.h>
19 #include <asm/segment.h>
23 .globl protected_mode_jump
24 .type protected_mode_jump, @function
29 * void protected_mode_jump(u32 entrypoint, u32 bootparams);
32 movl %edx, %esi # Pointer to boot_params table
43 orb $X86_CR0_PE, %dl # Protected mode
45 jmp 1f # Short jump to serialize on 386/486
48 # Transition to 32-bit mode
49 .byte 0x66, 0xea # ljmpl opcode
50 2: .long in_pm32 # offset
51 .word __BOOT_CS # segment
53 .size protected_mode_jump, .-protected_mode_jump
56 .type in_pm32, @function
58 # Set up data segments for flat 32-bit mode
64 # The 32-bit code sets up its own stack, but this way we do have
65 # a valid stack if some debugging hack wants to use it.
68 # Set up TR to make Intel VT happy
71 # Clear registers to allow for future extensions to the
72 # 32-bit boot protocol
79 # Set up LDTR to make Intel VT happy
82 jmpl *%eax # Jump to the 32-bit entrypoint
84 .size in_pm32, .-in_pm32