share COMPATIBLE_IOCTL()s across architectures
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 6 lines · Andi Kleen
Shouldn't you put the include files needed for all that in there too?
Otherwise you have another ugly list to duplicate. The includes cannot be put inside the ioctl list, because in some extreme case they can generate code (e.g. when gcc decides to ignore inline again and emits functions for includes)
Why not simply move the common COMPATIBLE_IOCTLs and includes into kernel/compat_ioctl.c or similar? That would IMHO be cleaner and it does not need more preprocessing hacks.
There can still be a second init_sys32_ioctl() copy to handle the arch specific list with additional translations.
Arnd <><
Quoted 5 lines · Arnd Bergmann
Why not simply move the common
COMPATIBLE_IOCTLsand includes intokernel/compat_ioctl.cor similar? That would IMHO be cleaner and it does not need more preprocessing hacks.
There can still be a secondinit_sys32_ioctl()copy to handle the arch specific list with additional translations.
This would work for COMPATIBLE_IOCTLS, but the conversions handlers would need a new asm/ file for the macros. They're declared with assembler magic to avoid declaring all the functions. This way you need less files.
-Andi
Quoted 2 lines · Andi Kleen
This would work for
COMPATIBLE_IOCTLS, but the conversions handlers would need a new asm/ file for the macros.
If this is just about HANDLE_IOCTL, IOCTL_TABLE_START etc., they look trivial enough to be put in asm/compat.h. They even appear to be arch independent even though they have inline asm.
Quoted 2 lines
They're declared with assembler
magic to avoid declaring all the functions. This way you need less files.
Ah, I have always wondered why it is done in such a strange way for some architectures.
Arnd <><
Hi!
Quoted 9 lines
Quoted 5 lines
Why not simply move the common
COMPATIBLE_IOCTLsand includes intokernel/compat_ioctl.cor similar? That would IMHO be cleaner and it does not need more preprocessing hacks.
There can still be a secondinit_sys32_ioctl()copy to handle the arch specific list with additional translations.This would work for
COMPATIBLE_IOCTLS, but the conversions handlers would need a new asm/ file for the macros. They're declared with assembler magic to avoid declaring all the functions. This way you need less files.
include/linux/compat_ioctl.h can be renamed to fs/compat_ioctl.c if people prefer. I do not know which one is better.
Pavel
Signature · 2 lines
When do you have a heart between your knees? [Johanka's followup: and *two* hearts?]