public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Andrew Fish <afish@apple.com>
To: Marvin H?user <Marvin.Haeuser@outlook.com>
Cc: "edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Subject: Re: [MdeModulePkg/PeiCore] How is Data being NULL on entry ensured?
Date: Fri, 12 Aug 2016 19:47:17 -0700	[thread overview]
Message-ID: <2E6F056D-46C2-4B3F-AC41-F4EE47D339C5@apple.com> (raw)
In-Reply-To: <VI1PR06MB1792C370D7C5725632BCE87580100@VI1PR06MB1792.eurprd06.prod.outlook.com>


> On Aug 12, 2016, at 7:01 PM, Marvin H?user <Marvin.Haeuser@outlook.com> wrote:
> 
> Dear list subscribers,
> 
> I have just been looking around the PeiCore code and wondered, how it is ensured, that the third ("Data") argument of the entry point is NULL on the first run.
> EFI_PEI_CORE_ENTRY_POINT only has two arguments and hence most SEC implementations, including MdeModulePkg/SecCore, are going to pass only the first two arguments to the entry point.
> I'm aware that the code works and I have never seen an occasion of it failing or seeming to fail because of this design, though I wondered, how is it assured, that the third argument, which is not part of the first call, is being NULL on entry and not some leftover on the temporary stack/in the argument 3 register?
> 

Marvin,

The code you are looking for is in the entry point library. 

https://github.com/tianocore/edk2/blob/master/MdePkg/Library/PeiCoreEntryPoint/PeiCoreEntryPoint.c#L59

**/
VOID
EFIAPI 
_ModuleEntryPoint(
  IN CONST  EFI_SEC_PEI_HAND_OFF    *SecCoreData,
  IN CONST  EFI_PEI_PPI_DESCRIPTOR  *PpiList
)
{
  ProcessModuleEntryPointList (SecCoreData, PpiList, NULL);
  
  //
  // Should never return
  //
  ASSERT(FALSE);
  CpuDeadLoop ();  
}


ProcessModuleEntryPointList() call is auto-generated and it will cal the entry point listed in the PEI Core INF file. So that is why it is hard to grep for. 

Thanks,

Andrew Fish

> Thank you for your time!
> 
> Regards,
> Marvin.
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel



  reply	other threads:[~2016-08-13  2:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-13  2:01 [MdeModulePkg/PeiCore] How is Data being NULL on entry ensured? Marvin H?user
2016-08-13  2:47 ` Andrew Fish [this message]
2016-08-13  2:53   ` Marvin H?user

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2E6F056D-46C2-4B3F-AC41-F4EE47D339C5@apple.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox