Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e9928674 authored by Andi Kleen's avatar Andi Kleen Committed by Linus Torvalds
Browse files

[PATCH] x86_64: Generalize DMI and enable for x86-64



Some people need it now on 64bit so reuse the i386 code for
x86-64. This will be also useful for future bug workarounds.

It is a bit simplified there because there is no need
to do it very early on x86-64. This means it doesn't need
early ioremap et.al. We run it as a core initcall right now.

I hope it's not needed for early setup.

I added a general CONFIG_DMI symbol in case IA64 or someone
else wants to reuse the code later too.

Signed-off-by: default avatarAndi Kleen <ak@suse.de>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent b347d25f
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -41,6 +41,10 @@ config ARCH_MAY_HAVE_PC_FDC
	bool
	default y

config DMI
	bool
	default y

source "init/Kconfig"

menu "Processor type and features"
+8 −8
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@
#include <linux/module.h>
#include <linux/dmi.h>
#include <linux/bootmem.h>

#include <linux/slab.h>

static char * __init dmi_string(struct dmi_header *dm, u8 s)
{
@@ -19,7 +19,7 @@ static char * __init dmi_string(struct dmi_header *dm, u8 s)
		}

		if (*bp != 0) {
			str = alloc_bootmem(strlen(bp) + 1);
			str = dmi_alloc(strlen(bp) + 1);
			if (str != NULL)
				strcpy(str, bp);
			else
@@ -40,7 +40,7 @@ static int __init dmi_table(u32 base, int len, int num,
	u8 *buf, *data;
	int i = 0;
		
	buf = bt_ioremap(base, len);
	buf = dmi_ioremap(base, len);
	if (buf == NULL)
		return -1;

@@ -65,7 +65,7 @@ static int __init dmi_table(u32 base, int len, int num,
		data += 2;
		i++;
	}
	bt_iounmap(buf, len);
	dmi_iounmap(buf, len);
	return 0;
}

@@ -112,7 +112,7 @@ static void __init dmi_save_devices(struct dmi_header *dm)
		if ((*d & 0x80) == 0)
			continue;

		dev = alloc_bootmem(sizeof(*dev));
		dev = dmi_alloc(sizeof(*dev));
		if (!dev) {
			printk(KERN_ERR "dmi_save_devices: out of memory.\n");
			break;
@@ -131,7 +131,7 @@ static void __init dmi_save_ipmi_device(struct dmi_header *dm)
	struct dmi_device *dev;
	void * data;

	data = alloc_bootmem(dm->length);
	data = dmi_alloc(dm->length);
	if (data == NULL) {
		printk(KERN_ERR "dmi_save_ipmi_device: out of memory.\n");
		return;
@@ -139,7 +139,7 @@ static void __init dmi_save_ipmi_device(struct dmi_header *dm)

	memcpy(data, dm, dm->length);

	dev = alloc_bootmem(sizeof(*dev));
	dev = dmi_alloc(sizeof(*dev));
	if (!dev) {
		printk(KERN_ERR "dmi_save_ipmi_device: out of memory.\n");
		return;
@@ -221,7 +221,7 @@ void __init dmi_scan_machine(void)
		}
	}

out:	printk(KERN_INFO "DMI not present.\n");
out:	printk(KERN_INFO "DMI not present or invalid.\n");
}


+1 −1
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@
#include <linux/nodemask.h>
#include <linux/kexec.h>
#include <linux/crash_dump.h>
#include <linux/dmi.h>

#include <video/edid.h>

@@ -146,7 +147,6 @@ EXPORT_SYMBOL(ist_info);
struct e820map e820;

extern void early_cpu_init(void);
extern void dmi_scan_machine(void);
extern void generic_apic_probe(char *);
extern int root_mountflags;

+4 −0
Original line number Diff line number Diff line
@@ -69,6 +69,10 @@ config ARCH_MAY_HAVE_PC_FDC
	bool
	default y

config DMI
	bool
	default y

source "init/Kconfig"


+4 −1
Original line number Diff line number Diff line
@@ -7,7 +7,8 @@ EXTRA_AFLAGS := -traditional
obj-y	:= process.o signal.o entry.o traps.o irq.o \
		ptrace.o time.o ioport.o ldt.o setup.o i8259.o sys_x86_64.o \
		x8664_ksyms.o i387.o syscall.o vsyscall.o \
		setup64.o bootflag.o e820.o reboot.o quirks.o i8237.o
		setup64.o bootflag.o e820.o reboot.o quirks.o i8237.o \
		dmi_scan.o

obj-$(CONFIG_X86_MCE)         += mce.o
obj-$(CONFIG_X86_MCE_INTEL)	+= mce_intel.o
@@ -47,3 +48,5 @@ intel_cacheinfo-y += ../../i386/kernel/cpu/intel_cacheinfo.o
quirks-y			+= ../../i386/kernel/quirks.o
i8237-y				+= ../../i386/kernel/i8237.o
msr-$(subst m,y,$(CONFIG_X86_MSR))  += ../../i386/kernel/msr.o
dmi_scan-y			+= ../../i386/kernel/dmi_scan.o
Loading