Well, you can copy your function into physical ram (>32MB, physical not logical address like that returned by memmap) and then have some started code call that. You can't use any library functions then though.
Or, you can make your own toolchain that is dedicated for writing for the 940. This gives you access to the C library. This way is very similar to GP32 development, so you can hackup a GP32 toolchain by just hacking up the linkerscript/etc.
To lock memory, you would have to have both processes (both the 920 and 940 versions) checking your "lock" variable to ensure they can write to that memory first, and then writing to it. Since both processors will be running at the same time (rather than time slicing) you really should use an operation which will execute in one instruction (atomic, like 'cmpxchg' on the x86, I'm not sure of the arm equivalent).