* commands/lsmmap.c (grub_cmd_lsmmap): Add casts to avoid printf
warnings. * kern/ieee1275/openfw.c (grub_claimmap): Likewise. * disk/ieee1275/ofdisk.c (grub_ofdisk_open, grub_ofdisk_close, grub_ofdisk_read): Likewise, and deal similarly with the fact that ihandles have a 32-bit type but need to be stored in a "void *".
This commit is contained in:
parent
2e08a26a8e
commit
979b4fb416
4 changed files with 23 additions and 12 deletions
|
@ -1,3 +1,12 @@
|
||||||
|
2009-04-29 David S. Miller <davem@davemloft.net>
|
||||||
|
|
||||||
|
* commands/lsmmap.c (grub_cmd_lsmmap): Add casts to avoid printf
|
||||||
|
warnings.
|
||||||
|
* kern/ieee1275/openfw.c (grub_claimmap): Likewise.
|
||||||
|
* disk/ieee1275/ofdisk.c (grub_ofdisk_open, grub_ofdisk_close,
|
||||||
|
grub_ofdisk_read): Likewise, and deal similarly with the fact that
|
||||||
|
ihandles have a 32-bit type but need to be stored in a "void *".
|
||||||
|
|
||||||
2009-04-28 Pavel Roskin <proski@gnu.org>
|
2009-04-28 Pavel Roskin <proski@gnu.org>
|
||||||
|
|
||||||
* disk/fs_uuid.c (grub_fs_uuid_open): Use parent->data for dev,
|
* disk/fs_uuid.c (grub_fs_uuid_open): Use parent->data for dev,
|
||||||
|
|
|
@ -30,7 +30,7 @@ grub_cmd_lsmmap (grub_command_t cmd __attribute__ ((unused)),
|
||||||
int NESTED_FUNC_ATTR hook (grub_uint64_t addr, grub_uint64_t size, grub_uint32_t type)
|
int NESTED_FUNC_ATTR hook (grub_uint64_t addr, grub_uint64_t size, grub_uint32_t type)
|
||||||
{
|
{
|
||||||
grub_printf ("base_addr = 0x%llx, length = 0x%llx, type = 0x%x\n",
|
grub_printf ("base_addr = 0x%llx, length = 0x%llx, type = 0x%x\n",
|
||||||
addr, size, type);
|
(long long) addr, (long long) size, type);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
grub_machine_mmap_iterate (hook);
|
grub_machine_mmap_iterate (hook);
|
||||||
|
|
|
@ -155,7 +155,8 @@ grub_ofdisk_open (const char *name, grub_disk_t disk)
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
grub_dprintf ("disk", "Opened `%s' as handle %p.\n", op->devpath, (void *) dev_ihandle);
|
grub_dprintf ("disk", "Opened `%s' as handle %p.\n", op->devpath,
|
||||||
|
(void *) (unsigned long) dev_ihandle);
|
||||||
|
|
||||||
if (grub_ieee1275_finddevice (op->devpath, &dev))
|
if (grub_ieee1275_finddevice (op->devpath, &dev))
|
||||||
{
|
{
|
||||||
|
@ -185,7 +186,7 @@ grub_ofdisk_open (const char *name, grub_disk_t disk)
|
||||||
|
|
||||||
/* XXX: Read this, somehow. */
|
/* XXX: Read this, somehow. */
|
||||||
disk->has_partitions = 1;
|
disk->has_partitions = 1;
|
||||||
disk->data = (void *) dev_ihandle;
|
disk->data = (void *) (unsigned long) dev_ihandle;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
|
@ -199,7 +200,7 @@ grub_ofdisk_close (grub_disk_t disk)
|
||||||
{
|
{
|
||||||
grub_dprintf ("disk", "Closing handle %p.\n",
|
grub_dprintf ("disk", "Closing handle %p.\n",
|
||||||
(void *) disk->data);
|
(void *) disk->data);
|
||||||
grub_ieee1275_close ((grub_ieee1275_ihandle_t) disk->data);
|
grub_ieee1275_close ((grub_ieee1275_ihandle_t) (unsigned long) disk->data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static grub_err_t
|
static grub_err_t
|
||||||
|
@ -211,21 +212,21 @@ grub_ofdisk_read (grub_disk_t disk, grub_disk_addr_t sector,
|
||||||
|
|
||||||
grub_dprintf ("disk",
|
grub_dprintf ("disk",
|
||||||
"Reading handle %p: sector 0x%llx, size 0x%lx, buf %p.\n",
|
"Reading handle %p: sector 0x%llx, size 0x%lx, buf %p.\n",
|
||||||
(void *) disk->data, sector, (long) size, buf);
|
(void *) disk->data, (long long) sector, (long) size, buf);
|
||||||
|
|
||||||
pos = sector * 512UL;
|
pos = sector * 512UL;
|
||||||
|
|
||||||
grub_ieee1275_seek ((grub_ieee1275_ihandle_t) disk->data, (int) (pos >> 32),
|
grub_ieee1275_seek ((grub_ieee1275_ihandle_t) (unsigned long) disk->data,
|
||||||
(int) pos & 0xFFFFFFFFUL, &status);
|
(int) (pos >> 32), (int) pos & 0xFFFFFFFFUL, &status);
|
||||||
if (status < 0)
|
if (status < 0)
|
||||||
return grub_error (GRUB_ERR_READ_ERROR,
|
return grub_error (GRUB_ERR_READ_ERROR,
|
||||||
"Seek error, can't seek block %llu",
|
"Seek error, can't seek block %llu",
|
||||||
sector);
|
(long long) sector);
|
||||||
grub_ieee1275_read ((grub_ieee1275_ihandle_t) disk->data, buf,
|
grub_ieee1275_read ((grub_ieee1275_ihandle_t) (unsigned long) disk->data,
|
||||||
size * 512UL, &actual);
|
buf, size * 512UL, &actual);
|
||||||
if (actual != actual)
|
if (actual != actual)
|
||||||
return grub_error (GRUB_ERR_READ_ERROR, "Read error on block: %llu",
|
return grub_error (GRUB_ERR_READ_ERROR, "Read error on block: %llu",
|
||||||
sector);
|
(long long) sector);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -238,7 +238,8 @@ grub_claimmap (grub_addr_t addr, grub_size_t size)
|
||||||
if (! grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_REAL_MODE)
|
if (! grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_REAL_MODE)
|
||||||
&& grub_map (addr, addr, size, 0x00))
|
&& grub_map (addr, addr, size, 0x00))
|
||||||
{
|
{
|
||||||
grub_printf ("map failed: address 0x%x, size 0x%x\n", addr, size);
|
grub_printf ("map failed: address 0x%llx, size 0x%llx\n",
|
||||||
|
(long long) addr, (long long) size);
|
||||||
grub_ieee1275_release (addr, size);
|
grub_ieee1275_release (addr, size);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue