svn commit: r214457 - in head/sys: amd64/amd64 conf i386/i386 x86/x86

Attilio Rao attilio at freebsd.org
Thu Oct 28 20:22:31 UTC 2010


2010/10/28 John Baldwin <jhb at freebsd.org>:
> 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);
> }
>

I'm not entirely sure we might use this because in general it is an
'embedded' string for the other cases, but I don't have a strong
opinion about it, so I'm fine with auto-generation.

Attilio


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


More information about the svn-src-all mailing list