Newsgroups: comp.sys.transputer
From: ashdown@mpr.ca (Scott Ashdown)
Subject: Calling functions "belonging" to another configured process
Organization: MPR Teltech Ltd., Burnaby, B.C., Canada
Date: Tue, 4 Oct 1994 20:48:49 GMT
Message-ID: <1994Oct4.204849.11920@mprgate.mpr.ca>

I'm looking for a way (using INMOS C) to allow a configured process to call 
functions that were linked into another configured process' *.lku file. The
method is this:

1) Link the caller with a set of function pointers corresponding to the
   functions I'll want to call.

2) At runtime, have the second configured process send, via a channel, the
   addresses of the functions. Copy them into the pointers, and the other
   configured process should be able to call them.

Seemed like a good idea. It *works* if the second process who receives the
function pointers is created at runtime by the owner of the functions. I have,
as per a suggestion in this group, done everything conceivable to the ptrs
so that the compiler thinks they're int ptrs (in case it screws with fn ptrs).
I have printed out the ptrs from both configured processes, and both give the
same values.

So what's my problem? Why won't things work between two *configured* processes?
I realize that the working version with the dynamically-created process has two
processes which share the same heap - so is it something to do with addresses?
Is there some sort of offset that's used in calling a function via the "gcall"
instruction? I'm afraid I haven't had much luck figuring out the assembly - 
I'm currently without any reference material whatsoever, and it's been a while
since I did T805 assembly :).

Any help would be greatly appreciated.


-- 
Scott Ashdown
Engineer, MPR Teltech Ltd.
Burnaby, British Columbia, Canada.
ashdown@mprgate.mpr.ca

