]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFspWrapperPkg/Library/SecPeiFspPlatformSecLibSample/Ia32/PeiCoreEntry.S
DynamicTablesPkg: GTDT updates for ACPI 6.3
[mirror_edk2.git] / IntelFspWrapperPkg / Library / SecPeiFspPlatformSecLibSample / Ia32 / PeiCoreEntry.S
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 # PeiCoreEntry.S
9 #
10 # Abstract:
11 #
12 # Find and call SecStartup
13 #
14 #------------------------------------------------------------------------------
15
16 ASM_GLOBAL ASM_PFX(CallPeiCoreEntryPoint)
17 ASM_PFX(CallPeiCoreEntryPoint):
18 #
19 # Obtain the hob list pointer
20 #
21 movl 0x4(%esp), %eax
22 #
23 # Obtain the stack information
24 # ECX: start of range
25 # EDX: end of range
26 #
27 movl 0x8(%esp), %ecx
28 movl 0xC(%esp), %edx
29
30 #
31 # Platform init
32 #
33 pushal
34 pushl %edx
35 pushl %ecx
36 pushl %eax
37 call ASM_PFX(PlatformInit)
38 popl %eax
39 popl %eax
40 popl %eax
41 popal
42
43 #
44 # Set stack top pointer
45 #
46 movl %edx, %esp
47
48 #
49 # Push the hob list pointer
50 #
51 pushl %eax
52
53 #
54 # Save the value
55 # ECX: start of range
56 # EDX: end of range
57 #
58 movl %esp, %ebp
59 pushl %ecx
60 pushl %edx
61
62 #
63 # Push processor count to stack first, then BIST status (AP then BSP)
64 #
65 movl $1, %eax
66 cpuid
67 shr $16, %ebx
68 andl $0x000000FF, %ebx
69 cmp $1, %bl
70 jae PushProcessorCount
71
72 #
73 # Some processors report 0 logical processors. Effectively 0 = 1.
74 # So we fix up the processor count
75 #
76 inc %ebx
77
78 PushProcessorCount:
79 pushl %ebx
80
81 #
82 # We need to implement a long-term solution for BIST capture. For now, we just copy BSP BIST
83 # for all processor threads
84 #
85 xorl %ecx, %ecx
86 movb %bl, %cl
87 PushBist:
88 movd %mm0, %eax
89 pushl %eax
90 loop PushBist
91
92 # Save Time-Stamp Counter
93 movd %mm5, %eax
94 pushl %eax
95
96 movd %mm6, %eax
97 pushl %eax
98
99 #
100 # Pass entry point of the PEI core
101 #
102 movl $0xFFFFFFE0, %edi
103 pushl %ds:(%edi)
104
105 #
106 # Pass BFV into the PEI Core
107 #
108 movl $0xFFFFFFFC, %edi
109 pushl %ds:(%edi)
110
111 #
112 # Pass stack size into the PEI Core
113 #
114 movl -4(%ebp), %ecx
115 movl -8(%ebp), %edx
116 pushl %ecx # RamBase
117
118 subl %ecx, %edx
119 pushl %edx # RamSize
120
121 #
122 # Pass Control into the PEI Core
123 #
124 call ASM_PFX(SecStartup)