From: Andrew Hendry <andrew.hendry@gmail.com>
To: "H. Peter Anvin" <hpa@zytor.com>,
jejb@steeleye.com, <linux-kernel@vger.kernel.org>
Subject: [PATCH 2/2] MCA: setup ifdefs
Date: Sun, 15 Jul 2007 16:43:45 +1000 [thread overview]
Message-ID: <20070715164345.41f9beea@jed> (raw)
The MCA setup performed is only needed when CONFIG_MCA=y.
This wraps the setup with CONFIG_MCA and removes
EXPORT_SYMBOL(machine_id) as no modules use it. Moved MCA setup
variables from processor.h to mca.h because nothing else uses them.
Signed-off-by: Andrew Hendry <andrew.hendry@gmail.com>
diff -uprN -X dontdiff a/arch/i386/boot/main.c b/arch/i386/boot/main.c
--- a/arch/i386/boot/main.c 2007-07-15 12:10:12.000000000 +1000
+++ b/arch/i386/boot/main.c 2007-07-15 13:24:26.000000000 +1000
@@ -137,7 +137,9 @@ void main(void)
set_video();
/* Query MCA information */
+#ifdef CONFIG_MCA
query_mca();
+#endif
/* Voyager */
#ifdef CONFIG_X86_VOYAGER
diff -uprN -X dontdiff a/arch/i386/boot/mca.c b/arch/i386/boot/mca.c
--- a/arch/i386/boot/mca.c 2007-07-15 12:10:02.000000000 +1000
+++ b/arch/i386/boot/mca.c 2007-07-15 13:25:19.000000000 +1000
@@ -16,6 +16,8 @@
#include "boot.h"
+#ifdef CONFIG_MCA
+
int query_mca(void)
{
u8 err;
@@ -41,3 +43,5 @@ int query_mca(void)
copy_from_fs(&boot_params.sys_desc_table, bx, len);
return 0;
}
+
+#endif
diff -uprN -X dontdiff a/arch/i386/kernel/setup.c
b/arch/i386/kernel/setup.c --- a/arch/i386/kernel/setup.c
2007-07-15 12:23:45.000000000 +1000 +++
b/arch/i386/kernel/setup.c 2007-07-15 13:29:06.000000000 +1000
@@ -84,13 +84,11 @@ EXPORT_SYMBOL(boot_cpu_data);
unsigned long mmu_cr4_features;
-/* for MCA, but anyone else can use it if they want */
-unsigned int machine_id;
#ifdef CONFIG_MCA
-EXPORT_SYMBOL(machine_id);
-#endif
+unsigned int machine_id;
unsigned int machine_submodel_id;
unsigned int BIOS_revision;
+#endif
/* Boot loader ID as an integer, for the benefit of proc_dointvec */
int bootloader_type;
@@ -480,8 +478,6 @@ static void set_mca_bus(int x)
{
MCA_bus = x;
}
-#else
-static void set_mca_bus(int x) { }
#endif
/* Overridden in paravirt.c if CONFIG_PARAVIRT */
@@ -523,12 +519,15 @@ void __init setup_arch(char **cmdline_p)
apm_info.bios = APM_BIOS_INFO;
ist_info = IST_INFO;
saved_videomode = VIDEO_MODE;
+
+#ifdef CONFIG_MCA
if( SYS_DESC_TABLE.length != 0 ) {
set_mca_bus(SYS_DESC_TABLE.table[3] & 0x2);
machine_id = SYS_DESC_TABLE.table[0];
machine_submodel_id = SYS_DESC_TABLE.table[1];
BIOS_revision = SYS_DESC_TABLE.table[2];
}
+#endif
bootloader_type = LOADER_TYPE;
#ifdef CONFIG_BLK_DEV_RAM
diff -uprN -X dontdiff a/include/asm-i386/processor.h
b/include/asm-i386/processor.h ---
a/include/asm-i386/processor.h 2007-07-15 12:23:45.000000000
+1000 +++ b/include/asm-i386/processor.h 2007-07-15
13:31:54.000000000 +1000 @@ -206,12 +206,6 @@ static inline void
__mwait(unsigned long extern void mwait_idle_with_hints(unsigned long
eax, unsigned long ecx);
-/* from system description table in BIOS. Mostly for MCA use, but
-others may find it useful. */
-extern unsigned int machine_id;
-extern unsigned int machine_submodel_id;
-extern unsigned int BIOS_revision;
-
/* Boot loader type from the setup header */
extern int bootloader_type;
diff -uprN -X dontdiff a/include/linux/mca.h b/include/linux/mca.h
--- a/include/linux/mca.h 2007-07-15 12:06:06.000000000 +1000
+++ b/include/linux/mca.h 2007-07-15 13:32:40.000000000 +1000
@@ -34,6 +34,11 @@ typedef int (*MCA_ProcFn)(char* buf, int
*/
extern void mca_handle_nmi(void);
+/* From system description table in BIOS */
+extern unsigned int machine_id;
+extern unsigned int machine_submodel_id;
+extern unsigned int BIOS_revision;
+
enum MCA_AdapterStatus {
MCA_ADAPTER_NORMAL = 0,
MCA_ADAPTER_NONE = 1,
reply other threads:[~2007-07-15 6:44 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=20070715164345.41f9beea@jed \
--to=andrew.hendry@gmail.com \
--cc=hpa@zytor.com \
--cc=jejb@steeleye.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.