svn commit: r281721 - head/sys/sys

Justin Hibbits jhibbits at freebsd.org
Mon Apr 20 16:36:20 UTC 2015


On Mon, Apr 20, 2015 at 9:19 AM, Bruce Evans <brde at optusnet.com.au> wrote:
> On Mon, 20 Apr 2015, John Baldwin wrote:
>
>> On Sunday, April 19, 2015 12:33:22 AM Justin Hibbits wrote:
>>>
>>> Log:
>>>   Fix the build.  Commit the last part of e500 PMC.
>>> ...
>>> @@ -136,6 +138,7 @@ enum pmc_cputype {
>>>         __PMC_CLASS(MIPS74K)    /* MIPS 74K */                          \
>>>         __PMC_CLASS(PPC7450)    /* Motorola MPC7450 class */            \
>>>         __PMC_CLASS(PPC970)     /* IBM PowerPC 970 class */             \
>>> +       __PMC_CLASS(E500)       /* Freescale e500 class */              \
>>>         __PMC_CLASS(SOFT)       /* Software events */
>>
>>
>> Note that each time a PMC_CLASS is added, the ABI for pmccontrol -L
>> breaks since the enum value of the "SOFT" class changes.  We should
>> perhaps fix the value of SOFT to make this less painful (just as we
>> fix the values for PMC_CPU so that those don't change).
>
>
> Enums should never be used in ABIs, since their size can be anything
> large enough.
>
> They also cause namespace problems.  The whole enum declaration must
> be exposed in any header that uses an enum type.
>
> Bruce

Any change breaks ABI for any architecture listed after anyway
(Adrian's MIPS74K broke all PowerPC).  Could we not take the same IDs
as in pmc_events.h to generate the PM_CLASS IDs?

- Justin


More information about the svn-src-all mailing list