Author: mcayland
Date: Wed Aug 11 18:41:36 2010
New Revision: 850
URL: http://tracker.coreboot.org/trac/openbios/changeset/850
Log:
Fix up obp_devclose on SPARC32 - Forth's close-dev doesn't actually return a result code, so we fix it as 1 (to indicate success) for the v0
callback as suggested by Google, and simply return nothing for the v2 callback as indicated by the romvec structure. This allows us to remove the
extra POP() which was causing a stack underflow error which was affecting Solaris 8 installation kernel boot.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland(a)siriusit.co.uk>
Modified:
trunk/openbios-devel/arch/sparc32/romvec.c
Modified: trunk/openbios-devel/arch/sparc32/romvec.c
==============================================================================
--- trunk/openbios-devel/arch/sparc32/romvec.c Tue Aug 10 20:16:46 2010 (r849)
+++ trunk/openbios-devel/arch/sparc32/romvec.c Wed Aug 11 18:41:36 2010 (r850)
@@ -279,17 +279,26 @@
static int obp_devclose(int dev_desc)
{
- int ret;
+ int ret = 1;
PUSH(dev_desc);
fword("close-dev");
- ret = POP();
DPRINTF("obp_devclose(0x%x) = %d\n", dev_desc, ret);
return ret;
}
+static void obp_devclose_v2(int dev_desc)
+{
+ PUSH(dev_desc);
+ fword("close-dev");
+
+ DPRINTF("obp_devclose_v2(0x%x)\n", dev_desc);
+
+ return;
+}
+
static int obp_rdblkdev(int dev_desc, int num_blks, int offset, char *buf)
{
int ret, hi, lo, bs;
@@ -459,7 +468,7 @@
romvec0.pv_v2devops.v2_dumb_mmap = obp_dumb_mmap;
romvec0.pv_v2devops.v2_dumb_munmap = obp_dumb_munmap;
romvec0.pv_v2devops.v2_dev_open = obp_devopen;
- romvec0.pv_v2devops.v2_dev_close = (void (*)(int))obp_devclose;
+ romvec0.pv_v2devops.v2_dev_close = obp_devclose_v2;
romvec0.pv_v2devops.v2_dev_read = obp_devread;
romvec0.pv_v2devops.v2_dev_write = obp_devwrite;
romvec0.pv_v2devops.v2_dev_seek = obp_devseek;