From: Jim Gifford <maillist@jg555.com>
To: LKML <linux-kernel@vger.kernel.org>
Subject: 2.6.18 Headers - Long
Date: Tue, 11 Jul 2006 17:35:30 -0700 [thread overview]
Message-ID: <44B443D2.4070600@jg555.com> (raw)
I was really glad to see that something was going to be done with the
headers, but I don't think it's enough. I'm going to share my concerns
and hopefully we can all figure what is the right thing to do.
First off, my research in this has been going on since LLH announced
that it was not going to produce any more headers. I started a project
to sanitize the headers myself. http://headers.cross-lfs.org.
I will only document one issue, but there are several more like this in
the kernel.
I'm going to use the MIPS architecture in my example, along with the
file page.h.
With the 2.6.18 headers, the file that gets created looks like this. If
you notice on lines 17, 20, 23, 26, and 34 they all use CONFIG_{...},
these variables are called from linux/autoconf.h. Yes, the simple fix
would be to include this file.
1.
/*
2.
* This file is subject to the terms and conditions of the GNU
General Public
3.
* License. See the file "COPYING" in the main directory of this
archive
4.
* for more details.
5.
*
6.
* Copyright (C) 1994 - 1999, 2000, 03 Ralf Baechle
7.
* Copyright (C) 1999, 2000 Silicon Graphics, Inc.
8.
*/
9.
#ifndef _ASM_PAGE_H
10.
#define _ASM_PAGE_H
11.
12.
13.
14.
/*
15.
* PAGE_SHIFT determines the page size
16.
*/
17.
#ifdef CONFIG_PAGE_SIZE_4KB
18.
#define PAGE_SHIFT 12
19.
#endif
20.
#ifdef CONFIG_PAGE_SIZE_8KB
21.
#define PAGE_SHIFT 13
22.
#endif
23.
#ifdef CONFIG_PAGE_SIZE_16KB
24.
#define PAGE_SHIFT 14
25.
#endif
26.
#ifdef CONFIG_PAGE_SIZE_64KB
27.
#define PAGE_SHIFT 16
28.
#endif
29.
#define PAGE_SIZE (1UL << PAGE_SHIFT)
30.
#define PAGE_MASK (~((1 << PAGE_SHIFT) - 1))
31.
32.
33.
34.
#ifdef CONFIG_LIMITED_DMA
35.
#define WANT_PAGE_VIRTUAL
36.
#endif
37.
38.
#include <asm-generic/memory_model.h>
39.
#include <asm-generic/page.h>
40.
41.
#endif /* _ASM_PAGE_H */
Here's the header I produce with my sanitize script, I use a glibc call
to get the information, which would be more appropriate for the user
space. This is very similar to what LLH provided. Even my example is not
prefect due to line 14.
1.
#define _ASM_PAGE_H
2.
3.
#include <unistd.h>
4.
5.
#define PAGE_SIZE (getpagesize())
6.
static __inline__ int getpageshift()
7.
{
8.
int pagesize = getpagesize();
9.
return (__builtin_clz(pagesize) ^ 31);
10.
}
11.
#define PAGE_SHIFT (getpageshift())
12.
#define PAGE_MASK (~(PAGE_SIZE-1))
13.
14.
#ifdef CONFIG_LIMITED_DMA
15.
#define WANT_PAGE_VIRTUAL
16.
#endif
17.
18.
#endif /* !(_ASM_PAGE_H) */
So even with the new headers_install, the headers still need to be
sanitized to overcome the missing variables from linux/autoconf.h.
Just wanted to bring this up to everyone's attention and look forward to
helping get things resolved.
next reply other threads:[~2006-07-12 0:39 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-12 0:35 Jim Gifford [this message]
2006-07-14 0:25 ` 2.6.18 Headers - Long David Woodhouse
2006-07-14 2:18 ` Jim Gifford
2006-07-14 18:55 ` David Woodhouse
2006-07-14 19:28 ` Jim Gifford
2006-07-14 19:39 ` Arjan van de Ven
2006-07-14 20:16 ` David Woodhouse
2006-07-14 20:19 ` David Miller
2006-07-14 20:57 ` Jim Gifford
2006-07-15 4:33 ` Randy.Dunlap
2006-07-16 14:08 ` Nix
2006-07-15 7:19 ` David Woodhouse
2006-07-15 7:08 ` David Woodhouse
2006-07-14 19:57 ` David Woodhouse
2006-07-14 20:06 ` Erik Andersen
2006-07-14 20:19 ` Christoph Hellwig
2006-08-26 16:09 ` David Woodhouse
2006-08-29 12:25 ` Ralf Baechle
-- strict thread matches above, loose matches on Subject: below --
2006-07-15 21:09 Albert Cahalan
2006-07-15 21:19 ` Arjan van de Ven
2006-07-17 5:21 ` Ralf Baechle
2006-07-15 21:44 ` Adrian Bunk
2006-07-15 21:47 ` David Woodhouse
2006-07-16 6:18 ` Albert Cahalan
2006-07-16 6:26 ` Arjan van de Ven
2006-07-16 8:05 ` David Woodhouse
2006-07-16 8:20 ` Jakub Jelinek
2006-07-16 12:34 ` Kyle Moffett
2006-07-16 12:48 ` Russell King
2006-07-16 18:38 ` Albert Cahalan
2006-07-16 18:53 ` Russell King
2006-07-16 19:22 ` Albert Cahalan
2006-07-16 19:41 ` Russell King
2006-07-17 1:26 ` Arjan van de Ven
2006-07-17 1:23 ` David Miller
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=44B443D2.4070600@jg555.com \
--to=maillist@jg555.com \
--cc=linux-kernel@vger.kernel.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