Message ID | 20200112120216.12.Ic9d42a8ad4850e8e677336e4e07bee8b62ad2fb0@changeid |
---|---|
State | Superseded |
Delegated to: | Simon Glass |
Headers | show
Return-Path: <u-boot-bounces@lists.denx.de> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=LAf3U2rD; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47wmVJ0TcQz9s4Y for <incoming@patchwork.ozlabs.org>; Mon, 13 Jan 2020 06:09:11 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 481D7817FA; Sun, 12 Jan 2020 20:07:28 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="LAf3U2rD"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BFDFB817D8; Sun, 12 Jan 2020 20:07:15 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x144.google.com (mail-il1-x144.google.com [IPv6:2607:f8b0:4864:20::144]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id A389F804C1 for <u-boot@lists.denx.de>; Sun, 12 Jan 2020 20:07:12 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x144.google.com with SMTP id s15so6089807iln.1 for <u-boot@lists.denx.de>; Sun, 12 Jan 2020 11:07:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=C3ZUPI1mwAok2y/areMhBz4YNbOspV2wJjhrwj8tG8k=; b=LAf3U2rD6xYwoskfipD4OmTjXo9xDDsKPJ5mJ76agIG7CXqfK9WH2xM2R3DbqTTYOj ChRd8wj23O7lWU3GEKVZ0YUwQnEIGyqT3Z8DcFmPc/sdlyFN4XQVpFEiK3eQaZyNHe/3 n95bmb2u0zM9EcsLqNLsLJhDbXWLiSLyxsD9w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=C3ZUPI1mwAok2y/areMhBz4YNbOspV2wJjhrwj8tG8k=; b=d2QguGE0IJb/Jn2wd3Wft/cFRyVfGENpQmOhsh9ktExDUge46UO4wZA3vM92VygATq XvtxXMkmxyj4J0T3P8Zipn7iiFcDA0gaU3figI6UOkj101VsTw4mjqovYCzVhPaqA0da aIRkTocQmITaCa8NxHU0VX27kStHe+JB+vFuTN9ism4dyQtgtN2p8Xac2s5uCNBOr8D3 RItMUsLApNYbE1NS5one96IuFRQBdA1E6m3nycboPvEQUV5wxcRN2RDq+dzM/FB2JRBd 71ifgKgiApRf2ZocqG/AvqJqQXct0U2pdViSLFqfzagstF+Plc1feMYCv9fq+F4JXegT +XfA== X-Gm-Message-State: APjAAAW+sv29bg+uf2yyigt6VtpX37c0MCAFq3G89aiyUhBD2QNJvvJ+ q/xhjgPJfQgh+RzWqZfQUG7rGVp2JW8= X-Google-Smtp-Source: APXvYqzOm3uf6YIo+vJp6OH2SmbqZshkf5tZ9dBjnjes0cIuKT/tgaHabyDoxV9WtwZc6hEQ5/5uiQ== X-Received: by 2002:a92:5d03:: with SMTP id r3mr11045825ilb.278.1578856031477; Sun, 12 Jan 2020 11:07:11 -0800 (PST) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id r22sm3039219ilb.25.2020.01.12.11.07.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Jan 2020 11:07:11 -0800 (PST) From: Simon Glass <sjg@chromium.org> To: U-Boot Mailing List <u-boot@lists.denx.de> Subject: [PATCH 12/33] sandbox: Use a prefix for all allocation functions Date: Sun, 12 Jan 2020 12:06:03 -0700 Message-Id: <20200112120216.12.Ic9d42a8ad4850e8e677336e4e07bee8b62ad2fb0@changeid> X-Mailer: git-send-email 2.25.0.rc1.283.g88dfdc4193-goog In-Reply-To: <20200112190624.79077-1-sjg@chromium.org> References: <20200112190624.79077-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.26 Precedence: list List-Id: U-Boot discussion <u-boot.lists.denx.de> List-Unsubscribe: <https://lists.denx.de/options/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=unsubscribe> List-Archive: <https://lists.denx.de/pipermail/u-boot/> List-Post: <mailto:u-boot@lists.denx.de> List-Help: <mailto:u-boot-request@lists.denx.de?subject=help> List-Subscribe: <https://lists.denx.de/listinfo/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=subscribe> Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" <u-boot-bounces@lists.denx.de> X-Virus-Scanned: clamav-milter 0.101.4 at phobos.denx.de X-Virus-Status: Clean |
Series |
sandbox: Move to SDL2
|
expand
|
diff --git a/include/malloc.h b/include/malloc.h index 5efa6920b2..f66c2e8617 100644 --- a/include/malloc.h +++ b/include/malloc.h @@ -788,8 +788,13 @@ struct mallinfo { */ -/* #define USE_DL_PREFIX */ - +/* + * Rename the U-Boot alloc functions so that sandbox can still use the system + * ones + */ +#ifdef CONFIG_SANDBOX +#define USE_DL_PREFIX +#endif /* @@ -892,6 +897,21 @@ void malloc_simple_info(void); # define pvALLOc dlpvalloc # define mALLINFo dlmallinfo # define mALLOPt dlmallopt + +/* Ensure that U-Boot actually uses these too */ +#define calloc dlcalloc +#define free(ptr) dlfree(ptr) +#define malloc(x) dlmalloc(x) +#define memalign dlmemalign +#define realloc dlrealloc +#define valloc dlvalloc +#define pvalloc dlpvalloc +#define mallinfo() dlmallinfo() +#define mallopt dlmallopt +#define malloc_trim dlmalloc_trim +#define malloc_usable_size dlmalloc_usable_size +#define malloc_stats dlmalloc_stats + # else /* USE_DL_PREFIX */ # define cALLOc calloc # define fREe free
In order to allow use of both U-Boot's malloc() and the C library's version, set a prefix for the allocation functions so that they can co-exist. This is only done for sandbox. For other archs everything remains the same. Signed-off-by: Simon Glass <sjg@chromium.org> --- include/malloc.h | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-)