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=effNwJr9; spf=pass (domain: linaro.org, ip: 209.85.221.68, mailfrom: leif.lindholm@linaro.org) Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by groups.io with SMTP; Tue, 17 Sep 2019 06:54:10 -0700 Received: by mail-wr1-f68.google.com with SMTP id i1so3286060wro.4 for ; Tue, 17 Sep 2019 06:54:10 -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=dKmxspND+Ctev0gfFHYTzVR4+zdRHxEJh6LUnvtRBsU=; b=effNwJr9YdFMy9l6NN6fuA9WooqRk0gG6KLTupgXqG6wQfFIRgoUvfzvOImLSYF69H 7OfcF+Vz+40yZD5X9wLE3IXQt8xEou3tbyRqLYAi8809QUC28ufd9JyvUmrOdPtVFtg4 zio2DWa3yj3IpIqOXusmACONCdcpvGXtLda139YtQSsFiiBTchZODrx89I26LJYvlpvl v3/tz9clUnsYmENwGqmHM9SsgTWa2ZBWq0hbBZ/6vry/Vbl35rFmhDStEsms/ewNv2NF e4Pvc9f0diUuoHf6iqR/SbL6R85JeZe6tMycwlvYHVDfUFPUFOIEfYmlhL/daETJ9x9z nGPA== 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=dKmxspND+Ctev0gfFHYTzVR4+zdRHxEJh6LUnvtRBsU=; b=dpJ25cBaL7IACnO1q6wFarYMeEzHLav4frK23+Ij/I1Z0aLuLcvlVId9NUs7baXdm8 /RHz3bLSkU7rF+DAheJTnE3pJsChtr06fgXh3tSSUcSK66mH6p3naUA1TfRjzdlvO/p9 Qj4SGQ7HaRUHuidUvgl8eAQy6LSx72OcikuuHbrrqxMX7E9lAzhZ2cjaS9EZtc6gl5vy xLiJok9Jop3Wu/2DgUvKJIwd98IqN0iQpG3oDSGK4B4J12PNWWijJ0s2iC1IeFRO0sVV EGUUHDNBL4e0C+hBSBQhimKCXAzJFLoRC8xWb7jEE8KZDCEaqygvsGarLG0C+lrn0vq6 17HA== X-Gm-Message-State: APjAAAX1O/2JBkGjg3ihCsJOLzQNWNu/CqEb5oSpD9FGDBsh5LSR1B+w QQgTj68/p6IkiJvcSiCgvTkvsA== X-Google-Smtp-Source: APXvYqxXJGI/prw50VxuPdtJTSgMWw71pz06z1cNtBpbDfls8Z8ctnnYpPtRDFtVMnVCpPXlHIEI5A== X-Received: by 2002:adf:e7c4:: with SMTP id e4mr3007268wrn.62.1568728448866; Tue, 17 Sep 2019 06:54:08 -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 k9sm4135897wrd.7.2019.09.17.06.54.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Sep 2019 06:54:08 -0700 (PDT) Date: Tue, 17 Sep 2019 14:54:06 +0100 From: "Leif Lindholm" To: "Chang, Abner (HPS SW/FW Technologist)" Cc: "devel@edk2.groups.io" Subject: Re: [edk2-devel] [edk2-staging/RISC-V-V2 PATCH v1 02/22]: RiscVPkg/Include: Add header files of RISC-V CPU package Message-ID: <20190917135406.GE28454@bivouac.eciton.net> References: <1567593797-26216-1-git-send-email-abner.chang@hpe.com> <1567593797-26216-3-git-send-email-abner.chang@hpe.com> <20190904185536.GP29255@bivouac.eciton.net> MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Sep 16, 2019 at 04:02:10AM +0000, Chang, Abner (HPS SW/FW Technologist) wrote: > > -----Original Message----- > > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > > Leif Lindholm > > Sent: Thursday, September 5, 2019 2:56 AM > > To: devel@edk2.groups.io; Chang, Abner (HPS SW/FW Technologist) > > > > Subject: Re: [edk2-devel] [edk2-staging/RISC-V-V2 PATCH v1 02/22]: > > RiscVPkg/Include: Add header files of RISC-V CPU package > > > > On Wed, Sep 04, 2019 at 06:42:57PM +0800, Abner Chang wrote: > > > RISC-V package library definitions. > > > > > > RiscV.h > > > -Add RiscV.h which conform with RISC-V Privilege Spec v1.10. > > > > > > sbi.h > > > sbi_bits.h > > > sbi_types.h > > > - Add definitions for RISC-V OpenSBI EDK2 port. > > > > A web search suggests this refers to the RISC-V Open Source Supervisor > > Binary Interface. It would be helpful to expand it on first use. > > https://github.com/riscv/opensbi/? > > Is this expected to fluctuate much? > > Yes it does change often, the community keeps adding new features to openSBI. OK. I got some more intro to this at Linux Plumbers Conference last week. > > I ask for two reasons: > > 1) Because if it is not, I would much prefer to see the > > files/directories renamed to conform the the coding style. > > If it is, I would like for us to consider implementing this as a > > git submodule instead. > > Yes. Please use submodule. Don't touch the open source from openSBI to avoid maintenance effort to edk2. Sounds good. ... > > > diff --git a/RiscVPkg/Include/sbi/sbi_bits.h > > b/RiscVPkg/Include/sbi/sbi_bits.h > > > new file mode 100644 > > > index 0000000..4116ee6 > > > --- /dev/null > > > +++ b/RiscVPkg/Include/sbi/sbi_bits.h > > > @@ -0,0 +1,23 @@ > > > +/** @file > > > + RISC-V OpesbSBI header file reference. > > > + > > > + Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights > > reserved.
> > > + > > > + This program and the accompanying materials > > > + are licensed and made available under the terms and conditions of the > > BSD License > > > + which accompanies this distribution. The full text of the license may be > > found at > > > + INVALID URI REMOVED > > 3A__opensource.org_licenses_bsd- > > 2Dlicense.php&d=DwIBAg&c=C5b8zRQO1miGmBeVZ2LFWg&r=_SN6FZBN4V > > gi4Ulkskz6qU3NYRO03nHp9P7Z5q59A3E&m=iwfkW8MQjzEkixp0gv3xsvh20ei > > odo7hGcTLXEL_I0o&s=mLKjYgrdQ6MuAN9UVYQeCDB0pNA44m9yBOylxW- > > Koiw&e= > > > + > > > + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" > > BASIS, > > > + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER > > EXPRESS OR IMPLIED. > > > + > > > +**/ > > > +#ifndef __EDK2_SBI_BITS_H__ > > > +#define __EDK2_SBI_BITS_H__ > > > + > > > +#undef MAX > > > +#undef MIN > > > > Why? > OpebSBI sbi_bits.h has its own MAX/MIN definitions which are > duplicated with edk2 ones. OpenSBI is the implementation of RISC-V > sbi spec which is similar to edk2 for UEFI, the duplicate macros are > expected. This is the wrapper file to OpenSBI because of we don't > want to touch OpenSBI code. I think we should look at refactoring this in OpenSBI instead. Especially with us using this as effectively a library, we would need to be actively monitoring (well, on every update, but you suggested they may be frequent) whether any new clashes developed. The guys who attended Plumbers suggested thy would be quite flexible to restructure code in ways that makes the project more consumable. I am OK with this being here while it is on the edk2-staging branch. > > > > > + > > > +#include "../opensbi/include/sbi/sbi_bits.h" > > > > No relative includes. Let's figure out a way to expose the interface properly. > > Can be fixed by RiscVPkg.dec Sounds good. > > > + > > > +#endif > > > \ No newline at end of file > > > diff --git a/RiscVPkg/Include/sbi/sbi_types.h > > b/RiscVPkg/Include/sbi/sbi_types.h > > > new file mode 100644 > > > index 0000000..fe877f2 > > > --- /dev/null > > > +++ b/RiscVPkg/Include/sbi/sbi_types.h > > > @@ -0,0 +1,24 @@ > > > +/** @file > > > + RISC-V OpesbSBI header file reference. > > > + > > > + Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights > > reserved.
> > > + > > > + This program and the accompanying materials > > > + are licensed and made available under the terms and conditions of the > > BSD License > > > + which accompanies this distribution. The full text of the license may be > > found at > > > + INVALID URI REMOVED > > 3A__opensource.org_licenses_bsd- > > 2Dlicense.php&d=DwIBAg&c=C5b8zRQO1miGmBeVZ2LFWg&r=_SN6FZBN4V > > gi4Ulkskz6qU3NYRO03nHp9P7Z5q59A3E&m=iwfkW8MQjzEkixp0gv3xsvh20ei > > odo7hGcTLXEL_I0o&s=mLKjYgrdQ6MuAN9UVYQeCDB0pNA44m9yBOylxW- > > Koiw&e= > > > + > > > + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" > > BASIS, > > > + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER > > EXPRESS OR IMPLIED. > > > + > > > +**/ > > > +#ifndef __EDK2_SBI_TYPES_H__ > > > +#define __EDK2_SBI_TYPES_H__ > > > + > > > +#undef TRUE > > > +#undef FALSE > > > +#undef NULL > > > > Why? > Same reason as above. OK, same response as above. > > > + > > > +#include "../opensbi/include/sbi/sbi_types.h" > > > > No relative includes. > Can be fixed by RiscVPkg.dec OK. / Leif