Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: arm MACHINE and MACHINE_ARCH issues



On Jul 21, 2014, at 2:35 AM, Alan Barrett <apb%cequrux.com@localhost> wrote:

> On Sun, 20 Jul 2014, Matt Thomas wrote:
>>> - how sysctl hw.machine_arch should be handled
>> 
>> Right now it return the MACHINE_ARCH the executable was built for via an ELF 
>> note.
> 
> I'd expect sysctl hw.something to report information about the hardware 
> that's in use, or perhaps the hardware that the kernel was built for.  It 
> seems weird to report information about how the currently running executable 
> was built.

That's what hw.model does.  hw.machine_arch is really an ABI indicator.  Note 
we change hw.machine_arch for compat_netbsd32.

> Perhaps we need different sysctl nodes to report the kernel's idea of 
> MACHINE_ARCH and the userland executable's idea of MACHINE_ARCH.

I don't think so.

One reason for the various MACHINE_ARCH for earm is that earm{,hf}eb and 
earmv7{,hf}eb, respectively, are binary incompatible (instructions have 
different byte ordering, BE .vs. LE).  Once I had to have earmv7{,hf}eb as a 
distinct MACHINE_ARCH as well as earmv4 for pre-armv5te machines, it seemed 
wrong to not have earmv7{,hf}.  And if I had that, why shouldn't there be 
earmv6{,hf}{,eb}? 




Home | Main Index | Thread Index | Old Index