qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: agraf@suse.de
Cc: Michael Ellerman <michael@ellerman.id.au>,
	qemu-ppc@nongnu.org, qemu-devel@nongnu.org,
	David Gibson <david@gibson.dropbear.id.au>
Subject: [Qemu-devel] [PATCH 6/8] pseries: Return the token when we register an RTAS call
Date: Thu, 11 Oct 2012 21:47:42 +1000	[thread overview]
Message-ID: <1349956064-26709-7-git-send-email-david@gibson.dropbear.id.au> (raw)
In-Reply-To: <1349956064-26709-1-git-send-email-david@gibson.dropbear.id.au>

From: Michael Ellerman <michael@ellerman.id.au>

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 <michael@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
 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 54960f3..f6864da 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 b96078b..38c105f 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, target_phys_addr_t rtas_addr,
-- 
1.7.10.4

  parent reply	other threads:[~2012-10-11 11:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-11 11:47 [Qemu-devel] [0/8] Pending pseries patches David Gibson
2012-10-11 11:47 ` [Qemu-devel] [PATCH 1/8] target-ppc: Extend FPU state for newer POWER CPUs David Gibson
2012-10-11 11:47 ` [Qemu-devel] [PATCH 2/8] pseries: Clean up inconsistent variable name in xics.c David Gibson
2012-10-11 11:47 ` [Qemu-devel] [PATCH 3/8] pseries: Use #define for XICS base irq number David Gibson
2012-10-11 11:47 ` [Qemu-devel] [PATCH 4/8] pseries: Cleanup duplications of ics_valid_irq() code David Gibson
2012-10-11 11:47 ` [Qemu-devel] [PATCH 5/8] pseries: Move XICS initialization before cpu initialization David Gibson
2012-10-11 11:47 ` David Gibson [this message]
2012-10-11 11:47 ` [Qemu-devel] [PATCH 7/8] pseries: Allow RTAS tokens without a qemu handler David Gibson
2012-10-11 11:47 ` [Qemu-devel] [PATCH 8/8] pseries: Add tracepoints to the XICS interrupt controller David Gibson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1349956064-26709-7-git-send-email-david@gibson.dropbear.id.au \
    --to=david@gibson.dropbear.id.au \
    --cc=agraf@suse.de \
    --cc=michael@ellerman.id.au \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).