From: rpjday@crashcourse.ca (Robert P. J. Day)
To: kernelnewbies@lists.kernelnewbies.org
Subject: some simple(?) questions about Kbuild and installing kernel headers
Date: Fri, 27 May 2016 07:53:00 -0400 (EDT) [thread overview]
Message-ID: <alpine.LFD.2.20.1605270735310.22077@localhost.localdomain> (raw)
for various reasons, i'm poring over the grotty details of the
installation of kernel headers, so a couple questions before i get any
further into the code.
first, is there any value to a Kbuild file with no content? for
example, here's the entirety of
arch/cris/include/arch-v10/arch/Kbuild:
# CRISv10 arch
that is, one commented-out line, no references to any include files.
does such a file have any meaning? or can such files be deleted until
such time as they need to contain some content?
next, with an example from that same directory, the "page.h" header
file:
#ifndef _CRIS_ARCH_PAGE_H
#define _CRIS_ARCH_PAGE_H
#ifdef __KERNEL__
... snip ...
#endif
#endif
in other words, the *entirety* of the contents of that header file
are protected by "__KERNEL__". first, that seems silly given that we
know the Kbuild file is empty (but that's admittedly an obscure
situation).
but even if the Kbuild file *wasn't* empty, there are two sub-cases.
first, if the "page.h" header file isn't being exported to user space,
there's no need for any use of __KERNEL__ to begin with since it's
exclusively a kernel header file.
and if it *is* being exported, what ends up being exported is, well,
an empty header file, correct? which seems a bit silly, *unless* ...
are there cases where certain header files *must* exist in user space
just as placeholders, even if they're empty? that would explain it,
but it still seems yucky.
one last query ... is there any value to an unexported header file
containing any __KERNEL__ protection? i'm assuming not; examples of
that are probably just leftovers that weren't cleaned up properly.
more questions later as i get deeper into the code ...
rday
--
========================================================================
Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca
Twitter: http://twitter.com/rpjday
LinkedIn: http://ca.linkedin.com/in/rpjday
========================================================================
next reply other threads:[~2016-05-27 11:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-27 11:53 Robert P. J. Day [this message]
2016-05-27 16:10 ` some simple(?) questions about Kbuild and installing kernel headers Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.LFD.2.20.1605270735310.22077@localhost.localdomain \
--to=rpjday@crashcourse.ca \
--cc=kernelnewbies@lists.kernelnewbies.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).