Add block-size to partition packages.

Yaboot uses "block-size" with disk-label packages.

This patch add block-size to all partitions packages.

Signed-off-by: Laurent Vivier <Laurent@lvivier.info>


git-svn-id: svn://coreboot.org/openbios/openbios-devel@291 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
Laurent Vivier
2008-12-18 20:44:20 +00:00
committed by Blue Swirl
parent 4fdc0e0fff
commit 5766c8fb3a
4 changed files with 40 additions and 1 deletions

View File

@@ -200,12 +200,30 @@ dlabel_load( __attribute__((unused)) dlabel_info_t *di )
PUSH(0);
}
static void
dlabel_block_size( dlabel_info_t *di )
{
xt_t xt;
if( !di->part_ih )
goto no_handler;
xt = find_ih_method("block-size", di->part_ih);
if ( !xt )
goto no_handler;
call_package( xt , di->part_ih );
return;
no_handler:
PUSH(512);
}
NODE_METHODS( dlabel ) = {
{ "open", dlabel_open },
{ "close", dlabel_close },
{ "offset", dlabel_offset },
{ "load", dlabel_load },
{ "block-size", dlabel_block_size },
{ "read", dlabel_read },
{ "write", dlabel_write },
{ "seek", dlabel_seek },

View File

@@ -118,6 +118,12 @@ macparts_get_info( macparts_info_t *di )
DPRINTF("macparts_get_info %lld %lld\n", di->offs, di->size);
}
static void
macparts_block_size( __attribute__((unused))macparts_info_t *di )
{
PUSH(512);
}
static void
macparts_initialize( macparts_info_t *di )
{
@@ -128,6 +134,7 @@ NODE_METHODS( macparts ) = {
{ "probe", macparts_probe },
{ "open", macparts_open },
{ "get-info", macparts_get_info },
{ "block-size", macparts_block_size },
{ NULL, macparts_initialize },
};

View File

@@ -185,6 +185,12 @@ pcparts_get_info( pcparts_info_t *di )
DPUSH( di->size );
}
static void
pcparts_block_size( __attribute__((unused))pcparts_info_t *di )
{
PUSH(512);
}
static void
pcparts_initialize( pcparts_info_t *di )
{
@@ -195,6 +201,7 @@ NODE_METHODS( pcparts ) = {
{ "probe", pcparts_probe },
{ "open", pcparts_open },
{ "get-info", pcparts_get_info },
{ "block-size", pcparts_block_size },
{ NULL, pcparts_initialize },
};

View File

@@ -172,6 +172,12 @@ sunparts_get_info( sunparts_info_t *di )
PUSH( di->size_hi );
}
static void
sunparts_block_size( __attribute__((unused))sunparts_info_t *di )
{
PUSH(512);
}
static void
sunparts_initialize( __attribute__((unused))sunparts_info_t *di )
{
@@ -182,6 +188,7 @@ NODE_METHODS( sunparts ) = {
{ "probe", sunparts_probe },
{ "open", sunparts_open },
{ "get-info", sunparts_get_info },
{ "block-size", sunparts_block_size },
{ NULL, sunparts_initialize },
};