acpi.c (227293) | acpi.c (231161) |
---|---|
1/*- 2 * Copyright (c) 2000 Takanori Watanabe <takawata@jp.freebsd.org> 3 * Copyright (c) 2000 Mitsuru IWASAKI <iwasaki@jp.freebsd.org> 4 * Copyright (c) 2000, 2001 Michael Smith 5 * Copyright (c) 2000 BSDi 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 14 unchanged lines hidden (view full) --- 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 */ 29 30#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2000 Takanori Watanabe <takawata@jp.freebsd.org> 3 * Copyright (c) 2000 Mitsuru IWASAKI <iwasaki@jp.freebsd.org> 4 * Copyright (c) 2000, 2001 Michael Smith 5 * Copyright (c) 2000 BSDi 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 14 unchanged lines hidden (view full) --- 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 */ 29 30#include <sys/cdefs.h> |
31__FBSDID("$FreeBSD: head/sys/dev/acpica/acpi.c 227293 2011-11-07 06:44:47Z ed $"); | 31__FBSDID("$FreeBSD: head/sys/dev/acpica/acpi.c 231161 2012-02-07 20:54:44Z jkim $"); |
32 33#include "opt_acpi.h" 34#include <sys/param.h> 35#include <sys/kernel.h> 36#include <sys/proc.h> 37#include <sys/fcntl.h> 38#include <sys/malloc.h> 39#include <sys/module.h> --- 1767 unchanged lines hidden (view full) --- 1807} 1808 1809/* 1810 * Determine the probe order for a given device. 1811 */ 1812static void 1813acpi_probe_order(ACPI_HANDLE handle, int *order) 1814{ | 32 33#include "opt_acpi.h" 34#include <sys/param.h> 35#include <sys/kernel.h> 36#include <sys/proc.h> 37#include <sys/fcntl.h> 38#include <sys/malloc.h> 39#include <sys/module.h> --- 1767 unchanged lines hidden (view full) --- 1807} 1808 1809/* 1810 * Determine the probe order for a given device. 1811 */ 1812static void 1813acpi_probe_order(ACPI_HANDLE handle, int *order) 1814{ |
1815 ACPI_OBJECT_TYPE type; | 1815 ACPI_OBJECT_TYPE type; |
1816 | 1816 |
1817 /* 1818 * 1. CPUs 1819 * 2. I/O port and memory system resource holders 1820 * 3. Embedded controllers (to handle early accesses) 1821 * 4. PCI Link Devices 1822 */ 1823 AcpiGetType(handle, &type); 1824 if (type == ACPI_TYPE_PROCESSOR) 1825 *order = 1; 1826 else if (acpi_MatchHid(handle, "PNP0C01") || acpi_MatchHid(handle, "PNP0C02")) 1827 *order = 2; 1828 else if (acpi_MatchHid(handle, "PNP0C09")) 1829 *order = 3; 1830 else if (acpi_MatchHid(handle, "PNP0C0F")) 1831 *order = 4; | 1817 /* 1818 * 0. CPUs 1819 * 1. I/O port and memory system resource holders 1820 * 2. Clocks and timers (to handle early accesses) 1821 * 3. Embedded controllers (to handle early accesses) 1822 * 4. PCI Link Devices 1823 */ 1824 AcpiGetType(handle, &type); 1825 if (type == ACPI_TYPE_PROCESSOR) 1826 *order = 0; 1827 else if (acpi_MatchHid(handle, "PNP0C01") || 1828 acpi_MatchHid(handle, "PNP0C02")) 1829 *order = 1; 1830 else if (acpi_MatchHid(handle, "PNP0100") || 1831 acpi_MatchHid(handle, "PNP0103") || 1832 acpi_MatchHid(handle, "PNP0B00")) 1833 *order = 2; 1834 else if (acpi_MatchHid(handle, "PNP0C09")) 1835 *order = 3; 1836 else if (acpi_MatchHid(handle, "PNP0C0F")) 1837 *order = 4; |
1832} 1833 1834/* 1835 * Evaluate a child device and determine whether we might attach a device to 1836 * it. 1837 */ 1838static ACPI_STATUS 1839acpi_probe_child(ACPI_HANDLE handle, UINT32 level, void *context, void **status) --- 44 unchanged lines hidden (view full) --- 1884 /* 1885 * Create a placeholder device for this node. Sort the 1886 * placeholder so that the probe/attach passes will run 1887 * breadth-first. Orders less than ACPI_DEV_BASE_ORDER 1888 * are reserved for special objects (i.e., system 1889 * resources). 1890 */ 1891 ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "scanning '%s'\n", handle_str)); | 1838} 1839 1840/* 1841 * Evaluate a child device and determine whether we might attach a device to 1842 * it. 1843 */ 1844static ACPI_STATUS 1845acpi_probe_child(ACPI_HANDLE handle, UINT32 level, void *context, void **status) --- 44 unchanged lines hidden (view full) --- 1890 /* 1891 * Create a placeholder device for this node. Sort the 1892 * placeholder so that the probe/attach passes will run 1893 * breadth-first. Orders less than ACPI_DEV_BASE_ORDER 1894 * are reserved for special objects (i.e., system 1895 * resources). 1896 */ 1897 ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "scanning '%s'\n", handle_str)); |
1892 order = level * 10 + 100; | 1898 order = level * 10 + ACPI_DEV_BASE_ORDER; |
1893 acpi_probe_order(handle, &order); 1894 child = BUS_ADD_CHILD(bus, order, NULL, -1); 1895 if (child == NULL) 1896 break; 1897 1898 /* Associate the handle with the device_t and vice versa. */ 1899 acpi_set_handle(child, handle); 1900 AcpiAttachData(handle, acpi_fake_objhandler, child); --- 1947 unchanged lines hidden --- | 1899 acpi_probe_order(handle, &order); 1900 child = BUS_ADD_CHILD(bus, order, NULL, -1); 1901 if (child == NULL) 1902 break; 1903 1904 /* Associate the handle with the device_t and vice versa. */ 1905 acpi_set_handle(child, handle); 1906 AcpiAttachData(handle, acpi_fake_objhandler, child); --- 1947 unchanged lines hidden --- |