Received: from eggs.gnu.org ([209.51.188.92]:59873) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJu0T-0005Mv-8W for qemu-devel@nongnu.org; Fri, 26 Apr 2019 02:06:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hJu0S-0004G3-8K for qemu-devel@nongnu.org; Fri, 26 Apr 2019 02:06:45 -0400 From: David Gibson Date: Fri, 26 Apr 2019 16:05:54 +1000 Message-Id: <20190426060627.18153-4-david@gibson.dropbear.id.au> In-Reply-To: <20190426060627.18153-1-david@gibson.dropbear.id.au> References: <20190426060627.18153-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL 03/36] spapr/rtas: modify spapr_rtas_register() to remove RTAS handlers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: peter.maydell@linaro.org Cc: gkurz@kaod.org, clg@kaod.org, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, David Gibson From: C=C3=A9dric Le Goater Removing RTAS handlers will become necessary when the new pseries machine supporting multiple interrupt mode is introduced. Signed-off-by: C=C3=A9dric Le Goater Message-Id: <20190321144914.19934-9-clg@kaod.org> Signed-off-by: David Gibson --- hw/ppc/spapr_rtas.c | 2 +- include/hw/ppc/spapr.h | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c index 24c45b12d4..ee24212765 100644 --- a/hw/ppc/spapr_rtas.c +++ b/hw/ppc/spapr_rtas.c @@ -404,7 +404,7 @@ void spapr_rtas_register(int token, const char *name,= spapr_rtas_fn fn) =20 token -=3D RTAS_TOKEN_BASE; =20 - assert(!rtas_table[token].name); + assert(!name || !rtas_table[token].name); =20 rtas_table[token].name =3D name; rtas_table[token].fn =3D fn; diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h index 02b5ce7e40..9331f5e0b9 100644 --- a/include/hw/ppc/spapr.h +++ b/include/hw/ppc/spapr.h @@ -675,6 +675,10 @@ typedef void (*spapr_rtas_fn)(PowerPCCPU *cpu, Spapr= MachineState *sm, uint32_t nargs, target_ulong args, uint32_t nret, target_ulong rets); void spapr_rtas_register(int token, const char *name, spapr_rtas_fn fn); +static inline void spapr_rtas_unregister(int token) +{ + spapr_rtas_register(token, NULL, NULL); +} target_ulong spapr_rtas_call(PowerPCCPU *cpu, SpaprMachineState *sm, uint32_t token, uint32_t nargs, target_ulon= g args, uint32_t nret, target_ulong rets); --=20 2.20.1