Date: Thu, 28 Oct 2010 14:57:19 -0400 From: John Baldwin <jhb@freebsd.org> To: Attilio Rao <attilio@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: <201010281457.19804.jhb@freebsd.org> In-Reply-To: <201010281411.40423.jhb@freebsd.org> References: <201010281631.o9SGVdtZ014923@svn.freebsd.org> <AANLkTim_znVvoC0DVygFEu8GPOiwiuNs2fB_iMp61GpA@mail.gmail.com> <201010281411.40423.jhb@freebsd.org>
index | next in thread | previous in thread | raw e-mail
On Thursday, October 28, 2010 2:11:40 pm John Baldwin wrote:
> On Thursday, October 28, 2010 1:21:34 pm Attilio Rao wrote:
> > + vm_paddr_t *p;
> > caddr_t kmdp;
> > uint32_t smapsize;
> > - int error, rid;
> > + int error, i, rid;
> >
> > /* Retrieve the system memory map from the loader. */
> > kmdp = preload_search_by_type("elf kernel");
> > if (kmdp == NULL)
> > - kmdp = preload_search_by_type("elf64 kernel");
> > + kmdp = preload_search_by_type(ELF_KERN_STR);
> > smapbase = (struct bios_smap *)preload_search_info(kmdp,
> > MODINFO_METADATA | MODINFOMD_SMAP);
> > smapsize = *((u_int32_t *)smapbase - 1);
>
> It would be nice if ELF_KERN_STR could be autogenerated as something like:
>
> "elf ## __ELF_WORD_SIZE ## kernel" instead of needing an #ifdef.
This works in my testing:
#include <sys/elf.h>
#include <stdio.h>
int
main(void)
{
printf("%s\n", "elf" __XSTRING(__ELF_WORD_SIZE) " kernel");
return (0);
}
--
John Baldwin
home |
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201010281457.19804.jhb>
