From 4aac82c34675fcbd3722dfc3a2d04c839215ec6b Mon Sep 17 00:00:00 2001 From: Michael Ellerman Date: Mon, 12 Nov 2012 16:46:52 +0000 Subject: pseries: Return the token when we register an RTAS call 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 Signed-off-by: Benjamin Herrenschmidt Signed-off-by: David Gibson Signed-off-by: Alexander Graf --- hw/spapr_rtas.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'hw/spapr_rtas.c') diff --git a/hw/spapr_rtas.c b/hw/spapr_rtas.c index 6d5c48a740..45294e8305 100644 --- a/hw/spapr_rtas.c +++ b/hw/spapr_rtas.c @@ -242,7 +242,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; @@ -258,7 +258,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, -- cgit 1.4.1