]> git.proxmox.com Git - mirror_qemu.git/commitdiff
spapr/rtas: modify spapr_rtas_register() to remove RTAS handlers
authorCédric Le Goater <clg@kaod.org>
Thu, 21 Mar 2019 14:49:07 +0000 (15:49 +0100)
committerDavid Gibson <david@gibson.dropbear.id.au>
Fri, 26 Apr 2019 00:41:23 +0000 (10:41 +1000)
Removing RTAS handlers will become necessary when the new pseries
machine supporting multiple interrupt mode is introduced.

Signed-off-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20190321144914.19934-9-clg@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/ppc/spapr_rtas.c
include/hw/ppc/spapr.h

index 24c45b12d46bfdfc812f63efb66116aca1694ed1..ee24212765bedeedfdb8b7d33c09372260af40c9 100644 (file)
@@ -404,7 +404,7 @@ void spapr_rtas_register(int token, const char *name, spapr_rtas_fn fn)
 
     token -= RTAS_TOKEN_BASE;
 
-    assert(!rtas_table[token].name);
+    assert(!name || !rtas_table[token].name);
 
     rtas_table[token].name = name;
     rtas_table[token].fn = fn;
index 02b5ce7e40123a7bd3d6eddda1941f773837fe1d..9331f5e0b9551013d21ab16c941f623035bd5679 100644 (file)
@@ -675,6 +675,10 @@ typedef void (*spapr_rtas_fn)(PowerPCCPU *cpu, SpaprMachineState *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_ulong args,
                              uint32_t nret, target_ulong rets);