From patchwork Wed Jan 17 10:40:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jones X-Patchwork-Id: 10169015 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 73001601D3 for ; Wed, 17 Jan 2018 10:40:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6092C27CF3 for ; Wed, 17 Jan 2018 10:40:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5528C2847B; Wed, 17 Jan 2018 10:40:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DD9FE27CF3 for ; Wed, 17 Jan 2018 10:40:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752574AbeAQKky (ORCPT ); Wed, 17 Jan 2018 05:40:54 -0500 Received: from mx1.redhat.com ([209.132.183.28]:47620 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750816AbeAQKko (ORCPT ); Wed, 17 Jan 2018 05:40:44 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1878E2DB702; Wed, 17 Jan 2018 10:40:44 +0000 (UTC) Received: from kamzik.brq.redhat.com (unknown [10.43.2.160]) by smtp.corp.redhat.com (Postfix) with ESMTP id 174B060CA0; Wed, 17 Jan 2018 10:40:40 +0000 (UTC) From: Andrew Jones To: kvm@vger.kernel.org Cc: pbonzini@redhat.com, rkrcmar@redhat.com, cdall@linaro.org, david@redhat.com, lvivier@redhat.com, thuth@redhat.com Subject: [PATCH kvm-unit-tests v2 10/12] lib/auxinfo: add flags field Date: Wed, 17 Jan 2018 11:40:03 +0100 Message-Id: <20180117104005.29211-11-drjones@redhat.com> In-Reply-To: <20180117104005.29211-1-drjones@redhat.com> References: <20180117104005.29211-1-drjones@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Wed, 17 Jan 2018 10:40:44 +0000 (UTC) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Andrew Jones --- arm/Makefile.common | 3 ++- lib/auxinfo.c | 13 ++++++++++++- lib/auxinfo.h | 1 + 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/arm/Makefile.common b/arm/Makefile.common index 0a039cff5f94..b4174af6b692 100644 --- a/arm/Makefile.common +++ b/arm/Makefile.common @@ -22,6 +22,7 @@ all: directories $(tests-all) ################################################################## phys_base = $(LOADADDR) +AUXFLAGS ?= 0x0 CFLAGS += -std=gnu99 CFLAGS += -ffreestanding @@ -69,7 +70,7 @@ FLATLIBS = $(libcflat) $(LIBFDT_archive) $(libgcc) $(libeabi) $(CC) $(LDFLAGS) -o $@ \ -Wl,-T,$(SRCDIR)/arm/flat.lds,--build-id=none,-Ttext=$(start_addr) \ $(filter %.o, $^) $(FLATLIBS) \ - $(SRCDIR)/lib/auxinfo.c -DPROGNAME=\"$(@:.elf=.flat)\" + $(SRCDIR)/lib/auxinfo.c -DPROGNAME=\"$(@:.elf=.flat)\" -DAUXFLAGS=$(AUXFLAGS) %.flat: %.elf $(OBJCOPY) -O binary $^ $@ diff --git a/lib/auxinfo.c b/lib/auxinfo.c index bffeac2f7ecb..a646306364b7 100644 --- a/lib/auxinfo.c +++ b/lib/auxinfo.c @@ -1,2 +1,13 @@ #include "auxinfo.h" -struct auxinfo auxinfo = { PROGNAME }; + +#ifndef PROGNAME +#define PROGNAME ((void *)0) +#endif +#ifndef AUXFLAGS +#define AUXFLAGS 0 +#endif + +struct auxinfo auxinfo = { + .progname = PROGNAME, + .flags = AUXFLAGS, +}; diff --git a/lib/auxinfo.h b/lib/auxinfo.h index 669ba5dabefe..c074f43a0b83 100644 --- a/lib/auxinfo.h +++ b/lib/auxinfo.h @@ -6,6 +6,7 @@ #define _AUXINFO_H_ struct auxinfo { const char *progname; + unsigned long flags; }; /* No extern! Define a common symbol. */