]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFspWrapperPkg/Library/SecPeiFspPlatformSecLibSample/Ia32/PeiCoreEntry.asm
IntelFspWrapperPkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / IntelFspWrapperPkg / Library / SecPeiFspPlatformSecLibSample / Ia32 / PeiCoreEntry.asm
CommitLineData
a33a2f62
JY
1;------------------------------------------------------------------------------\r
2;\r
3; Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>\r
19486360 4; SPDX-License-Identifier: BSD-2-Clause-Patent\r
a33a2f62
JY
5;\r
6; Module Name:\r
7;\r
8; PeiCoreEntry.asm\r
9;\r
10; Abstract:\r
11;\r
12; Find and call SecStartup\r
13;\r
14;------------------------------------------------------------------------------\r
15\r
16.686p\r
17.xmm\r
18.model flat, c\r
19.code\r
20\r
21EXTRN SecStartup:NEAR\r
22EXTRN PlatformInit:NEAR\r
23\r
24CallPeiCoreEntryPoint PROC PUBLIC\r
25 ;\r
26 ; Obtain the hob list pointer\r
27 ;\r
28 mov eax, [esp+4]\r
29 ;\r
30 ; Obtain the stack information\r
31 ; ECX: start of range\r
32 ; EDX: end of range\r
33 ;\r
34 mov ecx, [esp+8]\r
35 mov edx, [esp+0Ch]\r
36\r
37 ;\r
38 ; Platform init\r
39 ;\r
40 pushad\r
41 push edx\r
42 push ecx\r
43 push eax\r
44 call PlatformInit\r
45 pop eax\r
46 pop eax\r
47 pop eax\r
48 popad\r
49\r
50 ;\r
51 ; Set stack top pointer\r
52 ;\r
53 mov esp, edx\r
54\r
55 ;\r
56 ; Push the hob list pointer\r
57 ;\r
58 push eax\r
59\r
60 ;\r
61 ; Save the value\r
62 ; ECX: start of range\r
63 ; EDX: end of range\r
64 ;\r
65 mov ebp, esp\r
66 push ecx\r
67 push edx\r
68\r
69 ;\r
70 ; Push processor count to stack first, then BIST status (AP then BSP)\r
71 ;\r
72 mov eax, 1\r
73 cpuid\r
74 shr ebx, 16\r
75 and ebx, 0000000FFh\r
76 cmp bl, 1\r
77 jae PushProcessorCount\r
78\r
79 ;\r
80 ; Some processors report 0 logical processors. Effectively 0 = 1.\r
81 ; So we fix up the processor count\r
82 ;\r
83 inc ebx\r
84\r
85PushProcessorCount:\r
86 push ebx\r
87\r
88 ;\r
89 ; We need to implement a long-term solution for BIST capture. For now, we just copy BSP BIST\r
90 ; for all processor threads\r
91 ;\r
92 xor ecx, ecx\r
93 mov cl, bl\r
94PushBist:\r
95 movd eax, mm0\r
96 push eax\r
97 loop PushBist\r
98\r
99 ; Save Time-Stamp Counter\r
100 movd eax, mm5\r
101 push eax\r
102\r
103 movd eax, mm6\r
104 push eax\r
105\r
106 ;\r
107 ; Pass entry point of the PEI core\r
108 ;\r
109 mov edi, 0FFFFFFE0h\r
110 push DWORD PTR ds:[edi]\r
111\r
112 ;\r
113 ; Pass BFV into the PEI Core\r
114 ;\r
115 mov edi, 0FFFFFFFCh\r
116 push DWORD PTR ds:[edi]\r
117\r
118 ;\r
119 ; Pass stack size into the PEI Core\r
120 ;\r
121 mov ecx, [ebp - 4]\r
122 mov edx, [ebp - 8]\r
123 push ecx ; RamBase\r
124\r
125 sub edx, ecx\r
126 push edx ; RamSize\r
127\r
128 ;\r
129 ; Pass Control into the PEI Core\r
130 ;\r
131 call SecStartup\r
132CallPeiCoreEntryPoint ENDP\r
133\r
134END\r