public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Leif Lindholm" <leif@nuviainc.com>
To: "Ni, Ray" <ray.ni@intel.com>
Cc: "rfc@edk2.groups.io" <rfc@edk2.groups.io>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>,
	Felix Polyudov <Felixp@ami.com>,
	"Doran, Mark" <mark.doran@intel.com>,
	Andrew Fish <afish@apple.com>, Laszlo Ersek <lersek@redhat.com>,
	"Kinney, Michael D" <michael.d.kinney@intel.com>,
	Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
Subject: Re: [edk2-rfc] [RFCv2] code-first process for UEFI-forum specifications
Date: Tue, 12 May 2020 16:29:22 +0100	[thread overview]
Message-ID: <20200512152922.GL21486@vanye> (raw)
In-Reply-To: <734D49CCEBEEF84792F5B80ED585239D5C4B2676@SHSMSX104.ccr.corp.intel.com>

On Wed, Mar 25, 2020 at 05:14:59 +0000, Ni, Ray wrote:
> > 
> > ## Github
> > New repositories will be added for holding the text changes and the source code.
> > 
> > Specification text changes will be held within the affected source repository,
> > in the Github flavour of markdown, in a file (or split across several files)
> > with .md suffix.
> 
> What's the case when multiple .MD files are needed?

For example if a branch covers changes to multiple specifications, as
described elsewhere. Or if it simply makes sense due to content size.
It is possible, now we've migrated to .rst for edk2, that we should
change the format recommentded in this proposal too.

> > (This one may break down where we have a specification change affecting multiple
> > specifications, but at that point we can track it with multiple BZ entries)
> 
> > 
> > 
> > ## Source code
> > In order to ensure draft code does not accidentally leak into production use,
> > and to signify when the changeover from draft to final happens, *all* new or
> > modified[1] identifiers need to be prefixed with the relevant BZ####.
> > 
> > [1] Modified in a non-backwards-compatible way. If, for example, a statically
> >     sized array is grown - this does not need to be prefixed. But a tag in a
> > 	comment would be *highly* recommended.
> 
> If a protocol is enhanced to provide more interfaces with increased revision number,
> would you like the protocol name to be prefixed with BZ####?
> Or just the new interfaces added to the protocol are prefixed the BZ####?
> I think just prefixing the new interfaces can meet the purpose.

Adding new interfaces to a protocol does not affect its
backwards-compatibility, which was what I was trying to cover above.
If you can think of a better way of describing it. I am very open to
suggestions.

> But the protocol definition is changed, it also needs to be prefixed according to this flow.
> Can you clarify a bit more?

In that instance, only the new interfaces would need the prefix.

> > 
> > ### File names
> > New public header files need the prefix. I.e. `Bz1234MyNewProtocol.h`
> > Private header files do not need the prefix.
> > 
> > ### Contents
> > 
> > The tagging must follow the coding style used by each affected codebase.
> > Examples:
> > 
> > | Released in spec      | Draft version in tree       | Comment                |
> > | ---                   | ---                         | ---                    |
> > | `FunctionName`        | `Bz1234FunctionName`        |                        |
> > | `HEADER_MACRO`        | `BZ1234_HEADER_MACRO`       |                        |
> 
> If FunctionName or HEADER_MACRO is defined in non-public header files, I don't
> think they require the prefix. Do you agree?

Only public interfaces need prefix. This also means that non-public
interfaces should be STATIC where possible.

> > For data structures or enums, any new or non-backwards-compatible structs or
> > fields require a prefix. As above, growing an existing array in an existing
> > struct requires no prefix.
> > 
> > | `typedef SOME_STRUCT` | `BZ1234_SOME_STRUCT`        | Typedef only [2]       |
> > | `StructField`         | `Bz1234StructField`         | In existing struct[3]  |
> > | `typedef SOME_ENUM`   | `BZ1234_SOME_ENUM`          | Typedef only [2]       |
> > 
> > [2] If the struct or enum definition is separate from the typedef in the public
> >     header, the definition does not need the prefix.
> 
> What does "separate" mean?
> Does it mean "struct or enum in the public header BzXXX.h don't need the prefix"?
> If yes, then I think macros defined in BzXXX.h also don't need the prefix.

Struct or enum definitions in the public header BzXXX.h don't need the
prefix *when they have a public-facing typedef with the prefix*.
Everything new or not-backwards-compatible needs to be referred to via
the prefixed names in external modules.

I.e. we can have
struct _SomeNewThing {
};

typedef struct _SomeNewThing BzXXX_PROTOCOL;

(This is meant simply as shorthand, reducing the amount of changes
required for the published version.)

> > [3] Individual fields in newly added typedefd struct do not need prefix, the
> >     struct already carried the prefix.
> > 
> > Variable prefixes indicating global scope ('g' or 'm') go before the BZ prefix.
> > 
> > | `gSomeGuid`           | `gBz1234SomeGuid`           |                        |
> > 
> > Local identifiers, including module-global ones (m-prefixed) do not require a
> > BZ prefix.
> 
> I think only the names (struct type name, enum type name, interface name, protocol/ppi name)
> defined in public header files need the BZ prefix when the public header doesn't have prefix.
> Right?

That is one way we *could* do it. It is not one I am proposing.
My idea is that it should be very clear from looking at code whether
it includes non-ratified proposal code.

/
    Leif

  reply	other threads:[~2020-05-12 15:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-23 19:05 [RFCv2] code-first process for UEFI-forum specifications Leif Lindholm
2020-03-25  5:14 ` [edk2-rfc] " Ni, Ray
2020-05-12 15:29   ` Leif Lindholm [this message]
2020-03-25 15:20 ` [edk2-devel] " Laszlo Ersek
2020-05-05 15:21 ` [edk2-rfc] " Samer El-Haj-Mahmoud
  -- strict thread matches above, loose matches on Subject: below --
2020-05-14 21:10 Samer El-Haj-Mahmoud
     [not found] <160F0156FEDC6091.6323@groups.io>
2020-05-20 10:19 ` Samer El-Haj-Mahmoud

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200512152922.GL21486@vanye \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox