From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=w2JQPaJH; spf=pass (domain: linaro.org, ip: 209.85.221.67, mailfrom: leif.lindholm@linaro.org) Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by groups.io with SMTP; Mon, 15 Apr 2019 03:16:42 -0700 Received: by mail-wr1-f67.google.com with SMTP id w1so21176572wrp.2 for ; Mon, 15 Apr 2019 03:16:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ySs0lP4dSmLyA6kFKWm/jLaU0EQpSFiWJ53Y9EHsT88=; b=w2JQPaJHFkSgp4erIiBwyi45PNw58JRR8gbS1a1c4psn8QutTUMV6lHpotkk/TSBrt WstJFxkSFvajhmAaX6hqrCHANdTSSCahhuaXSjut1uhBjuX7OjnxGZF6eYp/4O8UiZG7 JD/s9tQVCtl6k5yFCxrjkj97zT07XLXoanIEXEkpD8tBh/++GUyLyQtCqxbNGOlpob9L v/HTC9e88SWD90rSWt9GObUv+Bm5NCJkMwqdR25u+mI9axFoi5iR6/dk7Q83HBamQMcv AK6PsVWGmnNGcnE2zGjv6KYClf5oSu0R6JlZ8+E2yGIeJ38uLCgQ3ruWrBtB+BYYRaDc nxMQ== 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=ySs0lP4dSmLyA6kFKWm/jLaU0EQpSFiWJ53Y9EHsT88=; b=k1EjdIrQmj98arQt4Y3w9+SNcwSWcpbqjct+R4i55jGo8+AHPz8mZuALwimBgKtwAd 98xVXJrFQpFLAT32lLRaPiUB6zKOc47/HEfpELo53N78p88KHzh6x8hl89MVTgIy9zLL h54gchl1VNKZb0zTAejeuy11gHaoYEYgBuJ9I96kvDaP2sD5jOVnvYTb7sq78aIOSC55 lbWf1Ye8oMrzjQPjtHgM1TmygOAF03+EXUspdXvG6ljx+synnUpaq3cxfF/g84Wo+1qK TsCUpouD1cDVjotxKoimStqx4GimN7nrG3AY0RAwFW8rwXoaFTMfBi/qO3yy3Bv0vpgm HyrQ== X-Gm-Message-State: APjAAAWmVPCDavm3hMe+5Pi6N5GO2WxaPKZ5gCv8B9CfQQSjMIpYCYui G4lVcufF6ZTQ57jaDS3mVV7+9Q== X-Google-Smtp-Source: APXvYqwdLOedPnSINOZjaVCI+0ZNokuZ2/Y41KBQAhvnF8fkHUkeClMw94TxaPZcD1mWrkHnaEG5sA== X-Received: by 2002:a5d:46c9:: with SMTP id g9mr43840022wrs.211.1555323400344; Mon, 15 Apr 2019 03:16:40 -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 17sm13962754wmk.39.2019.04.15.03.16.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 15 Apr 2019 03:16:39 -0700 (PDT) Date: Mon, 15 Apr 2019 11:16:38 +0100 From: "Leif Lindholm" To: Zhichao Gao Cc: devel@edk2.groups.io, Ard Biesheuvel , Michael D Kinney , Liming Gao , Thomas Panakamattam Abraham Subject: Re: [edk2-platforms PATCH] Platform/ResetSystemLib: Add a new API ResetSystem Message-ID: <20190415101638.ydcg7twozr7witbv@bivouac.eciton.net> References: <20190415030739.14328-1-zhichao.gao@intel.com> <20190415030739.14328-3-zhichao.gao@intel.com> MIME-Version: 1.0 In-Reply-To: <20190415030739.14328-3-zhichao.gao@intel.com> User-Agent: NeoMutt/20170113 (1.7.2) Content-Type: text/plain; charset=us-ascii Content-Disposition: inline +Thomas for info Zhichao - please update subject line to Platform/ARM: Add a new API ResetSystem to VExpress ResetSystemLib and drop the spaces before ;. With that: Reviewed-by: Leif Lindholm On Mon, Apr 15, 2019 at 11:07:35AM +0800, Zhichao Gao wrote: > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1460 > > Add a new API ResetSystem to this ResetSystemLib instance. > It only adds the basic functions from ResetSystemRuntimeDxe. > Lacking of this interface may cause link error, if some drivers > use this new API and link to this library instance. > Make the ResetPlatformSpecific's parameters same with the > interface in Edk2 repo. > Notes: > This library API only provide a basic function of reset. If > the consumers want full functions, they should use the instance > in the MdeModulePkg and make sure the depex driver is dispatched. > > Cc: Ard Biesheuvel > Cc: Leif Lindholm > Cc: Michael D Kinney > Cc: Liming Gao > Signed-off-by: Zhichao Gao > --- > .../Library/ResetSystemLib/ResetSystemLib.c | 44 +++++++++++++++++++ > 1 file changed, 44 insertions(+) > > diff --git a/Platform/ARM/VExpressPkg/Library/ResetSystemLib/ResetSystemLib.c b/Platform/ARM/VExpressPkg/Library/ResetSystemLib/ResetSystemLib.c > index d2bc4a88fa..c4f4eedc45 100644 > --- a/Platform/ARM/VExpressPkg/Library/ResetSystemLib/ResetSystemLib.c > +++ b/Platform/ARM/VExpressPkg/Library/ResetSystemLib/ResetSystemLib.c > @@ -6,6 +6,7 @@ > Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
> Copyright (c) 2013, ARM Ltd. All rights reserved.
> Copyright (c) 2017, Linaro Ltd. All rights reserved.
> + Copyright (c) 2019, Intel Corporation. All rights reserved.
> > This program and the accompanying materials > are licensed and made available under the terms and conditions of the BSD License > @@ -109,3 +110,46 @@ ResetPlatformSpecific ( > { > ResetCold (); > } > + > +/** > + The ResetSystem function resets the entire platform. > + > + @param[in] ResetType The type of reset to perform. > + @param[in] ResetStatus The status code for the reset. > + @param[in] DataSize The size, in bytes, of ResetData. > + @param[in] ResetData For a ResetType of EfiResetCold, EfiResetWarm, or EfiResetShutdown > + the data buffer starts with a Null-terminated string, optionally > + followed by additional binary data. The string is a description > + that the caller may use to further indicate the reason for the > + system reset. > +**/ > +VOID > +EFIAPI > +ResetSystem ( > + IN EFI_RESET_TYPE ResetType, > + IN EFI_STATUS ResetStatus, > + IN UINTN DataSize, > + IN VOID *ResetData OPTIONAL > + ) > +{ > + switch (ResetType) { > + case EfiResetWarm: > + ResetWarm (); > + break; > + > + case EfiResetCold: > + ResetCold (); > + break; > + > + case EfiResetShutdown: > + ResetShutdown (); > + return ; > + > + case EfiResetPlatformSpecific: > + ResetPlatformSpecific (DataSize, ResetData); > + return; > + > + default: > + return ; > + } > +} > -- > 2.21.0.windows.1 >