Re: Trampolines on Harvard architecture?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Apr 8, 2013 at 6:24 PM, James Bowman <jamesb@xxxxxxxxxxxx> wrote:
> Do any Harvard architecture targets attempt support for trampolines?
>
> It seems that some limited support is feasible, but if every other
> Harvard architecture bails on trampolines, I'll follow the pack.

On a true Harvard architecture, for which there is absolutely no way
to write data to the instruction memory, then trampolines are fairly
difficult to implement.  Most systems like that do not bother to
implement trampolines.

That said, on a true Harvard architecture you normally have control
over the ABI.  And that means that you can use a slightly unusual
representation of a function pointer: you can make a function pointer
be a pointer to a function descriptor.  Most ABIs on the PPC do this.
The descriptor contains (at least) two words: a pointer to the code in
instruction memory, and a value to load into the static chain register
before jumping to that code.  Calling a function pointer becomes a
multi-instruction sequence: load the static chain register and then
branch to the code.  With this approach, trampolines do not require
writing into instruction memory.

Ian




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux