From 5f2e2ba2625d6fa4ecbc2af86e076c20ab84c171 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Wed, 4 Apr 2012 15:02:07 +1000 Subject: pseries: Consolidate hack for RTAS display-character usage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently the pseries machine contains not one but two somewhat ugly hacks to allow printing of early debug messages before the guest has properly read the device tree. First, we special case H_PUT_TERM_CHAR so that a vtermno of 0 (usually invalid) will look for a suitable vty and use that. This supports Linux's early debug code which will use H_PUT_TERM_CHAR with vtermno==0 before reading the device tree. Second, we support the RTAS display-character call. This takes no vtermno so we assume the address of the default first VTY. This patch makes things more consistent by folding the second hack into the first. Now, display-character uses the existing vty_lookup() function to do the same search for a suitable VTY. Signed-off-by: David Gibson Signed-off-by: Andreas Färber --- hw/spapr_rtas.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'hw/spapr_rtas.c') diff --git a/hw/spapr_rtas.c b/hw/spapr_rtas.c index 480a4ae9e..ae1859515 100644 --- a/hw/spapr_rtas.c +++ b/hw/spapr_rtas.c @@ -44,8 +44,7 @@ static void rtas_display_character(sPAPREnvironment *spapr, uint32_t nret, target_ulong rets) { uint8_t c = rtas_ld(args, 0); - VIOsPAPRDevice *sdev = spapr_vio_find_by_reg(spapr->vio_bus, - SPAPR_VTY_BASE_ADDRESS); + VIOsPAPRDevice *sdev = vty_lookup(spapr, 0); if (!sdev) { rtas_st(rets, 0, -1); -- cgit v1.2.3