From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by mx.groups.io with SMTP id smtpd.web10.7030.1584010532872712707 for ; Thu, 12 Mar 2020 03:55:33 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=iTtA4uEH; spf=pass (domain: nuviainc.com, ip: 209.85.128.68, mailfrom: leif@nuviainc.com) Received: by mail-wm1-f68.google.com with SMTP id m3so5725828wmi.0 for ; Thu, 12 Mar 2020 03:55:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuviainc-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=qQA8phjWa8dRyCxczdEEt3cWpohI2A+zSENKQffXthc=; b=iTtA4uEHGFKDLYs07COx5BMCyxa7IgATkqmg6IhNlOmHNiz4ggtu/jXu2W0Yur2bc9 iIcuLf4Rx3Oac9beMC7IR8VawFMoceMo//CpUs1xNq8ZKhjhQw5KJd0gJsj6wYP4wPRN WwUazawk5kA7vavfYmgRl8aRi3+XdPgPCFRZ9NX2NQg5HbKB4yNPxQ32sxRXuEt/TyPS 2s9z1QKbyCZ7+OJGYNyGup0RCZUukPfWmUUDMazf4AuMFvSSHlp3pu0j1TqNi8Fdgw6G zyHi9RuBnJJudUKbja3y2Rd6atp+bcCtAgq+X/moRLcb33fBJsMbLnj0za0EMpPjNmuf xQ4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=qQA8phjWa8dRyCxczdEEt3cWpohI2A+zSENKQffXthc=; b=UfkzX3Qku/3QYjcCIcXAa1PI3WnnL0MtTG+hOEcVx9ZUKvU73tLNMy7u186EyXDTe0 9tlCOtJ5E2bJevR1o7hwYuTH6swAJmnzuorVRLJ8B6SV+D7HNKAOGbeRD4y/X6KnPtUl d7AYxUSDUx2or3J9BLIRvhIuZW5jQJmcyxu4q7zIU9FvHe25e2wa802AsUX/YualGWvm sFpLTgB1y/2s2O7VloYBmgij5L2wMNEBmAuXH+Va4KXD7jQC5BuzpsprpibNIXtdxjf1 hkP4RqA9aPdIp/PAlkZADUIVtKRKi9YsyPC7tmzShaGf4USMYvCQQ/jZLQvwioi0RI0R wrCg== X-Gm-Message-State: ANhLgQ0Y6ck9HpJgpZAVcg78zGzjYCOBd5Zp2jUO3tYAPlbM7RXK8dQw s3MErw50CYGRGP+itYWK88ECtU1/DkbqOMXYMgHS4k4czxCJ8CCfuLZ1LovUQzRczjBb3moT8iA 2ySHBVZBRu547do6GcTQwge9cyP6ePeD+UG+1mXKhE0K/eFShs50WcE3NcJaXjN0= X-Google-Smtp-Source: ADFU+vvA5jk8uCFY2Vts1euJUjZos8AAqt55MBcTJBrkOOQQIWagO66Oi9XlnRXCXXXK2f8KqLZiqg== X-Received: by 2002:a7b:c0c7:: with SMTP id s7mr4153218wmh.187.1584010530886; Thu, 12 Mar 2020 03:55:30 -0700 (PDT) Return-Path: Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id t1sm28549609wrq.36.2020.03.12.03.55.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Mar 2020 03:55:29 -0700 (PDT) Date: Thu, 12 Mar 2020 10:55:28 +0000 From: "Leif Lindholm" To: devel@edk2.groups.io, daniel.schaefer@hpe.com Cc: Abner Chang , Gilbert Chen , Dandan Bi , Eric Dong Subject: Re: [edk2-devel] [PATCH v2 3/3] MdeModulePkg: Use CopyMem instead of GUID assignment Message-ID: <20200312105528.GC23627@bivouac.eciton.net> References: <20200302103238.25726-1-daniel.schaefer@hpe.com> <20200302103238.25726-4-daniel.schaefer@hpe.com> MIME-Version: 1.0 In-Reply-To: <20200302103238.25726-4-daniel.schaefer@hpe.com> User-Agent: Mutt/1.10.1 (2018-07-13) Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi Daniel, There is nothing wrong with this patch that just went in (and I should have called out sooner if I wanted to stop it), but I think a better solution is to implement a RISC-V variant of ArmPkg/Library/CompilerIntrinsicsLib/. It is perfectly valid for the compiler to generate memcpy calls in response to struct operations that are perfectly valid C. In fact, we could consider moving the ArmPkg one over into MdeModulePkg. I have a feeling that including a NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf in your current build would be an alternative solution to your compilation error. / Leif On Mon, Mar 02, 2020 at 11:32:38 +0100, Daniel Schaefer wrote: > GCC translates a simple assignment to memcpy, which EDKII doesn't provide. > See: https://www.mail-archive.com/edk2-devel@lists.01.org/msg11928.html > > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2547 > > Signed-off-by: Daniel Schaefer > Cc: Abner Chang > Cc: Gilbert Chen > Cc: Leif Lindholm > Cc: Dandan Bi > Cc: Eric Dong > --- > > Notes: > v2: > - Use CopyMem instead of CopyGuid [Dandan] > > MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c b/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c > index 5cc527679a78..0540e6fa8a44 100644 > --- a/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c > +++ b/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c > @@ -619,7 +619,7 @@ CreateDeviceManagerForm( > TokenHelp = HiiSetString (HiiHandle, 0, String, NULL); > FreePool (String); > > - FormSetGuid = ((EFI_IFR_FORM_SET *)Ptr)->Guid; > + CopyMem (&FormSetGuid, &((EFI_IFR_FORM_SET *) Ptr)->Guid, sizeof (EFI_GUID)); > > // > // Network device process > -- > 2.25.0 > > > >