summaryrefslogtreecommitdiffstats
path: root/UefiPayloadPkg/UefiPayloadEntry/X64/SecEntry.nasm
blob: 974cf777713e551d175e32669801b11438c2ca70 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
;------------------------------------------------------------------------------
;*
;*   Copyright (c) 2006 - 2020, Intel Corporation. All rights reserved.<BR>
;*   SPDX-License-Identifier: BSD-2-Clause-Patent

;------------------------------------------------------------------------------

#include <Base.h>

DEFAULT REL
SECTION .text

extern ASM_PFX(PayloadEntry)
extern  ASM_PFX(PcdGet32 (PcdPayloadStackTop))

;
; SecCore Entry Point
;
; Processor is in flat protected mode

global ASM_PFX(_ModuleEntryPoint)
ASM_PFX(_ModuleEntryPoint):

  ;
  ; Disable all the interrupts
  ;
  cli


  mov   rsp, FixedPcdGet32 (PcdPayloadStackTop)

  ;
  ; Push the bootloader parameter address onto new stack
  ;
  push  rcx
  mov   rax, 0
  push  rax ; shadow space
  push  rax
  push  rax
  push  rax

  ;
  ; Call into C code
  ;
  call  ASM_PFX(PayloadEntry)
  jmp   $