Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Oct 2010 23:55:23 +0200
From:      Attilio Rao <attilio@freebsd.org>
To:        John Baldwin <jhb@freebsd.org>
Cc:        freebsd-arch@freebsd.org
Subject:   Re: [PATCH] Headers for the x86 subtree
Message-ID:  <AANLkTinuQHVycJ4nu2yazVSX5NOHumvPNJods9_3F6rv@mail.gmail.com>
In-Reply-To: <201010271749.54619.jhb@freebsd.org>
References:  <AANLkTiktoYyxmE8nyGeoc4_ov35fR7iN83444MfhYg-e@mail.gmail.com> <201010271649.47880.jhb@freebsd.org> <AANLkTikwT9%2BwQycEHTGapw7j9TeuiCaPet6UF4=MPMSg@mail.gmail.com> <201010271749.54619.jhb@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
2010/10/27 John Baldwin <jhb@freebsd.org>:
> On Wednesday, October 27, 2010 5:25:20 pm Attilio Rao wrote:
>> 2010/10/27 John Baldwin <jhb@freebsd.org>:
>> > On Wednesday, October 27, 2010 4:00:15 pm Attilio Rao wrote:
>> >> 2010/10/27 John Baldwin <jhb@freebsd.org>:
>> >> > On Wednesday, October 27, 2010 10:56:06 am Attilio Rao wrote:
>> >> >> This patch should convert a (simple and 100% shared between amd64 =
and
>> >> >> i386 header) under the x86 sub-tree. Please note that in this patc=
h I
>> >> >> "svn cp" the file from sys/amd64/include/mptable.h into
>> >> >> sys/x86/include/mptable.h:
>> >> >> http://www.freebsd.org/~attilio/headers-x86.diff
>> >> >>
>> >> >> This is someway a POC, that I really want to get in. The idea is
>> >> >> simple and someway follows the pc98 case (even if not entirely): t=
he
>> >> >> files under machine/include/* became just mere stubs for x86/inclu=
de/*
>> >> >> contents and redirect there.
>> >> >> This won't particulary help reducing the number of available files=
,
>> >> >> but generally removing verbatim and would also be the way to go fo=
r
>> >> >> handling MFCs.
>> >> >> If you find this is the right way I'll commit the fix and start mo=
ving
>> >> >> other files as time permits.
>> >> >
>> >> > No, we want to do this differently because we also want this to wor=
k in
>> >> > userland. =C2=A0(e.g. I'd like to outright move mca.h to x86/includ=
e and then use
>> >> > '#include <x86/mca.h>' in both kernel and userland for it). =C2=A0W=
e'd need some
>> >> > special glue to setup an 'x86' symlink during a kernel build that p=
oints to
>> >> > @/x86/include as we do now to setup an 'i386' link for pc98 kernels=
.
>> >> >
>> >> > We'd also need to install the x86 headers into /usr/include during =
an
>> >> > installworld. =C2=A0Warner has some more pointers on this I think.
>> >>
>> >> So you probabilly are suggesting to go w/ the "pc98 approach".
>> >> I'm fine with it, I'll try to look for how it works and implement as =
well.
>> >
>> > Thanks. =C2=A0I think it is fine to use '#include <x86/foo.h>' in code=
 directly
>> > with this approach as well. =C2=A0I only think we should provide wrapp=
ers in
>> > /usr/include/machine if compatibility is needed. =C2=A0mca.h and mptab=
le.h
>> > shouldn't need compatibility for example, but specialreg.h might.
>>
>> I'd expect to potentially mirror any header, otherwise on which
>> criterias we can say some are needed and other not?
>
> If it is widely used in userland. :) =C2=A0mptable.h is probably only use=
d by the
> mptable utility which is easily fixed. =C2=A0It will not be of interest t=
o any 3rd
> party software. =C2=A0mca.h may eventually be used by third party softwar=
e, but it
> is very new, so we can probably move it now without causing any harm.
>
> Kernel-only headers such as intr_machdep.h certainly do not need any comp=
at
> wrappers.
>
> We can always add a compat header in machine if we find it is needed, but=
 I'd
> like to minimize the amount of compat cruft as much as possible.

I'd say in general I agree, so let's add them just on-demand is possibly fi=
ne.

Thanks,
Attilio


--=20
Peace can only be achieved by understanding - A. Einstein



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTinuQHVycJ4nu2yazVSX5NOHumvPNJods9_3F6rv>