2004-10-03 Hollis Blanchard <hollis@penguinppc.org>
* boot/powerpc/ieee1275/ieee1275.c (grub_ieee1275_claim): change void * arguments to grub_addr_t. All callers updated. Also make the `result' argument optional. (grub_ieee1275_release): change void * arguments to grub_addr_t. All callers updated.
This commit is contained in:
parent
8a572cd742
commit
9f2220ef28
5 changed files with 27 additions and 17 deletions
|
@ -1,3 +1,12 @@
|
|||
2004-10-03 Hollis Blanchard <hollis@penguinppc.org>
|
||||
|
||||
* boot/powerpc/ieee1275/ieee1275.c (grub_ieee1275_claim): change
|
||||
void * arguments to grub_addr_t. All callers updated. Also make
|
||||
the `result' argument optional.
|
||||
(grub_ieee1275_release): change void * arguments to grub_addr_t.
|
||||
All callers updated.
|
||||
|
||||
|
||||
2004-09-22 Hollis Blanchard <hollis@penguinppc.org>
|
||||
|
||||
* commands/ls.c (grub_ls_list_files): Use the string following the
|
||||
|
|
|
@ -398,39 +398,42 @@ grub_ieee1275_close (grub_ieee1275_ihandle_t ihandle)
|
|||
}
|
||||
|
||||
int
|
||||
grub_ieee1275_claim (void *p, grub_size_t size,
|
||||
unsigned int align, void **result)
|
||||
grub_ieee1275_claim (grub_addr_t addr, grub_size_t size, unsigned int align,
|
||||
grub_addr_t *result)
|
||||
{
|
||||
struct claim_args {
|
||||
struct grub_ieee1275_common_hdr common;
|
||||
void *p;
|
||||
grub_addr_t addr;
|
||||
grub_size_t size;
|
||||
unsigned int align;
|
||||
void *addr;
|
||||
grub_addr_t base;
|
||||
} args;
|
||||
|
||||
INIT_IEEE1275_COMMON (&args.common, "claim", 3, 1);
|
||||
args.p = p;
|
||||
args.addr = addr;
|
||||
args.size = size;
|
||||
args.align = align;
|
||||
|
||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
||||
return -1;
|
||||
*result = args.addr;
|
||||
|
||||
if (result)
|
||||
*result = args.base;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
grub_ieee1275_release (void *p, grub_size_t size)
|
||||
grub_ieee1275_release (grub_addr_t addr, grub_size_t size)
|
||||
{
|
||||
struct release_args {
|
||||
struct grub_ieee1275_common_hdr common;
|
||||
void *p;
|
||||
grub_addr_t addr;
|
||||
grub_size_t size;
|
||||
} args;
|
||||
|
||||
INIT_IEEE1275_COMMON (&args.common, "release", 2, 0);
|
||||
args.p = p;
|
||||
args.addr = addr;
|
||||
args.size = size;
|
||||
|
||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
||||
|
|
|
@ -83,9 +83,9 @@ int EXPORT_FUNC(grub_ieee1275_exit) (void);
|
|||
int EXPORT_FUNC(grub_ieee1275_open) (char *node,
|
||||
grub_ieee1275_ihandle_t *result);
|
||||
int EXPORT_FUNC(grub_ieee1275_close) (grub_ieee1275_ihandle_t ihandle);
|
||||
int EXPORT_FUNC(grub_ieee1275_claim) (void *p, grub_size_t size, unsigned int align,
|
||||
void **result);
|
||||
int EXPORT_FUNC(grub_ieee1275_release) (void *p, grub_size_t size);
|
||||
int EXPORT_FUNC(grub_ieee1275_claim) (grub_addr_t addr, grub_size_t size,
|
||||
unsigned int align, grub_addr_t *result);
|
||||
int EXPORT_FUNC(grub_ieee1275_release) (grub_addr_t addr, grub_size_t size);
|
||||
int EXPORT_FUNC(grub_ieee1275_set_property) (grub_ieee1275_phandle_t phandle,
|
||||
const char *propname, void *buf,
|
||||
grub_size_t size,
|
||||
|
|
|
@ -49,9 +49,7 @@ abort (void)
|
|||
void
|
||||
grub_machine_init (void)
|
||||
{
|
||||
void *mem;
|
||||
|
||||
if (grub_ieee1275_claim ((void *) 0x300000, 0x150000, 0, &mem) == -1)
|
||||
if (grub_ieee1275_claim (0x300000, 0x150000, 0, 0) == -1)
|
||||
abort (); /* Damn, we are in trouble! */
|
||||
|
||||
/* The memory allocations were copied from yaboot. */
|
||||
|
|
|
@ -76,7 +76,7 @@ grub_linux_release_mem (void)
|
|||
grub_free (linux_args);
|
||||
linux_args = 0;
|
||||
|
||||
if (linux_addr && grub_ieee1275_release ((void *) linux_addr, linux_size))
|
||||
if (linux_addr && grub_ieee1275_release (linux_addr, linux_size))
|
||||
return grub_error (GRUB_ERR_OUT_OF_MEMORY, "Can not release memory");
|
||||
|
||||
linux_addr = 0;
|
||||
|
@ -188,7 +188,7 @@ grub_load_linux (int argc, char *argv[])
|
|||
/* Reserve memory for the kernel. */
|
||||
linux_size += 0x100000;
|
||||
|
||||
if (grub_ieee1275_claim ((void *) entry, linux_size, 0, (void *) &linux_addr) == -1)
|
||||
if (grub_ieee1275_claim (entry, linux_size, 0, &linux_addr) == -1)
|
||||
{
|
||||
grub_error (GRUB_ERR_OUT_OF_MEMORY, "Can not claim memory");
|
||||
goto fail;
|
||||
|
|
Loading…
Reference in a new issue