On 10/01/2013 07:28 AM, Fabien Chouteau wrote:
> On 10/01/2013 04:00 AM, Richard Henderson wrote:
>> On 09/30/2013 08:57 AM, Fabien Chouteau wrote:
>>> +extern const MonitorDef arch_monitor_defs[];
>>
>> This is supplied by target-foo/monitor.c, right?
>> Why in the world is it declared in generic code?
>>
> 
> Yes, why?
> 
>> Especially if it's only ever accessed via the
>> cpu->monitor_defs member?
>>
> 
> To begin with, I though I'd put in in each target-*/cpu.c, then having
> it at only one place seemed more clean. I'm open to any suggestion.
> 

If you put it in a global header like that, it looks like the array is
part of the generic interface.  But it isn't -- only the monitor_defs
member is.

If it's declared in any header at all, as opposed to static and local
to cpu.c (why was a new monitor.c file chosen?), it should go into
target-foo/cpu.h, where most of the other cpu-specific declarations go.


r~

Reply via email to