bc092b9
From bd4e40aadded7093908d786d03b4acf60b7b1707 Mon Sep 17 00:00:00 2001
bc092b9
From: Eric Snowberg <eric.snowberg@oracle.com>
bc092b9
Date: Thu, 11 May 2017 18:42:23 -0700
78e1a10
Subject: [PATCH 037/216] sparc64: Close cdboot ihandle
bc092b9
bc092b9
The ihandle is left open with a cd-core image.  This will cause a delay
bc092b9
booting grub from a virtual cdrom in a LDOM.  It will also cause problems
bc092b9
as Linux boots, since it expects the ihandle to be closed during init.
bc092b9
bc092b9
Orabug: 25911275
bc092b9
bc092b9
Signed-off-by: Eric Snowberg <eric.snowberg@oracle.com>
bc092b9
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
bc092b9
---
bc092b9
 grub-core/boot/sparc64/ieee1275/boot.S | 10 ++++++++++
bc092b9
 1 file changed, 10 insertions(+)
bc092b9
bc092b9
diff --git a/grub-core/boot/sparc64/ieee1275/boot.S b/grub-core/boot/sparc64/ieee1275/boot.S
ec4acbb
index 586efb4014e..9ea9b4e0662 100644
bc092b9
--- a/grub-core/boot/sparc64/ieee1275/boot.S
bc092b9
+++ b/grub-core/boot/sparc64/ieee1275/boot.S
bc092b9
@@ -69,6 +69,10 @@ prom_seek_name:		.asciz "seek"
bc092b9
 prom_read_name:		.asciz "read"
bc092b9
 prom_exit_name:		.asciz "exit"
bc092b9
 grub_name:		.asciz "GRUB "
bc092b9
+#ifdef CDBOOT
bc092b9
+prom_close_name:	.asciz "close"
bc092b9
+#endif
bc092b9
+
bc092b9
 #define GRUB_NAME_LEN	5
bc092b9
 
bc092b9
 	.align	4
bc092b9
@@ -213,6 +217,12 @@ bootpath_known:
bc092b9
 	call	prom_call_3_1_o1
bc092b9
 #ifdef CDBOOT
bc092b9
 	 LDUW_ABS(kernel_size, 0x00, %o3)
bc092b9
+
bc092b9
+	GET_ABS(prom_close_name, %o0)
bc092b9
+	mov	1, %g1
bc092b9
+	mov	0, %o5
bc092b9
+	call	prom_call
bc092b9
+	 mov	BOOTDEV_REG, %o1
bc092b9
 #else
bc092b9
 	 mov	512, %o3
bc092b9
 #endif
bc092b9
-- 
ec4acbb
2.15.0
bc092b9