#define min(a,b) (((a) < (b)) ? (a) : (b))
int
{
}
void
{
/* Is there any candidate at all? */
return;
/* Read header and check magic*/
!= sizeof(head))
{
return;
}
{
return;
}
/* Read commands. */
{
return;
}
{
}
}
(grub_macho_t , struct grub_macho_cmd *,
void *);
static grub_err_t
void *hook_arg)
{
int i;
{
break;
}
return grub_errno;
}
{
return 0;
}
{
return grub_error (GRUB_ERR_BAD_OS,
"couldn't read architecture-specific part");
{
grub_error_push ();
return grub_error (GRUB_ERR_BAD_OS,
"invalid offset in program header");
}
{
grub_error_push ();
return grub_error (GRUB_ERR_BAD_OS,
"couldn't read architecture-specific part");
}
return GRUB_ERR_NONE;
}
/* Calculate the amount of memory spanned by the segments. */
{
int nr_phdrs = 0;
/* Run through the program headers to calculate the total memory size we
should claim. */
struct grub_macho_cmd *hdr0,
{
return 0;
return 0;
return 0;
nr_phdrs++;
return 0;
}
*segments_end = 0;
if (nr_phdrs == 0)
if (*segments_end < *segments_start)
/* Very bad addresses. */
return GRUB_ERR_NONE;
}
/* Load every loadable segment into memory specified by `_load_hook'. */
{
struct grub_macho_cmd *hdr0,
struct grub_macho_cmd *hdr0,
{
return 0;
return 0;
return 0;
{
grub_error_push ();
"invalid offset in program header");
return 1;
}
{
{
/* XXX How can we free memory from `load_hook'? */
grub_error_push ();
"couldn't read segment from file: "
"wanted 0x%lx bytes; read 0x%lx bytes",
return 1;
}
}
return 0;
}
return err;
}
{
struct grub_macho_cmd *hdr,
struct grub_macho_cmd *hdr,
{
return 0;
}
return entry_point;
}