From patchwork Wed Apr 7 04:10:02 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grant Likely X-Patchwork-Id: 49562 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 882A7B7D64 for ; Wed, 7 Apr 2010 14:12:29 +1000 (EST) Received: from localhost ([127.0.0.1]:60161 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NzMcs-0000MY-N6 for incoming@patchwork.ozlabs.org; Wed, 07 Apr 2010 00:12:26 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NzMae-0008Dv-Le for qemu-devel@nongnu.org; Wed, 07 Apr 2010 00:10:08 -0400 Received: from [140.186.70.92] (port=34663 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NzMad-0008DN-Eq for qemu-devel@nongnu.org; Wed, 07 Apr 2010 00:10:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NzMac-0001mK-1P for qemu-devel@nongnu.org; Wed, 07 Apr 2010 00:10:07 -0400 Received: from mail-pw0-f45.google.com ([209.85.160.45]:55195) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NzMab-0001kv-TB for qemu-devel@nongnu.org; Wed, 07 Apr 2010 00:10:06 -0400 Received: by mail-pw0-f45.google.com with SMTP id 6so554258pwi.4 for ; Tue, 06 Apr 2010 21:10:05 -0700 (PDT) Received: by 10.115.116.22 with SMTP id t22mr672387wam.56.1270613405325; Tue, 06 Apr 2010 21:10:05 -0700 (PDT) Received: from angua (S01060002b3d79728.cg.shawcable.net [70.72.87.49]) by mx.google.com with ESMTPS id 23sm3317052pzk.6.2010.04.06.21.10.04 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 06 Apr 2010 21:10:04 -0700 (PDT) Received: from [127.0.1.1] (localhost [127.0.0.1]) by angua (Postfix) with ESMTP id E28E61121; Tue, 6 Apr 2010 22:10:02 -0600 (MDT) From: Grant Likely To: qemu-devel@nongnu.org, devicetree-discuss@lists.ozlabs.org, jeremy.kerr@canonical.com Date: Tue, 06 Apr 2010 22:10:02 -0600 Message-ID: <20100407041002.20274.51604.stgit@angua> In-Reply-To: <20100407040129.20274.44284.stgit@angua> References: <20100407040129.20274.44284.stgit@angua> User-Agent: StGIT/0.14.2 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Cc: Subject: [Qemu-devel] [RFC PATCH 1/7] devicetree: Add 8k instead of double dtb size when reserving extra memory X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org If a small 'seed' dtb file is loaded into qemu and then heavily modified (say for runtime population of all the device nodes), then 2x the dtb size turns out not to be very much. This patch changes the device tree loading code to add a fixed 8k of additional space to the dtb buffer. Signed-off-by: Grant Likely --- device_tree.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/device_tree.c b/device_tree.c index 426a631..bad4810 100644 --- a/device_tree.c +++ b/device_tree.c @@ -41,8 +41,8 @@ void *load_device_tree(const char *filename_path, int *sizep) goto fail; } - /* Expand to 2x size to give enough room for manipulation. */ - dt_size *= 2; + /* Expand size to give enough room for manipulation. */ + dt_size += 8 * 1024; /* First allocate space in qemu for device tree */ fdt = qemu_mallocz(dt_size);