[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH 08/16] pseries: Return the token when we register an R
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PATCH 08/16] pseries: Return the token when we register an RTAS call |
Date: |
Tue, 30 Oct 2012 14:25:04 +1100 |
From: Michael Ellerman <address@hidden>
The kernel will soon be able to service some RTAS calls. However the
choice of tokens will still be up to userspace. To support this have
spapr_rtas_register() return the token that is allocated for an
RTAS call, that allows the calling code to tell the kernel what the
token value is.
Signed-off-by: Michael Ellerman <address@hidden>
Signed-off-by: Benjamin Herrenschmidt <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
hw/spapr.h | 2 +-
hw/spapr_rtas.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/spapr.h b/hw/spapr.h
index 51c709e..8f7ed85 100644
--- a/hw/spapr.h
+++ b/hw/spapr.h
@@ -320,7 +320,7 @@ static inline void rtas_st(target_ulong phys, int n,
uint32_t val)
typedef void (*spapr_rtas_fn)(sPAPREnvironment *spapr, uint32_t token,
uint32_t nargs, target_ulong args,
uint32_t nret, target_ulong rets);
-void spapr_rtas_register(const char *name, spapr_rtas_fn fn);
+int spapr_rtas_register(const char *name, spapr_rtas_fn fn);
target_ulong spapr_rtas_call(sPAPREnvironment *spapr,
uint32_t token, uint32_t nargs, target_ulong args,
uint32_t nret, target_ulong rets);
diff --git a/hw/spapr_rtas.c b/hw/spapr_rtas.c
index ce76c58..64114e8 100644
--- a/hw/spapr_rtas.c
+++ b/hw/spapr_rtas.c
@@ -239,7 +239,7 @@ target_ulong spapr_rtas_call(sPAPREnvironment *spapr,
return H_PARAMETER;
}
-void spapr_rtas_register(const char *name, spapr_rtas_fn fn)
+int spapr_rtas_register(const char *name, spapr_rtas_fn fn)
{
int i;
@@ -255,7 +255,7 @@ void spapr_rtas_register(const char *name, spapr_rtas_fn fn)
rtas_next->name = name;
rtas_next->fn = fn;
- rtas_next++;
+ return (rtas_next++ - rtas_table) + TOKEN_BASE;
}
int spapr_rtas_device_tree_setup(void *fdt, hwaddr rtas_addr,
--
1.7.10.4
- [Qemu-ppc] [PATCH 12/16] target-pcc: Convert ppcemb_tlb_t to use fixed 64-bit RPN, (continued)
- [Qemu-ppc] [PATCH 12/16] target-pcc: Convert ppcemb_tlb_t to use fixed 64-bit RPN, David Gibson, 2012/10/29
- [Qemu-ppc] [PATCH 16/16] pseries: Generate unique LIOBNs for PCI host bridges, David Gibson, 2012/10/29
- [Qemu-ppc] [PATCH 10/16] pseries: Add tracepoints to the XICS interrupt controller, David Gibson, 2012/10/29
- [Qemu-ppc] [PATCH 07/16] pseries: Move XICS initialization before cpu initialization, David Gibson, 2012/10/29
- [Qemu-ppc] [PATCH 15/16] pseries: Fix bug in PCI MSI allocation, David Gibson, 2012/10/29
- [Qemu-ppc] [PATCH 05/16] pseries: Use #define for XICS base irq number, David Gibson, 2012/10/29
- [Qemu-ppc] [PATCH 03/16] target-ppc: Extend FPU state for newer POWER CPUs, David Gibson, 2012/10/29
- [Qemu-ppc] [PATCH 11/16] pseries: Split xics irq configuration from state information, David Gibson, 2012/10/29
- [Qemu-ppc] [PATCH 02/16] target-ppc: Rework storage of VPA registration state, David Gibson, 2012/10/29
- [Qemu-ppc] [PATCH 13/16] pseries: Implement PAPR NVRAM, David Gibson, 2012/10/29
- [Qemu-ppc] [PATCH 08/16] pseries: Return the token when we register an RTAS call,
David Gibson <=
- [Qemu-ppc] [PATCH 14/16] pseries: Update SLOF for NVRAM support, David Gibson, 2012/10/29