This is the mail archive of the
mailing list for the GCC project.
Re: iq2000 trampolines
On Jun 9, 2006, at 5:16 PM, DJ Delorie wrote:
Write the code, make the code into a dynamic library, dlopen it,
The problem is that the iq2000 is a smart peripheral, not a general
purpose CPU. Its instruction memory is not available to it directly,
the host has to write the instructions to it (although it's labelled
as "PROM" in the specs, so maybe the host can't write to it either).
And I haven't yet found a way to convince it to execute out of its
So, OS feature then, or the other way would be to:
// ... data for the trampoline, filled in by runtime code
pop return_addr into r0
mult r0,sizeof (struct tramp_data)
ld r1, tramp_data
add r0, r1
and then use the data pointed to by r0 to finish off the call.
Something like that I think might work. This allows one to map the
contained data into a program counter, and back again. I'm assuming
that one can have runtime built function pointers on the
architecture, if not oh well.