On 03/26/2012 07:29 PM, Anthony Liguori wrote:
> On 03/26/2012 10:54 AM, Isaku Yamahata wrote:
>> On Mon, Mar 26, 2012 at 02:20:24PM +0200, Jan Kiszka wrote:
>>> I'm also sure we will have to refactor the merge significantly again
>>> for
>>> the introduction of additional chipsets and PC boards. But unless those
>>> requirements can already be specified (Isaku?), that might be
>>> unavoidable.
>>
>> Agreed. At least I'd like pam/smram stuff decoupled from piix.
>
> s/piix/i440fx/
>
> PAM/SRAM has nothing do to with the piix.  Part of the problem with
> the current layout is that the distinction between i440fx and piix is
> not clear.  The piix is just a SuperIO chip (and southbridge).

Right.

>
> I think the better approach is to have a PCNorthBridge base-class that
> contains functionality like PAM/SRAM that both I440FX and Q35 inherit
> from.

I hate to transform this into a languagey discussion, but I don't think
inheritance is the right thing here.  While both 440fx and q35 are north
bridges, the similar implementation of PAM/SMRAM is not part of that. 
It's just a random result of the chips' evolution.  I think the code for
PAM/SMRAM can be reused if the specs match, but using a has-a instead of
an is-a relationship.

As a counterexample, consider a northbridge that implements PAM/SMRAM
differently.  You'd have to refactor PCNorthBridge into two separate
classes.  With the other approach the new northbridge simply doesn't
include the existing PAM/SMRAM implementation and instead implements its
own.

-- 
error compiling committee.c: too many arguments to function


Reply via email to