spapr_drc: use RTAS return codes for methods called by RTAS
commit0cb688d22b3941af02fee78ba21dc3a39c367e0b
authorMichael Roth <mdroth@linux.vnet.ibm.com>
Thu, 10 Sep 2015 21:11:02 +0000 (10 16:11 -0500)
committerDavid Gibson <david@gibson.dropbear.id.au>
Wed, 23 Sep 2015 00:51:10 +0000 (23 10:51 +1000)
treef235047d76e375ecdce8e28f2ad277118086267f
parent4a1c9cf0073e733b421e7b82ad673e7cf6ed8454
spapr_drc: use RTAS return codes for methods called by RTAS

Certain methods in sPAPRDRConnector objects are only ever called by
RTAS and in many cases are responsible for the logic that determines
the RTAS return codes.

Rather than having a level of indirection requiring RTAS code to
re-interpret return values from such methods to determine the
appropriate return code, just pass them through directly.

This requires changing method return types to uint32_t to match the
type of values currently passed to RTAS helpers.

In the case of read accesses like drc->entity_sense() where we weren't
previously reporting any errors, just the read value, we modify the
function to return RTAS return code, and pass the read value back via
reference.

Suggested-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
Suggested-by: David Gibson <david@gibson.dropbear.id.au>
Cc: Bharata B Rao <bharata@linux.vnet.ibm.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/ppc/spapr_drc.c
hw/ppc/spapr_rtas.c
include/hw/ppc/spapr_drc.h