OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [linux-2.4/] [arch/] [x86_64/] [kernel/] [trampoline.S] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1275 phoenix
/*
2
 *
3
 *      Trampoline.S    Derived from Setup.S by Linus Torvalds
4
 *
5
 *      4 Jan 1997 Michael Chastain: changed to gnu as.
6
 *
7
 *      Entry: CS:IP point to the start of our code, we are
8
 *      in real mode with no stack, but the rest of the
9
 *      trampoline page to make our stack and everything else
10
 *      is a mystery.
11
 *
12
 *      In fact we don't actually need a stack so we don't
13
 *      set one up.
14
 *
15
 *      On entry to trampoline_data, the processor is in real mode
16
 *      with 16-bit addressing and 16-bit data.  CS has some value
17
 *      and IP is zero.  Thus, data addresses need to be absolute
18
 *      (no relocation) and are taken with regard to r_base.
19
 *
20
 *      If you work on this file, check the object module with objdump
21
 *      --full-contents --reloc to make sure there are no relocation
22
 *      entries. For the GDT entry we do hand relocation in smpboot.c
23
 *      because of 64bit linker limitations.
24
 */
25
 
26
#include 
27
#include 
28
#include 
29
 
30
.data
31
 
32
.code16
33
 
34
ENTRY(trampoline_data)
35
r_base = .
36
 
37
        mov     %cs, %ax        # Code and data in the same place
38
        mov     %ax, %ds
39
 
40
        mov     $1, %bx         # Flag an SMP trampoline
41
        cli                     # We should be safe anyway
42
 
43
        movl    $0xA5A5A5A5, trampoline_data - r_base
44
                                # write marker for master knows we're running
45
 
46
        lidt    idt_48 - r_base # load idt with 0, 0
47
        lgdt    gdt_48 - r_base # load gdt with whatever is appropriate
48
 
49
        movw    $__KERNEL_DS,%ax
50
        movw    %ax,%ds
51
        movw    %ax,%es
52
 
53
        xor     %ax, %ax
54
        inc     %ax             # protected mode (PE) bit
55
        lmsw    %ax             # into protected mode
56
        jmp     flush_instr
57
flush_instr:
58
        ljmpl   $__KERNEL32_CS, $0x00100000
59
                        # jump to startup_32 in arch/x86_64/kernel/head.S
60
 
61
idt_48:
62
        .word   0                        # idt limit = 0
63
        .word   0, 0                    # idt base = 0L
64
 
65
gdt_48:
66
        .short  0x0800                  # gdt limit = 2048, 256 GDT entries
67
        .globl tramp_gdt_ptr
68
tramp_gdt_ptr:
69
        .long   0                        # gdt base = gdt (first SMP CPU)
70
                                        # this is filled in by C because the 64bit
71
                                        # linker doesn't support absolute 32bit
72
                                        # relocations.
73
 
74
 
75
.globl trampoline_end
76
trampoline_end:

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.