From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Andrew Morton <akpm@osdl.org>
Cc: Linus Torvalds <torvalds@osdl.org>,
Linux Kernel list <linux-kernel@vger.kernel.org>
Subject: [PATCH] ppc64: Remote some userland-only stuff from kernel header
Date: Mon, 27 Sep 2004 18:59:54 +1000 [thread overview]
Message-ID: <1096275593.1071.32.camel@gaston> (raw)
Hi !
include/asm-ppc64/systemcfg.h defines a structure that currently gets
exposed to userland via /proc, and which I intend to deprecate in the
near future once I have better alternatives available. In the meantime,
this patch removes a bunch of stuff from this file that were only defined
for non-__KERNEL__, like an inline function for getting to that struture
via /proc, and some CPU & platform type definitions that were duplicates
of the ones in asm-ppc64/processor.h. These things have nothing to do in
a kernel header.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
===== include/asm-ppc64/systemcfg.h 1.3 vs edited =====
--- 1.3/include/asm-ppc64/systemcfg.h 2004-06-27 17:19:24 +10:00
+++ edited/include/asm-ppc64/systemcfg.h 2004-09-27 18:15:45 +10:00
@@ -59,54 +59,7 @@
#ifdef __KERNEL__
extern struct systemcfg *systemcfg;
-#else
-
-/* Processor Version Register (PVR) field extraction */
-#define PVR_VER(pvr) (((pvr) >> 16) & 0xFFFF) /* Version field */
-#define PVR_REV(pvr) (((pvr) >> 0) & 0xFFFF) /* Revison field */
-
-/* Processor Version Numbers */
-#define PV_NORTHSTAR 0x0033
-#define PV_PULSAR 0x0034
-#define PV_POWER4 0x0035
-#define PV_ICESTAR 0x0036
-#define PV_SSTAR 0x0037
-#define PV_POWER4p 0x0038
-#define PV_GPUL 0x0039
-#define PV_POWER5 0x003a
-#define PV_970FX 0x003c
-#define PV_630 0x0040
-#define PV_630p 0x0041
-
-/* Platforms supported by PPC64 */
-#define PLATFORM_PSERIES 0x0100
-#define PLATFORM_PSERIES_LPAR 0x0101
-#define PLATFORM_ISERIES_LPAR 0x0201
-#define PLATFORM_POWERMAC 0x0400
-
-/* Compatibility with drivers coming from PPC32 world */
-#define _machine (systemcfg->platform)
-#define _MACH_Pmac PLATFORM_POWERMAC
-
-
-static inline volatile struct systemcfg *systemcfg_init(void)
-{
- int fd = open("/proc/ppc64/systemcfg", O_RDONLY);
- volatile struct systemcfg *ret;
-
- if (fd == -1)
- return 0;
- ret = mmap(0, sizeof(struct systemcfg), PROT_READ, MAP_SHARED, fd, 0);
- close(fd);
- if (!ret)
- return 0;
- if (ret->version.major != SYSTEMCFG_MAJOR || ret->version.minor < SYSTEMCFG_MINOR) {
- munmap((void *)ret, sizeof(struct systemcfg));
- return 0;
- }
- return ret;
-}
-#endif /* __KERNEL__ */
+#endif
#endif /* __ASSEMBLY__ */
reply other threads:[~2004-09-27 9:02 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1096275593.1071.32.camel@gaston \
--to=benh@kernel.crashing.org \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.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
all inboxes | Powered by JetHome®