[OpenBIOS] r265 - in openbios-devel: config/examples modules
svn at openbios.org
svn at openbios.org
Tue Nov 25 20:54:02 CET 2008
Author: blueswirl
Date: 2008-11-25 20:54:01 +0100 (Tue, 25 Nov 2008)
New Revision: 265
Modified:
openbios-devel/config/examples/cross-ppc_config.xml
openbios-devel/modules/mac-parts.c
Log:
Yaboot needs to be able to open partition 0.
Add some traces.
Signed-off-by: Laurent Vivier <Laurent at lvivier.info>
Modified: openbios-devel/config/examples/cross-ppc_config.xml
===================================================================
--- openbios-devel/config/examples/cross-ppc_config.xml 2008-11-25 19:50:53 UTC (rev 264)
+++ openbios-devel/config/examples/cross-ppc_config.xml 2008-11-25 19:54:01 UTC (rev 265)
@@ -38,6 +38,8 @@
<!-- Filesystem Configuration -->
<option name="CONFIG_DISK_LABEL" type="boolean" value="true"/>
<option name="CONFIG_PART_SUPPORT" type="boolean" value="true"/>
+ <option name="CONFIG_MAC_PARTS" type="boolean" value="true"/>
+ <option name="CONFIG_DEBUG_MAC_PARTS" type="boolean" value="false"/>
<option name="CONFIG_PC_PARTS" type="boolean" value="true"/>
<option name="CONFIG_FS" type="boolean" value="true"/>
<option name="CONFIG_HFS" type="boolean" value="false"/>
Modified: openbios-devel/modules/mac-parts.c
===================================================================
--- openbios-devel/modules/mac-parts.c 2008-11-25 19:50:53 UTC (rev 264)
+++ openbios-devel/modules/mac-parts.c 2008-11-25 19:54:01 UTC (rev 265)
@@ -19,6 +19,13 @@
#include "mac-parts.h"
#include "modules.h"
+#ifdef CONFIG_DEBUG_MAC_PARTS
+#define DPRINTF(fmt, args...) \
+do { printk("MAC-PARTS: " fmt , ##args); } while (0)
+#else
+#define DPRINTF(fmt, args...) do {} while(0)
+#endif
+
typedef struct {
ullong offs;
ullong size;
@@ -41,8 +48,6 @@
desc_map_t dmap;
part_entry_t par;
- /* printk("macparts_open '%s'\n", str ); */
-
if( str ) {
parnum = atol(str);
if( !strlen(str) )
@@ -52,6 +57,7 @@
if( parnum < 0 )
parnum = 1;
+ DPRINTF("macparts_open %d\n", parnum);
SEEK( 0 );
if( READ(&dmap, sizeof(dmap)) != sizeof(dmap) )
RET(0);
@@ -66,6 +72,12 @@
if( par.pmSig == 0x504d /* 'PM' */ )
bs = 512;
}
+ if (parnum == 0) {
+ di->offs = (llong)0;
+ di->size = (llong)dmap.sbBlkCount * bs;
+ PUSH( -1 );
+ return;
+ }
SEEK( bs );
if( READ(&par, sizeof(par)) != sizeof(par) )
RET(0);
@@ -89,7 +101,8 @@
macparts_probe( macparts_info_t *dummy )
{
desc_map_t *dmap = (desc_map_t*)POP();
-
+
+ DPRINTF("macparts_probe %x ?= %x\n", dmap->sbSig, DESC_MAP_SIGNATURE);
if( dmap->sbSig != DESC_MAP_SIGNATURE )
RET(0);
RET(-1);
@@ -102,6 +115,7 @@
PUSH( -1 ); /* no type */
DPUSH( di->offs );
DPUSH( di->size );
+ DPRINTF("macparts_get_info %lld %lld\n", di->offs, di->size);
}
static void
More information about the OpenBIOS
mailing list