[OpenAFS-devel] System Call Stubs for IA64
Srikanth Vishwanathan
vsrikanth@in.ibm.com
Fri, 10 May 2002 11:22:20 -0400
> 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.
Would an indirect function call (call by function pointer) not force
the compiler to generate instructions to store and restore the old
global pointer (in a register). That's what I thought.
Srikanth.
chas williams
<chas@cmf.nrl.navy.mi To: Srikanth Vishwanathan/India/IBM@IBMIN
l> cc: openafs-devel@openafs.org
Sent by: Subject: Re: [OpenAFS-devel] System Call Stubs for IA64
openafs-devel-admin@o
penafs.org
05/10/2002 05:51 AM
Please respond to
chas williams
>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.
_______________________________________________
OpenAFS-devel mailing list
OpenAFS-devel@openafs.org
https://lists.openafs.org/mailman/listinfo/openafs-devel