From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.61]) by mx.groups.io with SMTP id smtpd.web09.6236.1579778496020957461 for ; Thu, 23 Jan 2020 03:21:36 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=UfuVpe1k; spf=pass (domain: redhat.com, ip: 205.139.110.61, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579778495; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zOTdWOkpIAwxW1856wtxPB7OhU/9+aLE3qhdR2Q+Apo=; b=UfuVpe1k0Nw73L6Krw0cs4KJeNXp2yme287z8VRF8RFxfIUSxtVB1tC/K5nAXIhnEd+zHG Ge66KcWHYcFTiPyZejveVrUGJpjOatgXHRdYIbCIYohBbTiZhKVi1CambR3ZqkcD3kXIHZ rMZLvDRJtiXbORy/lCnvVjI8X+eyV2s= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-168-TCpJYGgeNCiMomT0KajhOA-1; Thu, 23 Jan 2020 06:21:33 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 27FD2DB60; Thu, 23 Jan 2020 11:21:32 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-117-226.ams2.redhat.com [10.36.117.226]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8BCE419C69; Thu, 23 Jan 2020 11:21:31 +0000 (UTC) Subject: Re: [edk2-devel] PCD EX interface. To: Ken_Taylor@phoenix.com References: <2fb8e97b19214251bf25f44c7b4149a3@SCL-EXCHMB-13.phoenix.com> From: "Laszlo Ersek" Cc: devel@edk2.groups.io Message-ID: Date: Thu, 23 Jan 2020 12:21:30 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <2fb8e97b19214251bf25f44c7b4149a3@SCL-EXCHMB-13.phoenix.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MC-Unique: TCpJYGgeNCiMomT0KajhOA-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Hi Ken, On 01/23/20 02:37, Ken Taylor wrote: > If I try to get the size of a DynamicEx PCD in the context of a BIOS > build for which that PCD is undefined, the call locks up. I expected > to just get a size of 0, since the PCD is not defined in the build > context of the PCD DXE service. Is this a problem that's been fixed > since my BIOS source code was cut? What can I do for older builds > that haven't been fixed (and probably never will)? Do I have to just > accept that I'm going to get garbage or lockup if I run my shell > utility on some builds? Do I have to write a DXE driver and expose a > protocol, just so I can know if that PCD exists and is properly > defined? I think the ASSERT() that you run into is the one in GetExPcdTokenNumber(), file "MdeModulePkg/Universal/PCD/Dxe/Service.c": > MatchGuid = ScanGuid (GuidTable, mDxeGuidTableSize, Guid); > // > // We need to ASSERT here. If GUID can't be found in GuidTable, this is a > // error in the BUILD system. > // > ASSERT (MatchGuid != NULL); Can you try the following: - Locate EFI_PCD_PROTOCOL. - Call EFI_PCD_PROTOCOL.GetNextTokenSpace() in a loop, until you find the GUID of your own token space GUID, or the function returns an error. - If your token space GUID has been found, call PcdGetEx8(). Thanks, Laszlo