2010-02-13 Vladimir Serbinenko <phcoder@gmail.com>
Fix over-4GiB seek on sparc64. * include/grub/ieee1275/ieee1275.h (grub_ieee1275_seek): Replace pos_i and pos_lo with pos. All users updated. * include/grub/powerpc/ieee1275/ieee1275.h (GRUB_IEEE1275_CELL_SIZEOF): New constant. * include/grub/sparc64/ieee1275/ieee1275.h (GRUB_IEEE1275_CELL_SIZEOF): Likewise. * kern/ieee1275/ieee1275.c (grub_ieee1275_seek): Split pos into pos_hi and pos_lo.
This commit is contained in:
parent
bdca260795
commit
ca62070b69
6 changed files with 28 additions and 6 deletions
|
@ -284,8 +284,8 @@ grub_ieee1275_read (grub_ieee1275_ihandle_t ihandle, void *buffer,
|
|||
}
|
||||
|
||||
int
|
||||
grub_ieee1275_seek (grub_ieee1275_ihandle_t ihandle, int pos_hi,
|
||||
int pos_lo, grub_ssize_t *result)
|
||||
grub_ieee1275_seek (grub_ieee1275_ihandle_t ihandle, grub_disk_addr_t pos,
|
||||
grub_ssize_t *result)
|
||||
{
|
||||
struct write_args
|
||||
{
|
||||
|
@ -299,8 +299,15 @@ grub_ieee1275_seek (grub_ieee1275_ihandle_t ihandle, int pos_hi,
|
|||
|
||||
INIT_IEEE1275_COMMON (&args.common, "seek", 3, 1);
|
||||
args.ihandle = ihandle;
|
||||
args.pos_hi = (grub_ieee1275_cell_t) pos_hi;
|
||||
args.pos_lo = (grub_ieee1275_cell_t) pos_lo;
|
||||
/* To prevent stupid gcc warning. */
|
||||
#if GRUB_IEEE1275_CELL_SIZEOF >= 8
|
||||
args.pos_hi = 0;
|
||||
args.pos_lo = pos;
|
||||
#else
|
||||
args.pos_hi = (grub_ieee1275_cell_t) (pos >> (8 * GRUB_IEEE1275_CELL_SIZEOF));
|
||||
args.pos_lo = (grub_ieee1275_cell_t)
|
||||
(pos & ((1ULL << (8 * GRUB_IEEE1275_CELL_SIZEOF)) - 1));
|
||||
#endif
|
||||
|
||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
||||
return -1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue