]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryCommon.nasm
IntelFsp2Pkg: Add missing OEM status code defines.
[mirror_edk2.git] / IntelFsp2Pkg / FspSecCore / Ia32 / FspApiEntryCommon.nasm
CommitLineData
cf1d4549
JY
1;; @file\r
2; Provide FSP API entry points.\r
3;\r
4; Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>\r
5; This program and the accompanying materials\r
6; are licensed and made available under the terms and conditions of the BSD License\r
7; which accompanies this distribution. The full text of the license may be found at\r
8; http://opensource.org/licenses/bsd-license.php.\r
9;\r
10; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12;;\r
13\r
14 SECTION .text\r
15\r
16;\r
17; Following functions will be provided in C\r
18;\r
19extern ASM_PFX(Loader2PeiSwitchStack)\r
20extern ASM_PFX(FspApiCallingCheck)\r
21\r
22;\r
23; Following functions will be provided in ASM\r
24;\r
25extern ASM_PFX(FspApiCommonContinue)\r
26extern ASM_PFX(AsmGetFspInfoHeader)\r
27\r
28;----------------------------------------------------------------------------\r
29; FspApiCommon API\r
30;\r
31; This is the FSP API common entry point to resume the FSP execution\r
32;\r
33;----------------------------------------------------------------------------\r
34global ASM_PFX(FspApiCommon)\r
35ASM_PFX(FspApiCommon):\r
36 ;\r
37 ; EAX holds the API index\r
38 ;\r
39\r
40 ;\r
41 ; Stack must be ready\r
42 ;\r
43 push eax\r
44 add esp, 4\r
45 cmp eax, dword [esp - 4]\r
46 jz FspApiCommon1\r
47 mov eax, 080000003h\r
48 jmp exit\r
49\r
50FspApiCommon1:\r
51 ;\r
52 ; Verify the calling condition\r
53 ;\r
54 pushad\r
55 push DWORD [esp + (4 * 8 + 4)] ; push ApiParam\r
56 push eax ; push ApiIdx\r
57 call ASM_PFX(FspApiCallingCheck)\r
58 add esp, 8\r
59 cmp eax, 0\r
60 jz FspApiCommon2\r
61 mov dword [esp + (4 * 7)], eax\r
62 popad\r
63exit:\r
64 ret\r
65\r
66FspApiCommon2:\r
67 popad\r
68 cmp eax, 3 ; FspMemoryInit API\r
69 jz FspApiCommon3\r
70\r
71 call ASM_PFX(AsmGetFspInfoHeader)\r
72 jmp ASM_PFX(Loader2PeiSwitchStack)\r
73\r
74FspApiCommon3:\r
75 jmp ASM_PFX(FspApiCommonContinue)\r
76\r