1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-17 10:26:15 +00:00

Make the lower range of the memory area 0x80000000 again. Also

introduce hw.{pci,acpi}.host_mem_start tunable to change this.

MFC: ASAP
This commit is contained in:
Warner Losh 2004-10-11 21:10:23 +00:00
parent bb978628ec
commit fd492ee0e6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=136397
2 changed files with 20 additions and 2 deletions

View File

@ -32,6 +32,7 @@
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/module.h>
#include <sys/sysctl.h>
#include "acpi.h"
#include <dev/acpica/acpivar.h>
@ -300,6 +301,9 @@ acpi_pcib_acpi_route_interrupt(device_t pcib, device_t dev, int pin)
return (acpi_pcib_route_interrupt(pcib, dev, pin));
}
static int acpi_host_mem_start = 0x80000000;
TUNABLE_INT("hw.acpi.host_mem_start", &acpi_host_mem_start);
struct resource *
acpi_pcib_acpi_alloc_resource(device_t dev, device_t child, int type, int *rid,
u_long start, u_long end, u_long count, u_int flags)
@ -314,7 +318,7 @@ acpi_pcib_acpi_alloc_resource(device_t dev, device_t child, int type, int *rid,
* is liekly OK.
*/
if (type == SYS_RES_MEMORY && start == 0UL && end == ~0UL)
start = 0xfe000000;
start = acpi_host_mem_start;
return (bus_generic_alloc_resource(dev, child, type, rid, start, end,
count, flags));
}

View File

@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$");
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/module.h>
#include <sys/sysctl.h>
#include <dev/pci/pcivar.h>
#include <dev/pci/pcireg.h>
@ -469,6 +470,16 @@ legacy_pcib_write_ivar(device_t dev, device_t child, int which,
return ENOENT;
}
SYSCTL_DECL(_hw_pci);
static int legacy_host_mem_start = 0x80000000;
/* No TUNABLE_ULONG :-( */
TUNABLE_INT("hw.pci.host_mem_start", &legacy_host_mem_start);
SYSCTL_INT(_hw_pci, OID_AUTO, host_mem_start, CTLFLAG_RDTUN,
&legacy_host_mem_start, 0x80000000,
"Limit the host bridge memory to being above this address. Must be\n\
set at boot via a tunable.");
static struct resource *
legacy_pcib_alloc_resource(device_t dev, device_t child, int type, int *rid,
u_long start, u_long end, u_long count, u_int flags)
@ -481,9 +492,12 @@ legacy_pcib_alloc_resource(device_t dev, device_t child, int type, int *rid,
* found to do it. This is typically only used on older laptops
* that don't have pci busses behind pci bridge, so assuming > 32MB
* is liekly OK.
*
* However, this can cause problems for other chipsets, so we make
* this tunable by hw.pci.host_mem_start.
*/
if (type == SYS_RES_MEMORY && start == 0UL && end == ~0UL)
start = 0xfe000000;
start = legacy_host_mem_start;
return (bus_generic_alloc_resource(dev, child, type, rid, start, end,
count, flags));
}