From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-in4.apple.com (mail-out4.apple.com [17.151.62.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 3D4F481ED2 for ; Tue, 15 Nov 2016 09:47:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; d=apple.com; s=mailout2048s; c=relaxed/simple; q=dns/txt; i=@apple.com; t=1479232039; 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=NNO8hBsOfs1M1gZdwXMj6yIdaoIyRsFres3p951AWgc=; b=C6ZtGyiVSks1qmHXE5fgLCzgncUaeI74utpC9zah0oozsKZfld+y/AMi4AjA/FN2 39XSzNWHxJEED+oaTw2UblUiEmvbZVbApdWKTgLVPOoUxb5062buKlHzyBFtuigS 2uc6nScNxBaP46L9CuG1fqTtdue5Qow4mODyQ2fK2oRuTnfwJhR9JU9SUD/PpCYB pERv64Rqw3PPuzKscrxpsjFdgoUIjL7KBQEDfZnZHXcwWY2DzUTijVXQ2gX69x9E zqBZkTMRygZaNZuTb+s/HgxzS+YOYfgLqHA5BzcROUScVIeae8ygGN1M8SnqV9YU 4r7/gJ4S1mNGoDGXJFNmGw==; Received: from relay6.apple.com (relay6.apple.com [17.128.113.90]) by mail-in4.apple.com (Apple Secure Mail Relay) with SMTP id 2E.0F.18952.72A4B285; Tue, 15 Nov 2016 09:47:19 -0800 (PST) X-AuditID: 11973e12-7490c9a000004a08-a7-582b4a278df9 Received: from chive.apple.com (chive.apple.com [17.128.115.15]) by relay6.apple.com (Apple SCV relay) with SMTP id 55.C2.23613.72A4B285; Tue, 15 Nov 2016 09:47:19 -0800 (PST) MIME-version: 1.0 Received: from da0601a-dhcp137.apple.com ([17.226.15.137]) by chive.apple.com (Oracle Communications Messaging Server 8.0.1.1.0 64bit (built Jun 15 2016)) with ESMTPSA id <0OGP00KHG2QVAA00@chive.apple.com>; Tue, 15 Nov 2016 09:47:19 -0800 (PST) Sender: afish@apple.com From: Andrew Fish Message-id: Date: Tue, 15 Nov 2016 09:47:18 -0800 In-reply-to: Cc: "edk2-devel@lists.01.org" To: Laszlo Ersek , Jeff Fan , Feng Tian , Mike Kinney References: <20161115083213.7700-1-jeff.fan@intel.com> X-Mailer: Apple Mail (2.3226) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrOLMWRmVeSWpSXmKPExsUi2FAYpavupR1h8OaKjsW6Pd/YLSbtZrc4 uX4Jo8WyYztYLDo6/jE5sHos3vOSyWPShcfMHu/3XWULYI7isklJzcksSy3St0vgyjh3ewlb wZ5exooVc1rZGhin1XQxcnJICJhIdN6ex9TFyMUhJLCXUeLnhEY2mMTl/btYIRIbGSVW77zH ApLgFRCU+DEZwmYWCJP4/3g+I0TRL0aJ5as6mEESwgLiEu/ObAKz2QSUJVbM/8AO0Wwj8eRK M1RNsMTBlgtAgzg4WARUJZ5+DgYJcwrYSdx/eoQZYr6ZRP/56cwg80UEJjBKnO9uA7tOSCBL 4uquv0wgvRICshKzf3mB1EgIvGaTmPPlOesERqFZSG6dheRWCFtL4vujVqA4B5AtL3HwvCxE WFPi2b1P7BC2tsSTdxdYFzCyrWIUyk3MzNHNzDPRSywoyEnVS87P3cQIipnpdkI7GE+tsjrE KMDBqMTD66GqHSHEmlhWXJl7iFGag0VJnPetJVBIID2xJDU7NbUgtSi+qDQntfgQIxMHp1QD 43q+czeF9lvIvz57XFala9fr1M3PNWaL2t16lLLpRMqK0IsCPUamm205baJkDC8ed9v84+RR kctWTOrFcq7PC9+n3nNdJfQmzan62jWXdU+ftN4/+tykb07YoYqjNnPKnr8unCvp+WiqzmUb +w+MfNe2HwyR3TuvbK/uz+kf/dYafJ8ZHrTzlZsSS3FGoqEWc1FxIgBViT3EegIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrLIsWRmVeSWpSXmKPExsUi2FDMr6vupR1hMH+FisW6Pd/YLSbtZrc4 uX4Jo8WyYztYLDo6/jE5sHos3vOSyWPShcfMHu/3XWULYI7isklJzcksSy3St0vgyjh3ewlb wZ5exooVc1rZGhin1XQxcnJICJhIXN6/ixXCFpO4cG89WxcjF4eQwEZGidU777GAJHgFBCV+ TIawmQXCJP4/ns8IUfSLUWL5qg5mkISwgLjEuzObwGw2AWWJFfM/sEM020g8udIMVRMscbDl AtAgDg4WAVWJp5+DQcKcAnYS958eYYaYbybRf346M8h8EYEJjBLnu9vYQBJCAlkSV3f9ZQLp lRCQlZj9y2sCo8AsJOfNQnIehK0l8f1RK1CcA8iWlzh4XhYirCnx7N4ndghbW+LJuwusCxjZ VjEKFKXmJFaa6SUWFOSk6iXn525iBId+YdQOxoblVocYBTgYlXh4PVS1I4RYE8uKK3MPMUpw MCuJ8PJbAoV4UxIrq1KL8uOLSnNSiw8xTmQE+nEis5Rocj4wMvNK4g1NTAxMjI3NjI3NTcxp KawkzmsuqhUhJJCeWJKanZpakFoEcxQTB6dUA2NG/5fqqDyp7Jsfvi+IWXnTjaHSofR+5LK4 ieEJfxh3LdW16eufGxv9Pe+WytyNNyP/OmbdcJijeer8KbFr6xgi/QQlrrV3FevLfby73+Fx F8vP3asUs/0kf/bpezB1coZ3JCZZHtu3/NqMXIkaT42Ou1orqtsl8oSeCwd+fiNay/5RspEt T4mlOCPRUIu5qDgRALrZjlHwAgAA X-Content-Filtered-By: Mailman/MimeDel 2.1.21 Subject: Re: [PATCH] UefiCpuPkg/SecCore: Use %x to print stack information 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: Tue, 15 Nov 2016 17:47:15 -0000 Content-Type: text/plain; CHARSET=US-ASCII Content-Transfer-Encoding: 7BIT > On Nov 15, 2016, at 8:59 AM, Laszlo Ersek wrote: > > On 11/15/16 09:32, Jeff Fan wrote: >> SecCoreData->StackBase is VOID * type and SecCoreData->StackSize is UINTN type. >> We should use %x to dump their value instead of %lx. >> >> Cast pointer type to UINTN before print it. >> >> Cc: Feng Tian >> Cc: Michael D Kinney >> Contributed-under: TianoCore Contribution Agreement 1.0 >> Signed-off-by: Jeff Fan >> --- >> UefiCpuPkg/SecCore/SecMain.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/UefiCpuPkg/SecCore/SecMain.c b/UefiCpuPkg/SecCore/SecMain.c >> index 2ebbc22..4d08f48 100644 >> --- a/UefiCpuPkg/SecCore/SecMain.c >> +++ b/UefiCpuPkg/SecCore/SecMain.c >> @@ -239,9 +239,9 @@ SecStartupPhase2( >> >> DEBUG (( >> DEBUG_INFO, >> - "%a() Stack Base: 0x%lx, Stack Size: 0x%lx\n", >> + "%a() Stack Base: 0x%x, Stack Size: 0x%x\n", >> __FUNCTION__, >> - SecCoreData->StackBase, >> + (UINTN) SecCoreData->StackBase, >> SecCoreData->StackSize >> )); >> >> > > Not disagreeing, just mentioning for completeness: we can also use %p > for printing (VOID*) directly. > %x is sizeof(int) not sizeof(UINTN)? So it seems %p would be more correct? Or we should just use UINT32 if that is what is intended. https://github.com/tianocore/edk2/blob/master/MdePkg/Include/Library/PrintLib.h#L80 - x - The argument is an unsigned hexadecimal number. The characters used are 0..9 and A..F. If the flag 'L' is not specified, then the argument is assumed to be size int. This does not follow ANSI C. Thanks, Andrew Fish > Thanks > Laszlo > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel