]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/Ia32/PeiCoreEntry.S
IntelFsp2WrapperPkg: Update gFspWrapperTokenSpaceGuid to gIntelFsp2WrapperTokenSpaceGuid.
[mirror_edk2.git] / IntelFsp2WrapperPkg / Library / SecFspWrapperPlatformSecLibSample / Ia32 / PeiCoreEntry.S
CommitLineData
cf1d4549
JY
1#------------------------------------------------------------------------------\r
2#\r
3# Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>\r
4# This program and the accompanying materials\r
5# are licensed and made available under the terms and conditions of the BSD License\r
6# which accompanies this distribution. The full text of the license may be found at\r
7# http://opensource.org/licenses/bsd-license.php.\r
8#\r
9# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
10# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
11#\r
12# Module Name:\r
13#\r
14# PeiCoreEntry.S\r
15#\r
16# Abstract:\r
17#\r
18# Find and call SecStartup\r
19#\r
20#------------------------------------------------------------------------------\r
21\r
22ASM_GLOBAL ASM_PFX(CallPeiCoreEntryPoint)\r
23ASM_PFX(CallPeiCoreEntryPoint):\r
24 #\r
25 # Obtain the hob list pointer\r
26 #\r
27 movl 0x4(%esp), %eax\r
28 #\r
29 # Obtain the stack information\r
30 # ECX: start of range\r
31 # EDX: end of range\r
32 #\r
33 movl 0x8(%esp), %ecx\r
34 movl 0xC(%esp), %edx\r
35\r
36 #\r
37 # Platform init\r
38 #\r
39 pushal\r
40 pushl %edx\r
41 pushl %ecx\r
42 pushl %eax\r
43 call ASM_PFX(PlatformInit)\r
44 popl %eax\r
45 popl %eax\r
46 popl %eax\r
47 popal\r
48\r
49 #\r
50 # Set stack top pointer\r
51 #\r
52 movl %edx, %esp\r
53\r
54 #\r
55 # Push the hob list pointer\r
56 #\r
57 pushl %eax\r
58\r
59 #\r
60 # Save the value\r
61 # ECX: start of range\r
62 # EDX: end of range\r
63 #\r
64 movl %esp, %ebp\r
65 pushl %ecx\r
66 pushl %edx\r
67\r
68 #\r
69 # Push processor count to stack first, then BIST status (AP then BSP)\r
70 #\r
71 movl $1, %eax\r
72 cpuid\r
73 shr $16, %ebx\r
74 andl $0x000000FF, %ebx\r
75 cmp $1, %bl\r
76 jae PushProcessorCount\r
77\r
78 #\r
79 # Some processors report 0 logical processors. Effectively 0 = 1.\r
80 # So we fix up the processor count\r
81 #\r
82 inc %ebx\r
83\r
84PushProcessorCount:\r
85 pushl %ebx\r
86\r
87 #\r
88 # We need to implement a long-term solution for BIST capture. For now, we just copy BSP BIST\r
89 # for all processor threads\r
90 #\r
91 xorl %ecx, %ecx\r
92 movb %bl, %cl\r
93PushBist:\r
94 movd %mm0, %eax\r
95 pushl %eax\r
96 loop PushBist\r
97\r
98 # Save Time-Stamp Counter\r
99 movd %mm5, %eax\r
100 pushl %eax\r
101\r
102 movd %mm6, %eax\r
103 pushl %eax\r
104\r
105 #\r
106 # Pass entry point of the PEI core\r
107 #\r
108 movl $0xFFFFFFE0, %edi\r
109 pushl %ds:(%edi)\r
110\r
111 #\r
112 # Pass BFV into the PEI Core\r
113 #\r
114 movl $0xFFFFFFFC, %edi\r
115 pushl %ds:(%edi)\r
116\r
117 #\r
118 # Pass stack size into the PEI Core\r
119 #\r
120 movl -4(%ebp), %ecx\r
121 movl -8(%ebp), %edx\r
122 pushl %ecx # RamBase\r
123\r
124 subl %ecx, %edx\r
125 pushl %edx # RamSize\r
126\r
127 #\r
128 # Pass Control into the PEI Core\r
129 #\r
130 call ASM_PFX(SecStartup)\r