From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-in-05.arcor-online.net (mail-in-05.arcor-online.net [151.189.21.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.arcor.de", Issuer "Thawte Premium Server CA" (verified OK)) by ozlabs.org (Postfix) with ESMTP id ED9ECDDEEA for ; Mon, 18 Jun 2007 22:52:24 +1000 (EST) In-Reply-To: References: <111819314606b8b45671.846930886.miltonm@bga.com> <4672EE95.3030407@freescale.com> Mime-Version: 1.0 (Apple Message framework v623) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: From: Segher Boessenkool Subject: Re: [PATCH] boot: find initrd location from device-tree Date: Mon, 18 Jun 2007 14:52:12 +0200 To: Milton Miller Cc: ppcdev , Paul Mackerras , David Gibson List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , >>> + /* if the initrd is above 4G, its untouchable in 32 bit mode */ >>> + if (initrd_end <= UINT_MAX && initrd_start < initrd_end) { >>> + loader_info.initrd_addr = initrd_start; >>> + loader_info.initrd_size = initrd_end - initrd_start; >>> + } else { >>> + printf("ignoring loader supplied initrd parameters\n"); >> >> Saying why might be helpful. > > Hmm... well, that would mean seperating the && of the if; there are two > possible reasons. (1) this 32-bit code can't handle such large > addresses (in which case a 64-bit kernel may work), and (2) end is >= > start (which means there really isn't any data. I suppose I could > reverse the sense of the if, use an else if, and make the final else > the good path. "ignoring loader supplied nonsensical initrd parameters" You do need to fix the comment, though :-) >>> +#define _LIBC_LIMITS_H_ /* don't recurse to system's >> headers */ >>> +#include /* MAX_UINT, etc */ >>> + >> >> I think it's really a bad idea to use any headers from outside the >> boot context here. We're dealing with explicit sized ints, so we can >> safely define our own constants giving the limit values. > > As I said in the patch changelog, the only headers picked up here are > libgcc. Which the kernel doesn't use. It _should_ be fine nevertheless, is part of the "freestanding" headers -- why do you need to do a "libc" trick though? This doesn't work when not using glibc I guess? Segher