From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) by mx.groups.io with SMTP id smtpd.web11.488.1680909044106207727 for ; Fri, 07 Apr 2023 16:10:44 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@bsdio.com header.s=fm3 header.b=MzkEGCWQ; spf=pass (domain: bsdio.com, ip: 64.147.123.25, mailfrom: rebecca@bsdio.com) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id E7D0D320084E; Fri, 7 Apr 2023 19:10:42 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Fri, 07 Apr 2023 19:10:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdio.com; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1680909042; x=1680995442; bh=5b/0ydKdErBp/30c1K0fG8U4oRfBOzTI1Ky Bu/1AS6o=; b=MzkEGCWQ4Z+NB+YPNwTfnl2w5YmmKRDKYcgGx8TZbl06y0lI7Ol fThOzNbRRY8JIrcFCMG4zfOQzF0bXtQHoaXCeN4vwBtZqx1+TGOe6ksDCSyp/SGS ShYNy+LSvZkTlS53wexWPwaYgDyWoTezv2BEearMgoM78vVeiqzqXBPDDlfFm72d /MLov+Mb9cmAryTiwk2J63tqdhNJegxYTI9LYbHrEatsdGBIzl++JjQDBCf/dXeb i6y2MArahhzsBpkI0aVWnPli4X26EpXWFURqFcBnFIr/gwqe6S+k2xlxOZfyVmI+ MdM5X150ZgAcyH2mcXt6phRine5CEVOTfPA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1680909042; x=1680995442; bh=5b/0ydKdErBp/30c1K0fG8U4oRfBOzTI1Ky Bu/1AS6o=; b=JiftI4oDnsBhMvug1ekz68gCiPea9s3rHPAHAHh13V91qSkLXbt MMTj8LGatfzEihrY//bgtlZ4MctA6l0Xy8GUbs1O1FrqeLDjRxQTrtZiMf5KOIyw YNK59J53VlSFtDN2mCC0uWVsEvRcHFclHO/t2hhHdzAQ0zjcTswpg936gdD1u8aw Diu+4ybgqH19541L9qiuk5WxfcUEqnthSsKnI7Sh3Thy8XmgGVVl0UAMlmtBrBSn lJFGuoZe7YMRQebugLwLC6I+g1fIqdt5yW60WK6fpPH9nT8TKM35KzisD9Binixa E0fNLYlU+nfxS2Z0f2gRxgMNoByY/eUsGdQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdejiedgudeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtfeejnecuhfhrohhmpeftvggs vggttggrucevrhgrnhcuoehrvggsvggttggrsegsshguihhordgtohhmqeenucggtffrrg htthgvrhhnpeetgeejgfefffelfedtleehfeeuhfeutdffueduhfejteduvdekveekteef vdelkeenucffohhmrghinhepghhrohhuphhsrdhiohenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehrvggsvggttggrsegsshguihhordgtohhm X-ME-Proxy: Feedback-ID: i5b994698:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 7 Apr 2023 19:10:41 -0400 (EDT) Message-ID: Date: Fri, 7 Apr 2023 17:10:40 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Subject: Re: [edk2-devel] [PATCH v2 1/1] MdePkg: Add new JedecJep106Lib to fetch JEDEC JEP106 manufacturer To: devel@edk2.groups.io, michael.d.kinney@intel.com, "Liu, Zhiguang" , "Gao, Liming" Cc: Rebecca Cran References: <20230407161909.43499-1-rebecca@bsdio.com> <20230407161909.43499-2-rebecca@bsdio.com> <1753C85A6247B7C4.11060@groups.io> From: "Rebecca Cran" In-Reply-To: Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Sorry, not the struct - the array: STATIC CONST JEDEC_MANUFACTURERS *Jep106Manufacturers[] = {   Jep106ManufacturersBank1,   Jep106ManufacturersBank2,   Jep106ManufacturersBank3,   Jep106ManufacturersBank4,   Jep106ManufacturersBank5,   Jep106ManufacturersBank6,   Jep106ManufacturersBank7,   Jep106ManufacturersBank8,   Jep106ManufacturersBank9,   Jep106ManufacturersBank10,   Jep106ManufacturersBank11,   Jep106ManufacturersBank12,   Jep106ManufacturersBank13,   Jep106ManufacturersBank14 }; On 4/7/23 5:06 PM, Michael D Kinney wrote: > Which struct? That macro only applies to global variables, not structure declarations. > > Mike > > >> -----Original Message----- >> From: devel@edk2.groups.io On Behalf Of Rebecca Cran >> Sent: Friday, April 7, 2023 3:59 PM >> To: Kinney, Michael D ; devel@edk2.groups.io; Liu, Zhiguang ; Gao, Liming >> >> Cc: Rebecca Cran >> Subject: Re: [edk2-devel] [PATCH v2 1/1] MdePkg: Add new JedecJep106Lib to fetch JEDEC JEP106 manufacturer >> >> I guess GLOBAL_REMOVE_IF_UNREFERENCED should be added to the struct too? >> >> >> On 4/7/23 4:42 PM, Rebecca Cran wrote: >>> On 4/7/23 2:25 PM, Kinney, Michael D wrote: >>>> Comments below. >>>> >>>> Hopefully this lib would only be used by modules that get compressed. >>> I guess so, but that's for the user to decide. >>>> Might add GLOBAL_REMOVE_IF_UNREFERENCED to the arrays of strings to >>>> help the optimizer remove the data that is not referenced. >>> Good idea - I'll add that. >>> >>>>> +CONST CHAR8 * >>>>> +EFIAPI >>>>> +Jep106GetManufacturerName ( >>>>> +  IN UINT8  Code, >>>>> +  IN UINT8  ContinuationBytes >>>>> +  ) >>>>> +{ >>>>> +  UINTN                      Index; >>>>> +  CONST JEDEC_MANUFACTURERS  *ManufacturersBank; >>>>> + >>>>> +  Index = 0; >>>>> + >>>>> +  if (ContinuationBytes >= JEP106_MANUFACTURERS_NUM_BANKS) { >>>>> +    ASSERT (0); >>>> Do you really want an ASSERT() from this?  If this is data from a DIMM >>>> I doubt we want platform to ASSERT().  Perhaps just return NULL? >>> I'll remove it. I added it for validation when I was writing the SPD >>> parsing library. >>>>> +UINTN >>>>> +EFIAPI >>>>> +Jep106GetLongestManufacturerName ( >>>>> +  VOID >>>>> +  ) >>>> Why is this API needed?  Wouldn’t you really just need the >>>> longest of the ones present in the current boot to build the >>>> SMBIOS record?.  Not the longest of all in the banks? >>> I added it because it's useful to know the maximum possible size of >>> the strings that could be in the SMBIOS Type 17 table before doing the >>> SPD parsing. >>> >>> I'll remove it for now, and if it's really needed I can add it back in. >>> >>> >> >> >> > > > > >