2004-04-04 Yoshinori K. Okuji <okuji@enbug.org>
All symbols prefixed with PUPA_ and pupa_ are renamed to GRUB_ and grub_, respectively. Because the conversion is trivial and mechanical, I omit the details here. Please refer to the CVS if you need more information.
This commit is contained in:
parent
6a1425510d
commit
4b13b216f4
125 changed files with 6198 additions and 6181 deletions
|
@ -1,6 +1,6 @@
|
|||
/* openfw.c -- Open firmware support funtions. */
|
||||
/*
|
||||
* PUPA -- Preliminary Universal Programming Architecture for GRUB
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
@ -18,59 +18,59 @@
|
|||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#include <pupa/err.h>
|
||||
#include <pupa/misc.h>
|
||||
#include <pupa/mm.h>
|
||||
#include <pupa/machine/ieee1275.h>
|
||||
#include <grub/err.h>
|
||||
#include <grub/misc.h>
|
||||
#include <grub/mm.h>
|
||||
#include <grub/machine/ieee1275.h>
|
||||
|
||||
/* Iterate through all device aliasses. Thisfunction can be used to
|
||||
find a device of a specific type. */
|
||||
pupa_err_t
|
||||
pupa_devalias_iterate (int (*hook) (struct pupa_ieee1275_devalias *alias))
|
||||
grub_err_t
|
||||
grub_devalias_iterate (int (*hook) (struct grub_ieee1275_devalias *alias))
|
||||
{
|
||||
pupa_ieee1275_phandle_t devalias;
|
||||
grub_ieee1275_phandle_t devalias;
|
||||
char aliasname[32];
|
||||
int actual;
|
||||
struct pupa_ieee1275_devalias alias;
|
||||
struct grub_ieee1275_devalias alias;
|
||||
|
||||
if (pupa_ieee1275_finddevice ("/aliases", &devalias))
|
||||
if (grub_ieee1275_finddevice ("/aliases", &devalias))
|
||||
return -1;
|
||||
|
||||
/* XXX: Is this the right way to find the first property? */
|
||||
aliasname[0] = '\0';
|
||||
|
||||
/* XXX: Are the while conditions correct? */
|
||||
while (pupa_ieee1275_next_property (devalias, aliasname, aliasname, &actual)
|
||||
while (grub_ieee1275_next_property (devalias, aliasname, aliasname, &actual)
|
||||
|| actual)
|
||||
{
|
||||
pupa_ieee1275_phandle_t dev;
|
||||
pupa_size_t pathlen;
|
||||
grub_ieee1275_phandle_t dev;
|
||||
grub_size_t pathlen;
|
||||
char *devpath;
|
||||
/* XXX: This should be large enough for any possible case. */
|
||||
char devtype[64];
|
||||
|
||||
pupa_ieee1275_get_property_length (devalias, aliasname, &pathlen);
|
||||
devpath = pupa_malloc (pathlen);
|
||||
grub_ieee1275_get_property_length (devalias, aliasname, &pathlen);
|
||||
devpath = grub_malloc (pathlen);
|
||||
if (! devpath)
|
||||
return pupa_errno;
|
||||
return grub_errno;
|
||||
|
||||
if (pupa_ieee1275_get_property (devalias, aliasname, devpath, pathlen,
|
||||
if (grub_ieee1275_get_property (devalias, aliasname, devpath, pathlen,
|
||||
&actual))
|
||||
{
|
||||
pupa_free (devpath);
|
||||
grub_free (devpath);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (pupa_ieee1275_finddevice (devpath, &dev))
|
||||
if (grub_ieee1275_finddevice (devpath, &dev))
|
||||
{
|
||||
pupa_free (devpath);
|
||||
grub_free (devpath);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (pupa_ieee1275_get_property (dev, "device_type", devtype, sizeof devtype,
|
||||
if (grub_ieee1275_get_property (dev, "device_type", devtype, sizeof devtype,
|
||||
&actual))
|
||||
{
|
||||
pupa_free (devpath);
|
||||
grub_free (devpath);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -79,7 +79,7 @@ pupa_devalias_iterate (int (*hook) (struct pupa_ieee1275_devalias *alias))
|
|||
alias.type = devtype;
|
||||
hook (&alias);
|
||||
|
||||
pupa_free (devpath);
|
||||
grub_free (devpath);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue