From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-in7.apple.com (mail-out7.apple.com [17.151.62.29]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id E13DE1A1E04 for ; Fri, 12 Aug 2016 19:47:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; d=apple.com; s=mailout2048s; c=relaxed/simple; q=dns/txt; i=@apple.com; t=1471056438; x=2334970038; h=From:Sender:Reply-To:Subject:Date:Message-id:To:Cc:MIME-version:Content-type: Content-transfer-encoding:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-reply-to:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=0PF9e9RDstmzORCJPc6nR2uS8EwHM7rKNjik5YVEKyE=; b=qSuspge0QjCOK5PPeXbmUA36pEe8A9eP/PgD93RW/saaPTNM3XEpYxTV9PrsEwjA aFJRGwumjJ3+QwcPsJgPJ8qpXX5ikGzG+pi0ezGEunyWvAwMjSx+iBUi2LxwKif2 uMJun662dRrBMGSWxvVlLSGy52xlc8x50Q4nTlDy+yNxKuc4a0clpzzSF10angcD cIJmBqYiaHbztlBX4X8Wl+nirxVUurPgiGm7qr5yG9yXyCiyOhns8vUVVXl6pt5E SGTRNlhmxhkp3fofZHgm5c+an6XWPtB8gN2qLOpf33M8zZH/YTSVJleG/GJx+o19 GAWHV/QSZyI+OnhpbX7P9w==; Received: from relay5.apple.com (relay5.apple.com [17.128.113.88]) by mail-in7.apple.com (Apple Secure Mail Relay) with SMTP id 2E.06.17422.63A8EA75; Fri, 12 Aug 2016 19:47:18 -0700 (PDT) X-AuditID: 11973e16-f793f6d00000440e-ab-57ae8a360e18 Received: from nwk-mmpp-sz11.apple.com (nwk-mmpp-sz11.apple.com [17.128.115.155]) by relay5.apple.com (Apple SCV relay) with SMTP id E5.D5.30701.63A8EA75; Fri, 12 Aug 2016 19:47:18 -0700 (PDT) MIME-version: 1.0 Received: from [17.153.71.106] by nwk-mmpp-sz11.apple.com (Oracle Communications Messaging Server 8.0.1.1.0 64bit (built Jun 15 2016)) with ESMTPSA id <0OBT0024GUETDE60@nwk-mmpp-sz11.apple.com>; Fri, 12 Aug 2016 19:47:18 -0700 (PDT) Sender: afish@apple.com From: Andrew Fish In-reply-to: Date: Fri, 12 Aug 2016 19:47:17 -0700 Cc: "edk2-devel@lists.01.org" Message-id: <2E6F056D-46C2-4B3F-AC41-F4EE47D339C5@apple.com> References: To: Marvin H?user X-Mailer: Apple Mail (2.3112) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrOLMWRmVeSWpSXmKPExsUi2FAYoWvWtS7cYOVJBYs9h44yW7z9f5Xd gcmje/Y/Fo/Nr18wBzBFcdmkpOZklqUW6dslcGV8u7OIuaCRt+Lk4U9MDYz7uLoYOTkkBEwk /jedY4SwxSQu3FvP1sXIxSEksJdRYubq/0wwRVc+rGaGSBxilLjT8IMNJMErICjxY/I9li5G Dg5mAXmJg+dlQcLMAloS3x+1skDUv2OUaO/4zg6SEBYQl3h3ZhMzhB0q0TjnEthmNgFliRXz P4DVcArES6xbPAssziKgKjFlRy8zxFBziRkXvjBB7LWRWLZ7A1hcSCBO4uSR4ywgtoiAnsSy p+9YII6Wldi3YQHYNxICW9gkTkw+yDqBUWQWkrtnIdw9C8ndCxiZVzEK5SZm5uhm5pnrJRYU 5KTqJefnbmIEhfx0O7EdjA9XWR1iFOBgVOLh/cC5LlyINbGsuDL3EKM0B4uSOK+4+NpwIYH0 xJLU7NTUgtSi+KLSnNTiQ4xMHJxSDYyJdT1Wzf1/lr+8sl/hSNQMv83u/5j8b327c/cjS9Yv 3tlyu68EdRvdfliftP3Z3/QPijxHW+T0f8dZ7RS0s1ibJGXHWS0vpXt3v93xqAV/WOT6jnyI emfypapD9OI0eU+ZJ0UzmoM/7PMwP6l8MPTMq+eKQlN+v3wiwhMj/DTj7YUt3llcf2uUWIoz Eg21mIuKEwHvkXHCWgIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpikeLIzCtJLcpLzFFi42IRbCierWvWtS7coP+vrMWeQ0eZLd7+v8ru wOTRPfsfi8fm1y+YA5iiuGxSUnMyy1KL9O0SuDK+3VnEXNDIW3Hy8CemBsZ9XF2MnBwSAiYS Vz6sZoawxSQu3FvP1sXIxSEkcIhR4k7DDzaQBK+AoMSPyfdYuhg5OJgF5CUOnpcFCTMLaEl8 f9TKAlH/jlGiveM7O0hCWEBc4t2ZTcwQdqhE45xLjCA2m4CyxIr5H8BqOAXiJdYtngUWZxFQ lZiyo5cZYqi5xIwLX5gg9tpILNu9ASwuJBAncfLIcRYQW0RAT2LZ03csEEfLSuzbsIBtAqPg LCSnzkI4dRaSUxcwMq9iFChKzUmsNNVLLCjISdVLzs/dxAgO0cKIHYz/l1kdYhTgYFTi4f3A uS5ciDWxrLgyFxgWHMxKIrxH2oBCvCmJlVWpRfnxRaU5qcWHGJOB7p/ILCWanA+Mn7ySeEMT EwMTY2MzY2NzE3PShJXEeW87Aa0QSE8sSc1OTS1ILYLZwsTBKdXAuNp+dr+CyG2r5QltBVts vxlpT9jQUHp6wvk5PixHtlzwf2N9nOf3xelqR2zt410PHvm5IE6PIaeaU1FHYfnj1wyfl73T vsGlXfp63gprr8/b/pj3bXoX2iXDvfFk98bPLjnPLsVvVizTnr3+1p7pTssWVNqaW143eXCB XztgW06QefUW6T2LjyixFGckGmoxFxUnAgAKKv9QlQIAAA== Subject: Re: [MdeModulePkg/PeiCore] How is Data being NULL on entry ensured? X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Aug 2016 02:47:19 -0000 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII > On Aug 12, 2016, at 7:01 PM, Marvin H?user 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