diff options
author | imp <imp@FreeBSD.org> | 2001-11-26 07:17:09 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2001-11-26 07:17:09 +0000 |
commit | 31e236c67382da93a93ae78dbeb8c445088b17bc (patch) | |
tree | 398bdb5a1f1615beaf95543da2cffb5c18718d67 /sys/dev/pccbb | |
parent | 335a26d4b8070228e4303497ddfa0d38ef16a562 (diff) | |
download | FreeBSD-src-31e236c67382da93a93ae78dbeb8c445088b17bc.zip FreeBSD-src-31e236c67382da93a93ae78dbeb8c445088b17bc.tar.gz |
Make the start memory address that we use configurable via a boot
loader parameter. This allows us to more easily boot on big memory
configuration machines. hw.pccbb.start_mem. Reflect this in a sysctl
so we can read it from userland.
# Note: we need a TUNABLE_ULONG to do this right. I'll add that to
# kernel.h soon.
Diffstat (limited to 'sys/dev/pccbb')
-rw-r--r-- | sys/dev/pccbb/pccbb.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/sys/dev/pccbb/pccbb.c b/sys/dev/pccbb/pccbb.c index c6d305b..c8b21d2 100644 --- a/sys/dev/pccbb/pccbb.c +++ b/sys/dev/pccbb/pccbb.c @@ -55,6 +55,7 @@ #include <sys/lock.h> #include <sys/malloc.h> #include <sys/mutex.h> +#include <sys/sysctl.h> #include <sys/bus.h> #include <machine/bus.h> @@ -194,6 +195,16 @@ struct yenta_chipinfo { CB_UNKNOWN, 0}, }; +/* sysctl vars */ +SYSCTL_NODE(_hw, OID_AUTO, pccbb, CTLFLAG_RD, 0, "PCCBB parameters"); + +/* There's no way to say TUNEABLE_LONG to get the right types */ +u_long pccbb_start_mem = PCCBB_START_MEM; +TUNABLE_INT("hw.pccbb.start_memory", (int *)&pccbb_start_mem); +SYSCTL_ULONG(_hw_pccbb, OID_AUTO, start_mem, CTLFLAG_RD, + &pccbb_start_mem, PCCBB_START_MEM, + "Starting address for memory allocations"); + static int cb_chipset(u_int32_t pci_id, const char **namep, int *flagp); static int pccbb_probe(device_t brdev); static void pccbb_chipinit(struct pccbb_softc *sc); @@ -440,7 +451,7 @@ pccbb_attach(device_t brdev) -(sockbase & 0xfffffff0); sc->sc_base_res = bus_generic_alloc_resource( device_get_parent(brdev), brdev, SYS_RES_MEMORY, - &rid, PCCBB_START_MEM, ~0, sockbase, + &rid, pccbb_start_mem, ~0, sockbase, RF_ACTIVE|rman_make_alignment_flags(sockbase)); if (!sc->sc_base_res){ device_printf(brdev, @@ -1262,8 +1273,8 @@ pccbb_cardbus_alloc_resource(device_t brdev, device_t child, int type, int *rid, end = start; break; case SYS_RES_MEMORY: - if (start <= PCCBB_START_MEM) - start = PCCBB_START_MEM; + if (start <= pccbb_start_mem) + start = pccbb_start_mem; if (end < start) end = start; break; @@ -1780,8 +1791,8 @@ pccbb_pcic_alloc_resource(device_t brdev, device_t child, int type, int *rid, switch (type) { case SYS_RES_MEMORY: - if (start < PCCBB_START_MEM) - start = PCCBB_START_MEM; + if (start < pccbb_start_mem) + start = pccbb_start_mem; if (end < start) end = start; flags = (flags & ~RF_ALIGNMENT_MASK) | |