Skip to contentSkip to conversation

Specific processing during user space header generation

DISCUSSION H. Peter Anvin 3 participants 6 messages Feb 10, 2011 – Feb 11, 2011 Kbuild

lore
Share & tools
lore
#0 lore raw

I'm stuck with a problem where a header needs specific postprocessing in addition to what headers_install.pl does. Is that possible as things currently sit, or will that require changes to the core kbuild scripts?

-hpa

#1 lore raw
Quoted 3 lines · H. Peter Anvin

I'm stuck with a problem where a header needs specific postprocessing in addition to what headers_install.pl does. Is that possible as things currently sit, or will that require changes to the core kbuild scripts?

You will nned to patch core kbuild.
We do no processing apart from headers_install.pl - so there is no place to hook in.
And headers_install.pl has not been prepared to do any tricks like that.

Sam

#2 lore raw
Quoted 8 lines · Sam Ravnborg
Quoted 3 lines · H. Peter Anvin

I'm stuck with a problem where a header needs specific postprocessing in addition to what headers_install.pl does. Is that possible as things currently sit, or will that require changes to the core kbuild scripts?

You will nned to patch core kbuild.
We do no processing apart from headers_install.pl - so there is no place to hook in.
And headers_install.pl has not been prepared to do any tricks like that.

Would you (plural) consider a patchset looking something like:

when processing foo.h, also look for foo.h.pl; if so, invoke that from inside headers_install.pl?

-hpa

#3 lore raw
Quoted 10 lines · H. Peter Anvin
Quoted 8 lines · Sam Ravnborg
Quoted 3 lines · H. Peter Anvin

I'm stuck with a problem where a header needs specific postprocessing in addition to what headers_install.pl does. Is that possible as things currently sit, or will that require changes to the core kbuild scripts?

You will nned to patch core kbuild.
We do no processing apart from headers_install.pl - so there is no place to hook in.
And headers_install.pl has not been prepared to do any tricks like that.

Quoted 4 lines

Would you (plural) consider a patchset looking something like:

when processing foo.h, also look for foo.h.pl; if so, invoke that from inside headers_install.pl?

Something like this should work.

Michal

#4 lore raw
In reply to H. Peter Anvin
Quoted 10 lines · H. Peter Anvin
Quoted 8 lines · Sam Ravnborg
Quoted 3 lines · H. Peter Anvin

I'm stuck with a problem where a header needs specific postprocessing in addition to what headers_install.pl does. Is that possible as things currently sit, or will that require changes to the core kbuild scripts?

You will nned to patch core kbuild.
We do no processing apart from headers_install.pl - so there is no place to hook in.
And headers_install.pl has not been prepared to do any tricks like that.

Quoted 4 lines

Would you (plural) consider a patchset looking something like:

when processing foo.h, also look for foo.h.pl; if so, invoke that from inside headers_install.pl?

The purpose of headers_install is to install the existing kernel headers and during the installation process do some minimal adjustments to make then suit userspace consumption.

What you suggest smells like something else - care to explain what you have in mind?

Sam

#5 lore raw
Quoted 8 lines · Sam Ravnborg

The purpose of headers_install is to install the existing kernel headers and during the installation process do some minimal adjustments to make then suit userspace consumption.

What you suggest smells like something else - care to explain what you have in mind?

I am working with H.J. Lu on an experimental native 32-bit ABI for x86-64. As a result, we are adding an <asm/unistd_x32.h> for new system call numbers.

Now, the kernel needs to use both <asm/unistd_64.h> and <asm/unistd_x32.h>, since as far as the kernel are concerned they are both 64-bit system calls. As such, the latter contains symbols like:

	__NR_x32_ioctl

... however, when used in user space, we want it to look like

	__NR_ioctl

... just like any other ABI.

Incidentally we have a similar situation with the i386 ABI, but that one is sort of backwards -- since unistd_32.h is also used by native 32 bits, we can't just make the transformation for userspace there.

The alternative, of course (which would also work for the native 32 bit case, now when I think about it) is for the human-written file to be the user space version, and use a script to generate the kernel version.

-hpa