SecEntry.nasm 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. ; @file
  2. ; Copyright (c) 2006 - 2019 Intel Corporation. All rights reserved. <BR>
  3. ;
  4. ; SPDX-License-Identifier: BSD-2-Clause-Patent
  5. ;
  6. #include <Base.h>
  7. DEFAULT REL
  8. SECTION .text
  9. extern ASM_PFX(SecCoreStartupWithStack)
  10. ;
  11. ; SecCore Entry Point
  12. ;
  13. ; Processor is in flat protected mode
  14. ;
  15. ; @param[in] RAX Initial value of the EAX register (BIST: Built-in Self Test)
  16. ; @param[in] DI 'BP': boot-strap processor, or 'AP': application processor
  17. ; @param[in] RBP Pointer to the start of the Boot Firmware Volume
  18. ;
  19. ; @return None This routine does not return
  20. ;
  21. global ASM_PFX(_ModuleEntryPoint)
  22. ASM_PFX(_ModuleEntryPoint):
  23. ;
  24. ; Load temporary RAM stack based on PCDs
  25. ;
  26. %define SEC_TOP_OF_STACK (FixedPcdGet32 (PcdSimicsSecPeiTempRamBase) + \
  27. FixedPcdGet32 (PcdSimicsSecPeiTempRamSize))
  28. mov rsp, SEC_TOP_OF_STACK
  29. nop
  30. ;
  31. ; Setup parameters and call SecCoreStartupWithStack
  32. ; rcx: BootFirmwareVolumePtr
  33. ; rdx: TopOfCurrentStack
  34. ;
  35. mov rcx, rbp
  36. mov rdx, rsp
  37. sub rsp, 0x20
  38. call ASM_PFX(SecCoreStartupWithStack)