]> git.proxmox.com Git - mirror_edk2.git/blob - UefiCpuPkg/SecCore/Ia32/ResetVec.nasmb
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / UefiCpuPkg / SecCore / Ia32 / ResetVec.nasmb
1 ;------------------------------------------------------------------------------
2 ;
3 ; Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
4 ; SPDX-License-Identifier: BSD-2-Clause-Patent
5 ;
6 ; Module Name:
7 ;
8 ; ResetVec.nasmb
9 ;
10 ; Abstract:
11 ;
12 ; Reset Vector Data structure
13 ; This structure is located at 0xFFFFF000
14 ;
15 ;------------------------------------------------------------------------------
16
17 ; .stack 0x0
18 ; SECTION .text
19 USE16
20
21 ;
22 ; The layout of this file is fixed. The build tool makes assumption of the layout.
23 ;
24
25 ORG 0h
26
27 ;
28 ; 0xFFFFF000
29 ;
30 ; We enter here with CS:IP = 0xFF00:0x0000. Do a far-jump to change CS to 0xF000
31 ; and IP to ApStartup.
32 ;
33 ApVector:
34 mov di, "AP"
35 jmp 0xF000:0xF000+ApStartup
36
37 TIMES 0xFC0-($-$$) nop
38
39 ;
40 ; This should be at 0xFFFFFFC0
41 ;
42
43 ;
44 ; Reserved
45 ;
46 ReservedData: DD 0eeeeeeeeh, 0eeeeeeeeh
47
48 TIMES 0xFD0-($-$$) nop
49 ;
50 ; This is located at 0xFFFFFFD0
51 ;
52 mov di, "PA"
53 jmp ApStartup
54
55 TIMES 0xFE0-($-$$) nop
56 ;
57 ; Pointer to the entry point of the PEI core
58 ; It is located at 0xFFFFFFE0, and is fixed up by some build tool
59 ; So if the value 8..1 appears in the final FD image, tool failure occurs.
60 ;
61 PeiCoreEntryPoint: DD 87654321h
62
63 ;
64 ; This is the handler for all kinds of exceptions. Since it's for debugging
65 ; purpose only, nothing except a dead loop would be done here. Developers could
66 ; analyze the cause of the exception if a debugger had been attached.
67 ;
68 global ASM_PFX(InterruptHandler)
69 ASM_PFX(InterruptHandler):
70 jmp $
71 iret
72
73 TIMES 0xFF0-($-$$) nop
74 ;
75 ; For IA32, the reset vector must be at 0xFFFFFFF0, i.e., 4G-16 byte
76 ; Execution starts here upon power-on/platform-reset.
77 ;
78 ResetHandler:
79 nop
80 nop
81 ApStartup:
82 ;
83 ; Jmp Rel16 instruction
84 ; Use machine code directly in case of the assembler optimization
85 ; SEC entry point relative address will be fixed up by some build tool.
86 ;
87 ; Typically, SEC entry point is the function _ModuleEntryPoint() defined in
88 ; SecEntry.asm
89 ;
90 DB 0e9h
91 DW -3
92
93
94 TIMES 0xFF8-($-$$) nop
95 ;
96 ; Ap reset vector segment address is at 0xFFFFFFF8
97 ; This will be fixed up by some build tool,
98 ; so if the value 1..8 appears in the final FD image,
99 ; tool failure occurs
100 ;
101 ApSegAddress: dd 12345678h
102
103 TIMES 0xFFC-($-$$) nop
104 ;
105 ; BFV Base is at 0xFFFFFFFC
106 ; This will be fixed up by some build tool,
107 ; so if the value 1..8 appears in the final FD image,
108 ; tool failure occurs.
109 ;
110 BfvBase: DD 12345678h
111
112 ;
113 ; Nothing can go here, otherwise the layout of this file would change.
114 ;