Re: access_ok inside kernelspace

David Woodhouse (David.Woodhouse@mvhi.com)
Tue, 19 Oct 1999 16:40:43 +0100


alan@lxorguk.ukuu.org.uk said:
> Who says sys_call_table[__NR_XXX] is a pointer to a function or even
> exists in that form on non x86 machines. Think about the portability
> side

Declare an arch-specific macro which returns a function pointer from a given
syscall number, according to the implementation of the architecture in
question.

On just about all architectures we support at the moment, it's something
like...

typedef int (*sysfun_p)();
extern sysfun_p sys_call_table[];
#define SYS(x) (sysfun_p)(sys_call_table[x])

---- ---- ----
David Woodhouse David.Woodhouse@mvhi.com Office: (+44) 1223 810302
Project Leader, Process Information Systems Mobile: (+44) 7976 658355
Axiom (Cambridge) Ltd., Swaffham Bulbeck, Cambridge, CB5 0NA, UK.
finger dwmw2@ferret.lmh.ox.ac.uk for PGP key.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/