public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: "Kinney, Michael D" <michael.d.kinney@intel.com>,
	"Duran, Leo" <leo.duran@amd.com>,
	"edk2-devel@ml01.01.org" <edk2-devel@ml01.01.org>
Cc: "Fan, Jeff" <jeff.fan@intel.com>, "Gao, Liming" <liming.gao@intel.com>
Subject: Re: LocalApicLib: Why two separate directories?
Date: Fri, 28 Oct 2016 21:40:14 +0200	[thread overview]
Message-ID: <2fd72990-687a-f728-a53f-d7a4ad23f7e8@redhat.com> (raw)
In-Reply-To: <E92EE9817A31E24EB0585FDF735412F56483D48D@ORSMSX113.amr.corp.intel.com>

On 10/28/16 21:28, Kinney, Michael D wrote:
> Leo,
> 
> Your observation is correct, but the reason not to make this change now is 
> the DSC file changes required that would break platform builds.  As Laszlo
> points out, it is possible to do this type of change and coordinate update
> to all platforms in edk2/master.  However, there are many other platforms 
> that use edk2 and a change like this would break them on next pull of 
> edk2/master.
> 
> I believe the original X2 APIC implementation did not have as much common
> code, so that was likely why it was added as a different library.
> 
> I recommend we just leave them in their own directories for right now.

It would also be possible to extract the common code into a library
*class* (internal to UefiCpuPkg), along with a single instance for that
new lib class. This would leave the two current INFs undisturbed.

However, as far as I understand, such arbitrary library classes could be
frowned upon -- there's no other "guiding principle" to them than "well
these functions happen to be shared by two other modules".

Sometimes that's a good enough reason for introducing a new library
class (with a single imlementation), sometimes it isn't.

Thanks
Laszlo

>> -----Original Message-----
>> From: Duran, Leo [mailto:leo.duran@amd.com]
>> Sent: Friday, October 28, 2016 12:04 PM
>> To: edk2-devel@ml01.01.org
>> Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Fan, Jeff <jeff.fan@intel.com>;
>> Gao, Liming <liming.gao@intel.com>; 'Laszlo Ersek' <lersek@redhat.com>
>> Subject: LocalApicLib: Why two separate directories?
>>
>> All,
>> Just a quick observation to request comments:
>>
>> Since a lot of the code in BaseXApicX2ApicLib.c and BaseXApicLib is the same, how about
>> we merge the common code and build the libraries from the same directory?
>>
>> UefiCpuPkg/Library/LocalApilLib/
>> - LocalApicLib.c --> common code
>> - BaseXApicLib.c --> legacy APIC code
>> - BaseXApicX2ApicLib.c --> X2APIC code
>> - BaseXApicLib.inf -> builds from LocalApicLib.c + BaseXApicLib.c
>> - BaseXApicX2ApicLib.inf -> builds from LocalApicLib.c + BaseXApicX2ApicLib.c
>>
>> Of course, doing this would require modification to existing .DSC files, to point to
>> the appropriate .INF under the merged LocalApicLib directory.
>> Would that be too disruptive?
>>
>> Leo.
>>
>>
>>
>>
> 



      parent reply	other threads:[~2016-10-28 19:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-28 19:03 LocalApicLib: Why two separate directories? Duran, Leo
2016-10-28 19:22 ` Laszlo Ersek
2016-10-28 19:31   ` Duran, Leo
2016-10-28 19:28 ` Kinney, Michael D
2016-10-28 19:36   ` Duran, Leo
2016-10-28 19:40   ` Laszlo Ersek [this message]

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=2fd72990-687a-f728-a53f-d7a4ad23f7e8@redhat.com \
    --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