View | Details | Raw Unified | Return to bug 7299 | Differences between
and this patch

Collapse All | Expand All

(-)linux-2.6/include/acpi/reboot.h (-6 / +7 lines)
Lines 1-9 Link Here
1
#ifndef __ACPI_REBOOT_H
2
#define __ACPI_REBOOT_H
1
3
2
/*
4
#ifdef CONFIG_ACPI
3
 * Dummy placeholder to make the EFI patches apply to the x86 tree.
5
extern void acpi_reboot(void);
4
 * Andrew/Len, please just kill this file if you encounter it.
6
#else
5
 */
7
static inline void acpi_reboot(void) { }
6
#ifndef acpi_reboot
7
# define acpi_reboot() do { } while (0)
8
#endif
8
#endif
9
9
10
#endif
(-)linux-2.6/drivers/acpi/reboot.c (+66 lines)
Line 0 Link Here
1
2
#include <linux/pci.h>
3
#include <linux/acpi.h>
4
#include <acpi/reboot.h>
5
#include <linux/dmi.h>
6
7
/* Actually this shouldn't be __cpuinitdata, would be better to fix the
8
   callers to only run once -AK */
9
static struct dmi_system_id __cpuinitdata reg_reboot_dmi_table[] = {
10
	{ NULL, "ASUS M6NE", {
11
	  DMI_MATCH(DMI_BIOS_VERSION,"0208"),
12
	  DMI_MATCH(DMI_PRODUCT_NAME,"M6Ne")}, (void *)0},
13
	{}
14
};
15
16
void acpi_reboot(void)
17
{
18
	struct acpi_generic_address *rr;
19
	struct pci_bus *bus0;
20
	u8 reset_value;
21
	unsigned int devfn;
22
23
	if (acpi_disabled)
24
		return;
25
26
	rr = &acpi_gbl_FADT.reset_register;
27
28
	if (!dmi_check_system(reg_reboot_dmi_table)) {
29
		/*
30
		 * If the laptop falls into the DMI check table, it is
31
		 * unnecessary to check the RESET_REG flag again.
32
		 */
33
		/* Is the reset register supported? */
34
		if (!(acpi_gbl_FADT.flags & ACPI_FADT_RESET_REGISTER) ||
35
		    rr->bit_width != 8 || rr->bit_offset != 0)
36
		return;
37
	}
38
39
	reset_value = acpi_gbl_FADT.reset_value;
40
41
	/* The reset register can only exist in I/O, Memory or PCI config space
42
	 * on a device on bus 0. */
43
	switch (rr->space_id) {
44
	case ACPI_ADR_SPACE_PCI_CONFIG:
45
		/* The reset register can only live on bus 0. */
46
		bus0 = pci_find_bus(0, 0);
47
		if (!bus0)
48
			return;
49
		/* Form PCI device/function pair. */
50
		devfn = PCI_DEVFN((rr->address >> 32) & 0xffff,
51
				  (rr->address >> 16) & 0xffff);
52
		printk(KERN_DEBUG "Resetting with ACPI PCI RESET_REG.");
53
		/* Write the value that resets us. */
54
		pci_bus_write_config_byte(bus0, devfn,
55
				(rr->address & 0xffff), reset_value);
56
		break;
57
58
	case ACPI_ADR_SPACE_SYSTEM_MEMORY:
59
	case ACPI_ADR_SPACE_SYSTEM_IO:
60
		printk(KERN_DEBUG "ACPI MEMORY or I/O RESET_REG.\n");
61
		acpi_hw_low_level_write(8, reset_value, rr);
62
		break;
63
	}
64
	/* Wait ten seconds */
65
	acpi_os_stall(10000000);
66
}
(-)linux-2.6/drivers/acpi/Makefile (-1 / +1 lines)
Lines 21-27 obj-$(CONFIG_X86) += blacklist.o Link Here
21
#
21
#
22
# ACPI Core Subsystem (Interpreter)
22
# ACPI Core Subsystem (Interpreter)
23
#
23
#
24
obj-y				+= osl.o utils.o \
24
obj-y				+= osl.o utils.o reboot.o\
25
				   dispatcher/ events/ executer/ hardware/ \
25
				   dispatcher/ events/ executer/ hardware/ \
26
				   namespace/ parser/ resources/ tables/ \
26
				   namespace/ parser/ resources/ tables/ \
27
				   utilities/
27
				   utilities/

Return to bug 7299