From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=17.171.2.32; helo=mail-in22.apple.com; envelope-from=afish@apple.com; receiver=edk2-devel@lists.01.org Received: from mail-in22.apple.com (mail-out22.apple.com [17.171.2.32]) (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 EFE3C2034B9EB for ; Thu, 14 Dec 2017 02:22:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; d=apple.com; s=mailout2048s; c=relaxed/simple; q=dns/txt; i=@apple.com; t=1513247237; 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=fdNaL/iAkbraMWmtvL4DU6h56lwqmxsfJTwrkjHLw+s=; b=UihNvtXmWX313S0gV0VdQo4YIpTj9CqO3a7hCJSE5OecKY11Mgct02iUl1ZvMPin S1Z3UNnoZeZh8nFjERtjCJiq7WfKka6NX4zkZYFOnwVIB6yHESVqbCi0bca4M5HS 7yWQOv2MY4puSqzWAlhuhqtpUqHrQ4W70TgpLfmslASZXAfNQbbm6Z1Feoz6zEA8 X6B0L5rgZF/7YYEzgd9OZTABhkWThWYKFWufem4ppHr3tAfGEDhNOSpZ04AL/gXt Q7HULAUuPnRJ4JBNbnUpayDL4uiNFgNbA+G9RRRpbzbmVvmMCCT9Bw+xkNz6mYT2 dfWuoUijcU3U+adJzdiXpg==; Received: from relay2.apple.com (relay2.apple.com [17.128.113.67]) (using TLS with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mail-in22.apple.com (Apple Secure Mail Relay) with SMTP id A2.66.08992.502523A5; Thu, 14 Dec 2017 02:27:17 -0800 (PST) X-AuditID: 11ab0216-f73ff70000002320-76-5a3252052ccd Received: from nwk-mmpp-sz12.apple.com (nwk-mmpp-sz12.apple.com [17.128.115.204]) by relay2.apple.com (Apple SCV relay) with SMTP id 23.CA.07440.402523A5; Thu, 14 Dec 2017 02:27:16 -0800 (PST) MIME-version: 1.0 Received: from [17.234.52.186] by nwk-mmpp-sz12.apple.com (Oracle Communications Messaging Server 8.0.2.1.20171204 64bit (built Dec 4 2017)) with ESMTPSA id <0P0Y00G7F51GYF80@nwk-mmpp-sz12.apple.com>; Thu, 14 Dec 2017 02:27:16 -0800 (PST) Sender: afish@apple.com From: Andrew Fish X-Priority: 3 In-reply-to: <2382af2.ac98.160543fea54.Coremail.sssky307@163.com> Date: Thu, 14 Dec 2017 02:27:15 -0800 Cc: edk2-devel@lists.01.org Message-id: References: <2382af2.ac98.160543fea54.Coremail.sssky307@163.com> To: krishnaLee X-Mailer: Apple Mail (2.3445.5.20) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrALMWRmVeSWpSXmKPExsUi2FDorMsaZBRlcGm9lcWeQ0eZLeb3vGZ2 YPJYvGIKq0f37H8sAUxRXDYpqTmZZalF+nYJXBmLNp1jLjh2jrFi7vbaBsYF2xi7GDk5JARM JO5t+szWxcjFISSwhkni1sQ3zF2MHGCJjk2+EPFDjBJbLk0Aa+AVEJT4MfkeC4jNLBAm0TBt HSuILSTwlVHi+HYLEFtYQFzi3ZlNzBC2lcTvt+/ZQGw2AWWJFfM/sEMs5pWY0f4UbA6ngKNE f/ccsBoWAVWJtvd3oOZLSzyceJwVYq+NRF/TXDaIXQ4Sfavfg80XEVCU2DLxMNRMJYnp32+D PSMhsIRN4tOnlcwTGIVnIbl7FpK7IWwtie+PWoHiHEC2vMTB87IQYU2JZ/c+sUPY2hJP3l1g XcDItopRODcxM0c3M8/ISC+xoCAnVS85P3cTIyhKVjOJ7WC899rwEKMAB6MSDy+HgWGUEGti WXFl7iFGaQ4WJXHeD3N0ooQE0hNLUrNTUwtSi+KLSnNSiw8xMnFwSjUwKqyt+PVyXXgWs0+o gUXIkaNBvwRmL+Q8t7w4N1DUL/pqucTrp/ubZnb2nHlyYEel+jUJb+vmax6X/m9sXLvq56db 6zyitlepZ0guE9joMv3IAybdAM/8uLIL1ud3Wa4LEubLWa9d5sdcLRc7IS079AkbT0mmW+ui SrUte+LTP1p7zL16412HEktxRqKhFnNRcSIA79teoXMCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrILMWRmVeSWpSXmKPExsUi2FB8Rpc1yCjK4A6TxZ5DR5kt5ve8ZnZg 8li8YgqrR/fsfywBTFFcNimpOZllqUX6dglcGYs2nWMuOHaOsWLu9toGxgXbGLsYOTgkBEwk Ojb5djFycQgJHGKU2HJpAlCck4NXQFDix+R7LCA2s0CYRMO0dawgtpDAV0aJ49stQGxhAXGJ d2c2MUPYVhK/375nA7HZBJQlVsz/wA5iSwjwSsxofwo2h1PAUaK/ew5YDYuAqkTb+ztQ86Ul Hk48zgqx10air2kuG8QuB4m+1e/B5osIKEpsmXgYaqaSxPTvt9kmMArMQnLqLCSnQthaEt8f tQLFOYBseYmD52UhwpoSz+59YoewtSWevLvAuoCRbRWjQFFqTmKlkV5iQUFOql5yfu4mRnBA FzrvYDy2zOoQowAHoxIPL4eBYZQQa2JZcWUuMLw4mJVEeNUmAoV4UxIrq1KL8uOLSnNSiw8x SnOwKInzztyvFyUkkJ5YkpqdmlqQWgSTZeLglGpgrA0qCd+eNrN6Y4O44yfeKRttPrUHKAa9 +8GWfIvni6f+o0dBdd/+TvZYxfsj+5NontLOj4Lh65tCVizc/VXad9LpA3Pep11Mq59cyvh2 aRTD/f3n537b91ZjS3SlmUDgutm/laUbFnXvDAg02++Wvdhzn8DmoNrgkMjsc12xppt4b53e cM/FRomlOCPRUIu5qDgRAFOhqulkAgAA X-Content-Filtered-By: Mailman/MimeDel 2.1.22 Subject: Re: How to using PcdGetEx to change a PCD. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Dec 2017 10:22:38 -0000 Content-Type: text/plain; CHARSET=US-ASCII Content-Transfer-Encoding: 7BIT > On Dec 14, 2017, at 12:59 AM, krishnaLee wrote: > > Hello, > I am learning and writing a application to change the Nt32pkg-virtual machine's boot time.follow code is success. > but I think if I using PcdGetEx16 function, it will also work well,but failed when I compile it. > I had read some Specs about the difference between PcdGetEx and PcdGet,but I can't understand,maybe I need some practice, > So can anyone modify it to using PcdGetEx to implement the same function in the application? > //source-code--start Did you add: #include and list gEfiMdePkgTokenSpaceGuid in the [Guids] section of the INF. In general it is hard to comment on compiler failures in fragments of code. If you post the actual compiler error it is easier to explain. The PCDs are a GUID + token number namespace for config. Since anyone can define a GUID that does not conflict it allows arbitrary extension without conflict. The Ex form of the API includes the GUID + token number. The non Ex form is a size optimization that uses a build generated token space. So generally if everything is built together then you use the non Ex form to save space. If different binaries that got compiled in different places need to work together then the Ex form is required. Thanks, Andrew Fish > EFI_STATUS > EFIAPI > UefiMain ( > IN EFI_HANDLE ImageHandle, > IN EFI_SYSTEM_TABLE *SystemTable > ) > { > UINTN buffer=0; > UINTN index; > buffer=PcdGet16(PcdPlatformBootTimeOut); > //buffer=PcdGetEx16(&gEfiMdePkgTokenSpaceGuid,PcdPlatformBootTimeOut);//compile failed. > Print(L"buffer:%d\n",buffer); > PcdSet16(PcdPlatformBootTimeOut,5); > ... > > > //source-code-end. > > > attachment is the full source code. > edk2-vUDK2017's build command: > build -p Nt32Pkg\Nt32Pkg.dsc -m Nt32Pkg\Application\mytestpcd2\mytestpcd2.inf > > > thank you very much! > > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel