[OpenAFS-devel] System Call Stubs for IA64
chas williams
chas@cmf.nrl.navy.mil
Fri, 10 May 2002 05:51:35 -0400
>I don't think this is really necessary. I was thinking that instead,
>we could have stubs written entirely in C that would fabricate function
>pointers with the function descriptor initialized properly.
well its possible that you could write the stubs in c. however, i dont
think that actually fixes the problem. the syscall table in the kernel
doesnt contain function descriptors. it just contains a list of pointers
to functions. this works fine since the kernel is built with a fixed-gp.
modules are not built with fixed-gp. something has to be placed in
the syscall pointer that does a fixup on the gp before calling the
function from the module. you could write this in c i suppose but you
need to save/setup/restore the gp and you would almost certainly need
to write an asm("") section to handle this. you cant save the gp on
the stack either since its gp relative. you must save the gp in a
register.
i dont think there is any way around this. if you look at modutils
(insmod) you will see they use a machine code stub to work around this
problem (they need to write a fixup for various calls from kernel space
to module space) i used to use a machine code stub. someone from
hp.com showed me how to write an imm64 local reference that the
loader/linker could tolerate.