From owner-svn-src-head@FreeBSD.ORG Thu Oct 28 20:22:31 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79D0E1065674; Thu, 28 Oct 2010 20:22:31 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-qy0-f175.google.com (mail-qy0-f175.google.com [209.85.216.175]) by mx1.freebsd.org (Postfix) with ESMTP id E9D9A8FC18; Thu, 28 Oct 2010 20:22:30 +0000 (UTC) Received: by qyk7 with SMTP id 7so5216348qyk.13 for ; Thu, 28 Oct 2010 13:22:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=1dHHUczArvnQpcDNRnWj3ozEhhcX3ZkeEmvfJepUQwg=; b=aj5nLWFCd0A1r0aFyIh3pa2FjOY5WL3U9H4LLSjK9VhQ6Ze99RJVnTqEQdVq2/BnuO TZl0IiEwBPa4r0iIOD5F3U66+u9oGWMuajDnYKXNE6fkcFKcVzi9jQM+k1sjNJQk5VNw x6IL3aOTui4EDotE+pr1qKLWWdpoguKqrATgI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=h4FJIvnufdxkbovIbVwzOKAyyJXfJjHydAw1HZpwn0QUu/35UVbafj1B7He8tMzlY+ XCgQGYRjYp+fJapAS0UoVbk9LU3E6Pt4QMEeyLPuPe3+Ib+rdMZRt2ojYpRKr5VpM1W1 vld/3DwvqFLnmpIadJD1FTU/DeKoKjYL/orbM= MIME-Version: 1.0 Received: by 10.229.225.199 with SMTP id it7mr7739395qcb.33.1288297350162; Thu, 28 Oct 2010 13:22:30 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.229.237.9 with HTTP; Thu, 28 Oct 2010 13:22:30 -0700 (PDT) In-Reply-To: <201010281457.19804.jhb@freebsd.org> References: <201010281631.o9SGVdtZ014923@svn.freebsd.org> <201010281411.40423.jhb@freebsd.org> <201010281457.19804.jhb@freebsd.org> Date: Thu, 28 Oct 2010 22:22:30 +0200 X-Google-Sender-Auth: opzY_CSl9yq94DvUUIoGyY64z_U Message-ID: From: Attilio Rao To: John Baldwin Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Oct 2010 20:22:31 -0000 2010/10/28 John Baldwin : > On Thursday, October 28, 2010 2:11:40 pm John Baldwin wrote: >> On Thursday, October 28, 2010 1:21:34 pm Attilio Rao wrote: >> > + =C2=A0 =C2=A0 =C2=A0 vm_paddr_t *p; >> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 caddr_t kmdp; >> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 uint32_t smapsize; >> > - =C2=A0 =C2=A0 =C2=A0 int error, rid; >> > + =C2=A0 =C2=A0 =C2=A0 int error, i, rid; >> > >> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* Retrieve the system memory map from the= loader. */ >> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 kmdp =3D preload_search_by_type("elf kerne= l"); >> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (kmdp =3D=3D NULL) >> > - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 kmdp =3D preload_se= arch_by_type("elf64 kernel"); >> > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 kmdp =3D preload_se= arch_by_type(ELF_KERN_STR); >> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 smapbase =3D (struct bios_smap *)preload_s= earch_info(kmdp, >> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 MODINFO_METADATA | MODINFOMD= _SMAP); >> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 smapsize =3D *((u_int32_t *)smapbase - 1); >> >> It would be nice if ELF_KERN_STR could be autogenerated as something lik= e: >> >> "elf ## __ELF_WORD_SIZE ## kernel" instead of needing an #ifdef. > > This works in my testing: > > #include > #include > > int > main(void) > { > =C2=A0 =C2=A0 =C2=A0 =C2=A0printf("%s\n", "elf" __XSTRING(__ELF_WORD_SIZE= ) " kernel"); > =C2=A0 =C2=A0 =C2=A0 =C2=A0return (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 --=20 Peace can only be achieved by understanding - A. Einstein