biosacpi.c (200357) | biosacpi.c (215016) |
---|---|
1/*- 2 * Copyright (c) 2001 Michael Smith <msmith@freebsd.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2001 Michael Smith <msmith@freebsd.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sys/boot/i386/libi386/biosacpi.c 200357 2009-12-10 14:54:29Z jhb $"); | 28__FBSDID("$FreeBSD: head/sys/boot/i386/libi386/biosacpi.c 215016 2010-11-08 21:50:45Z jhb $"); |
29 30#include <stand.h> 31#include <machine/stdarg.h> 32#include <bootstrap.h> 33#include <btxv86.h> 34#include "libi386.h" 35 36#include "platform/acfreebsd.h" 37#include "acconfig.h" 38#define ACPI_SYSTEM_XFACE 39#include "actypes.h" 40#include "actbl.h" 41 42/* | 29 30#include <stand.h> 31#include <machine/stdarg.h> 32#include <bootstrap.h> 33#include <btxv86.h> 34#include "libi386.h" 35 36#include "platform/acfreebsd.h" 37#include "acconfig.h" 38#define ACPI_SYSTEM_XFACE 39#include "actypes.h" 40#include "actbl.h" 41 42/* |
43 * Detect ACPI and export information about the APCI BIOS into the | 43 * Detect ACPI and export information about the ACPI BIOS into the |
44 * environment. 45 */ 46 47static ACPI_TABLE_RSDP *biosacpi_find_rsdp(void); 48static ACPI_TABLE_RSDP *biosacpi_search_rsdp(char *base, int length); 49 50#define RSDP_CHECKSUM_LENGTH 20 51 52void 53biosacpi_detect(void) 54{ 55 ACPI_TABLE_RSDP *rsdp; 56 char buf[24]; 57 int revision; 58 | 44 * environment. 45 */ 46 47static ACPI_TABLE_RSDP *biosacpi_find_rsdp(void); 48static ACPI_TABLE_RSDP *biosacpi_search_rsdp(char *base, int length); 49 50#define RSDP_CHECKSUM_LENGTH 20 51 52void 53biosacpi_detect(void) 54{ 55 ACPI_TABLE_RSDP *rsdp; 56 char buf[24]; 57 int revision; 58 |
59 /* XXX check the BIOS datestamp */ 60 | |
61 /* locate and validate the RSDP */ 62 if ((rsdp = biosacpi_find_rsdp()) == NULL) 63 return; 64 65 /* export values from the RSDP */ 66 sprintf(buf, "%p", VTOP(rsdp)); 67 setenv("hint.acpi.0.rsdp", buf, 1); 68 revision = rsdp->Revision; --- 8 unchanged lines hidden (view full) --- 77 setenv("hint.acpi.0.rsdt", buf, 1); 78 if (revision >= 2) { 79 /* XXX extended checksum? */ 80 sprintf(buf, "0x%016llx", rsdp->XsdtPhysicalAddress); 81 setenv("hint.acpi.0.xsdt", buf, 1); 82 sprintf(buf, "%d", rsdp->Length); 83 setenv("hint.acpi.0.xsdt_length", buf, 1); 84 } | 59 /* locate and validate the RSDP */ 60 if ((rsdp = biosacpi_find_rsdp()) == NULL) 61 return; 62 63 /* export values from the RSDP */ 64 sprintf(buf, "%p", VTOP(rsdp)); 65 setenv("hint.acpi.0.rsdp", buf, 1); 66 revision = rsdp->Revision; --- 8 unchanged lines hidden (view full) --- 75 setenv("hint.acpi.0.rsdt", buf, 1); 76 if (revision >= 2) { 77 /* XXX extended checksum? */ 78 sprintf(buf, "0x%016llx", rsdp->XsdtPhysicalAddress); 79 setenv("hint.acpi.0.xsdt", buf, 1); 80 sprintf(buf, "%d", rsdp->Length); 81 setenv("hint.acpi.0.xsdt_length", buf, 1); 82 } |
85 /* XXX other tables? */ 86 87 setenv("acpi_load", "YES", 1); | |
88} 89 90/* 91 * Find the RSDP in low memory. See section 5.2.2 of the ACPI spec. 92 */ 93static ACPI_TABLE_RSDP * 94biosacpi_find_rsdp(void) 95{ --- 39 unchanged lines hidden --- | 83} 84 85/* 86 * Find the RSDP in low memory. See section 5.2.2 of the ACPI spec. 87 */ 88static ACPI_TABLE_RSDP * 89biosacpi_find_rsdp(void) 90{ --- 39 unchanged lines hidden --- |