Skip to contentSkip to conversation

share COMPATIBLE_IOCTL()s across architectures

DISCUSSION Arnd Bergmann 4 participants 4 messages Mar 20, 2003 2 messages not in the archive

lore
Share & tools
lore

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]

#2 lore raw
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 <><
#3 lore raw
Quoted 5 lines · Arnd Bergmann

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.

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

#4 lore raw
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 <><
#5 lore raw
In reply to Andi Kleen

Hi!

Quoted 9 lines
Quoted 5 lines

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.

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?]