Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Oct 2010 22:25:18 +0200
From:      Attilio Rao <attilio@freebsd.org>
To:        John Baldwin <jhb@freebsd.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r214457 - in head/sys: amd64/amd64 conf i386/i386 x86/x86
Message-ID:  <AANLkTimWYaNefcx7JFgXtPN1QwCdQKggeGk%2BQowV7MBc@mail.gmail.com>
In-Reply-To: <201010281411.40423.jhb@freebsd.org>
References:  <201010281631.o9SGVdtZ014923@svn.freebsd.org> <201010281257.05481.jhb@freebsd.org> <AANLkTim_znVvoC0DVygFEu8GPOiwiuNs2fB_iMp61GpA@mail.gmail.com> <201010281411.40423.jhb@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
2010/10/28 John Baldwin <jhb@freebsd.org>:
> On Thursday, October 28, 2010 1:21:34 pm Attilio Rao wrote:
>> 2010/10/28 John Baldwin <jhb@freebsd.org>:
>> > On Thursday, October 28, 2010 12:31:39 pm Attilio Rao wrote:
>> >> Author: attilio
>> >> Date: Thu Oct 28 16:31:39 2010
>> >> New Revision: 214457
>> >> URL: http://svn.freebsd.org/changeset/base/214457
>> >>
>> >> Log:
>> >> =C2=A0 Merge nexus.c from amd64 and i386 to x86 subtree.
>> >>
>> >> =C2=A0 Sponsored by: =C2=A0 =C2=A0 =C2=A0 Sandvine Incorporated
>> >> =C2=A0 Tested by: =C2=A0gianni
>> >>
>> >
>> > It would be better to merge these two routines. =C2=A0The loader now p=
asses the
>> > smap to i386 kernels as well, so ram_attach() should probably be chang=
ed to
>> > try the amd64 approach first and if that fails fall back to using the
>> > phys_avail[] array instead.
>>
>> What do you think about this patch?:
>> Index: nexus.c
>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>> --- nexus.c =C2=A0 =C2=A0 (revision 214457)
>> +++ nexus.c =C2=A0 =C2=A0 (working copy)
>> @@ -52,9 +52,7 @@
>> =C2=A0#include <sys/systm.h>
>> =C2=A0#include <sys/bus.h>
>> =C2=A0#include <sys/kernel.h>
>> -#ifdef __amd64__
>> =C2=A0#include <sys/linker.h>
>> -#endif
>> =C2=A0#include <sys/malloc.h>
>> =C2=A0#include <sys/module.h>
>> =C2=A0#include <machine/bus.h>
>> @@ -67,12 +65,10 @@
>> =C2=A0#include <vm/pmap.h>
>> =C2=A0#include <machine/pmap.h>
>>
>> -#ifdef __amd64__
>> =C2=A0#include <machine/metadata.h>
>> -#include <machine/pc/bios.h>
>> -#endif
>> =C2=A0#include <machine/nexusvar.h>
>> =C2=A0#include <machine/resource.h>
>> +#include <machine/pc/bios.h>
>>
>> =C2=A0#ifdef DEV_APIC
>> =C2=A0#include "pcib_if.h"
>> @@ -89,11 +85,13 @@
>> =C2=A0#include <sys/rtprio.h>
>>
>> =C2=A0#ifdef __amd64__
>> -#define =C2=A0 =C2=A0 =C2=A0 =C2=A0RMAN_BUS_SPACE_IO =C2=A0 =C2=A0 =C2=
=A0 AMD64_BUS_SPACE_IO
>> -#define =C2=A0 =C2=A0 =C2=A0 =C2=A0RMAN_BUS_SPACE_MEM =C2=A0 =C2=A0 =C2=
=A0AMD64_BUS_SPACE_MEM
>> +#define =C2=A0 =C2=A0 =C2=A0 =C2=A0X86_BUS_SPACE_IO =C2=A0 =C2=A0 =C2=
=A0 =C2=A0AMD64_BUS_SPACE_IO
>> +#define =C2=A0 =C2=A0 =C2=A0 =C2=A0X86_BUS_SPACE_MEM =C2=A0 =C2=A0 =C2=
=A0 AMD64_BUS_SPACE_MEM
>> +#define =C2=A0 =C2=A0 =C2=A0 =C2=A0ELF_KERN_STR =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0"elf64 kernel"
>> =C2=A0#else
>> -#define =C2=A0 =C2=A0 =C2=A0 =C2=A0RMAN_BUS_SPACE_IO =C2=A0 =C2=A0 =C2=
=A0 I386_BUS_SPACE_IO
>> -#define =C2=A0 =C2=A0 =C2=A0 =C2=A0RMAN_BUS_SPACE_MEM =C2=A0 =C2=A0 =C2=
=A0I386_BUS_SPACE_MEM
>> +#define =C2=A0 =C2=A0 =C2=A0 =C2=A0X86_BUS_SPACE_IO =C2=A0 =C2=A0 =C2=
=A0 =C2=A0I386_BUS_SPACE_IO
>> +#define =C2=A0 =C2=A0 =C2=A0 =C2=A0X86_BUS_SPACE_MEM =C2=A0 =C2=A0 =C2=
=A0 I386_BUS_SPACE_MEM
>> +#define =C2=A0 =C2=A0 =C2=A0 =C2=A0ELF_KERN_STR =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0"elf32 kernel"
>> =C2=A0#endif
>
> I would not do this. =C2=A0What I meant is that amd64 and i386 should be
> changed to both use X86_BUS_SPACE_* and {AMD64,I386}_BUS_SPACE_* should b=
e
> retired. =C2=A0This would involve changing the bus space code itself slig=
htly,
> but it could perhaps be shared as a result. =C2=A0Alternatively as bde@ n=
otes
> we could just drop the MD prefix entirely and have BUS_SPACE_* instead.
>
> However, I wouldn't make any changes to just nexus.c for the BUS_SPACE_*
> stuff.

Ok, as long as you and bde seem to prefer it, I'd just drop the X86_*
prefix for the moment and working on the overhaul later, as time
permits.

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?AANLkTimWYaNefcx7JFgXtPN1QwCdQKggeGk%2BQowV7MBc>