[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Grub for ia64 - function descriptors
From: |
tgingold |
Subject: |
Re: Grub for ia64 - function descriptors |
Date: |
Mon, 02 Oct 2006 08:31:10 +0200 |
User-agent: |
Internet Messaging Program (IMP) 3.2.5 |
Quoting Hollis Blanchard <address@hidden>:
> On Fri, 2006-09-29 at 08:59 +0200, address@hidden wrote:
> > Quoting Hollis Blanchard <address@hidden>:
> >
> > > On Thu, 2006-09-28 at 15:45 +0200, address@hidden wrote:
> > > >
> > > > if (grub_strcmp (name, "grub_mod_init") == 0)
> > > > mod->init = (void (*) (grub_dl_t)) sym->st_value;
> > > >
> > > > This won't work on ia64 AFAIK.
> > >
> > > Can't this problem be solved with an architecture-specific macro?
> > >
> > > FWIW, 64-bit PowerPC also uses function descriptors. They look something
> > > like:
> > > long code_address
> > > long table_of_contents
> > > long unused
> > >
> > > The table_of_contents (TOC) value needs to be placed into r2 when
> > > jumping at code_address (and of course the old one needs to be restored
> > > when returning).
> > Indeed, same issue.
> >
> > >I assume IA64 is similar here, and given that, a
> > > module_jump function implemented in assembly by each architecture would
> > > solve this problem.
> > I'd prefer modules to export pointers. Seems to be easier to deal.
>
> I don't know what you mean; please elaborate (with pseudo-code if
> possible).
I'd propose modules export struct grub_dl. This struct contains init and fini
functions pointers.
Getting the address of a data structure is much more portable.
Dealing with function pointers would be a matter of the relocator.
Tristan.
- Re: Grub for ia64 - function descriptors,
tgingold <=