summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1999-08-29 09:03:58 +0000
committerbde <bde@FreeBSD.org>1999-08-29 09:03:58 +0000
commitb40f30707d14d710c90e70efe406d062ea6b9f7d (patch)
treebb52e5f0c44c92782a9e2e03a9aa3e425a376f9d /sys
parenta932c8483a31262b22f6f0ccc03e264207884b41 (diff)
downloadFreeBSD-src-b40f30707d14d710c90e70efe406d062ea6b9f7d.zip
FreeBSD-src-b40f30707d14d710c90e70efe406d062ea6b9f7d.tar.gz
Don't restrict our requests for contiguous memory to addresses >= 1MB.
This fixes, at least, panics in ncr_attach() on i386's with about 5MB of memory. The restriction was a hack to leave some low memory for ISA DMA, but on i386's we now allocate pages from the top down, so all the restriction did was cause our allocations to fail when there is no free memory above 1MB.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/bktr/bktr_core.c10
-rw-r--r--sys/dev/sf/if_sf.c2
-rw-r--r--sys/dev/sk/if_sk.c4
-rw-r--r--sys/dev/ti/if_ti.c4
-rw-r--r--sys/pci/brooktree848.c10
-rw-r--r--sys/pci/if_rl.c2
-rw-r--r--sys/pci/if_sf.c2
-rw-r--r--sys/pci/if_sk.c4
-rw-r--r--sys/pci/if_ste.c2
-rw-r--r--sys/pci/if_ti.c4
-rw-r--r--sys/pci/meteor.c5
-rw-r--r--sys/pci/ncr.c4
12 files changed, 24 insertions, 29 deletions
diff --git a/sys/dev/bktr/bktr_core.c b/sys/dev/bktr/bktr_core.c
index 46cf72e..71c38fd 100644
--- a/sys/dev/bktr/bktr_core.c
+++ b/sys/dev/bktr/bktr_core.c
@@ -7019,10 +7019,9 @@ get_bktr_mem( int unit, unsigned size )
{
vm_offset_t addr = 0;
- addr = vm_page_alloc_contig(size, 0x100000, 0xffffffff, 1<<24);
+ addr = vm_page_alloc_contig(size, 0, 0xffffffff, 1<<24);
if (addr == 0)
- addr = vm_page_alloc_contig(size, 0x100000, 0xffffffff,
- PAGE_SIZE);
+ addr = vm_page_alloc_contig(size, 0, 0xffffffff, PAGE_SIZE);
if (addr == 0) {
printf("bktr%d: Unable to allocate %d bytes of memory.\n",
unit, size);
@@ -7479,10 +7478,9 @@ get_bktr_mem( int unit, unsigned size )
{
vm_offset_t addr = 0;
- addr = vm_page_alloc_contig(size, 0x100000, 0xffffffff, 1<<24);
+ addr = vm_page_alloc_contig(size, 0, 0xffffffff, 1<<24);
if (addr == 0)
- addr = vm_page_alloc_contig(size, 0x100000, 0xffffffff,
- PAGE_SIZE);
+ addr = vm_page_alloc_contig(size, 0, 0xffffffff, PAGE_SIZE);
if (addr == 0) {
printf("bktr%d: Unable to allocate %d bytes of memory.\n",
unit, size);
diff --git a/sys/dev/sf/if_sf.c b/sys/dev/sf/if_sf.c
index 9a79c26..a07b04f 100644
--- a/sys/dev/sf/if_sf.c
+++ b/sys/dev/sf/if_sf.c
@@ -1079,7 +1079,7 @@ static int sf_attach(dev)
/* Allocate the descriptor queues. */
sc->sf_ldata = contigmalloc(sizeof(struct sf_list_data), M_DEVBUF,
- M_NOWAIT, 0x100000, 0xffffffff, PAGE_SIZE, 0);
+ M_NOWAIT, 0, 0xffffffff, PAGE_SIZE, 0);
if (sc->sf_ldata == NULL) {
printf("sf%d: no memory for list buffers!\n", unit);
diff --git a/sys/dev/sk/if_sk.c b/sys/dev/sk/if_sk.c
index 4038967..7fa3d1c 100644
--- a/sys/dev/sk/if_sk.c
+++ b/sys/dev/sk/if_sk.c
@@ -647,7 +647,7 @@ static int sk_alloc_jumbo_mem(sc_if)
/* Grab a big chunk o' storage. */
sc_if->sk_cdata.sk_jumbo_buf = contigmalloc(SK_JMEM, M_DEVBUF,
- M_NOWAIT, 0x100000, 0xffffffff, PAGE_SIZE, 0);
+ M_NOWAIT, 0, 0xffffffff, PAGE_SIZE, 0);
if (sc_if->sk_cdata.sk_jumbo_buf == NULL) {
printf("sk%d: no memory for jumbo buffers!\n", sc_if->sk_unit);
@@ -1088,7 +1088,7 @@ static int sk_attach_xmac(sc, port)
/* Allocate the descriptor queues. */
sc_if->sk_rdata = contigmalloc(sizeof(struct sk_ring_data), M_DEVBUF,
- M_NOWAIT, 0x100000, 0xffffffff, PAGE_SIZE, 0);
+ M_NOWAIT, 0, 0xffffffff, PAGE_SIZE, 0);
if (sc_if->sk_rdata == NULL) {
printf("sk%d: no memory for list buffers!\n", sc_if->sk_unit);
diff --git a/sys/dev/ti/if_ti.c b/sys/dev/ti/if_ti.c
index 5195324..0d47987 100644
--- a/sys/dev/ti/if_ti.c
+++ b/sys/dev/ti/if_ti.c
@@ -603,7 +603,7 @@ static int ti_alloc_jumbo_mem(sc)
/* Grab a big chunk o' storage. */
sc->ti_cdata.ti_jumbo_buf = contigmalloc(TI_JMEM, M_DEVBUF,
- M_NOWAIT, 0x100000, 0xffffffff, PAGE_SIZE, 0);
+ M_NOWAIT, 0, 0xffffffff, PAGE_SIZE, 0);
if (sc->ti_cdata.ti_jumbo_buf == NULL) {
printf("ti%d: no memory for jumbo buffers!\n", sc->ti_unit);
@@ -1663,7 +1663,7 @@ static int ti_attach(dev)
/* Allocate the general information block and ring buffers. */
sc->ti_rdata = contigmalloc(sizeof(struct ti_ring_data), M_DEVBUF,
- M_NOWAIT, 0x100000, 0xffffffff, PAGE_SIZE, 0);
+ M_NOWAIT, 0, 0xffffffff, PAGE_SIZE, 0);
if (sc->ti_rdata == NULL) {
bus_teardown_intr(dev, sc->ti_irq, sc->ti_intrhand);
diff --git a/sys/pci/brooktree848.c b/sys/pci/brooktree848.c
index 46cf72e..71c38fd 100644
--- a/sys/pci/brooktree848.c
+++ b/sys/pci/brooktree848.c
@@ -7019,10 +7019,9 @@ get_bktr_mem( int unit, unsigned size )
{
vm_offset_t addr = 0;
- addr = vm_page_alloc_contig(size, 0x100000, 0xffffffff, 1<<24);
+ addr = vm_page_alloc_contig(size, 0, 0xffffffff, 1<<24);
if (addr == 0)
- addr = vm_page_alloc_contig(size, 0x100000, 0xffffffff,
- PAGE_SIZE);
+ addr = vm_page_alloc_contig(size, 0, 0xffffffff, PAGE_SIZE);
if (addr == 0) {
printf("bktr%d: Unable to allocate %d bytes of memory.\n",
unit, size);
@@ -7479,10 +7478,9 @@ get_bktr_mem( int unit, unsigned size )
{
vm_offset_t addr = 0;
- addr = vm_page_alloc_contig(size, 0x100000, 0xffffffff, 1<<24);
+ addr = vm_page_alloc_contig(size, 0, 0xffffffff, 1<<24);
if (addr == 0)
- addr = vm_page_alloc_contig(size, 0x100000, 0xffffffff,
- PAGE_SIZE);
+ addr = vm_page_alloc_contig(size, 0, 0xffffffff, PAGE_SIZE);
if (addr == 0) {
printf("bktr%d: Unable to allocate %d bytes of memory.\n",
unit, size);
diff --git a/sys/pci/if_rl.c b/sys/pci/if_rl.c
index 657aabb..00397e5 100644
--- a/sys/pci/if_rl.c
+++ b/sys/pci/if_rl.c
@@ -1144,7 +1144,7 @@ rl_attach(config_id, unit)
}
sc->rl_cdata.rl_rx_buf = contigmalloc(RL_RXBUFLEN + 32, M_DEVBUF,
- M_NOWAIT, 0x100000, 0xffffffff, PAGE_SIZE, 0);
+ M_NOWAIT, 0, 0xffffffff, PAGE_SIZE, 0);
if (sc->rl_cdata.rl_rx_buf == NULL) {
free(sc, M_DEVBUF);
diff --git a/sys/pci/if_sf.c b/sys/pci/if_sf.c
index 9a79c26..a07b04f 100644
--- a/sys/pci/if_sf.c
+++ b/sys/pci/if_sf.c
@@ -1079,7 +1079,7 @@ static int sf_attach(dev)
/* Allocate the descriptor queues. */
sc->sf_ldata = contigmalloc(sizeof(struct sf_list_data), M_DEVBUF,
- M_NOWAIT, 0x100000, 0xffffffff, PAGE_SIZE, 0);
+ M_NOWAIT, 0, 0xffffffff, PAGE_SIZE, 0);
if (sc->sf_ldata == NULL) {
printf("sf%d: no memory for list buffers!\n", unit);
diff --git a/sys/pci/if_sk.c b/sys/pci/if_sk.c
index 4038967..7fa3d1c 100644
--- a/sys/pci/if_sk.c
+++ b/sys/pci/if_sk.c
@@ -647,7 +647,7 @@ static int sk_alloc_jumbo_mem(sc_if)
/* Grab a big chunk o' storage. */
sc_if->sk_cdata.sk_jumbo_buf = contigmalloc(SK_JMEM, M_DEVBUF,
- M_NOWAIT, 0x100000, 0xffffffff, PAGE_SIZE, 0);
+ M_NOWAIT, 0, 0xffffffff, PAGE_SIZE, 0);
if (sc_if->sk_cdata.sk_jumbo_buf == NULL) {
printf("sk%d: no memory for jumbo buffers!\n", sc_if->sk_unit);
@@ -1088,7 +1088,7 @@ static int sk_attach_xmac(sc, port)
/* Allocate the descriptor queues. */
sc_if->sk_rdata = contigmalloc(sizeof(struct sk_ring_data), M_DEVBUF,
- M_NOWAIT, 0x100000, 0xffffffff, PAGE_SIZE, 0);
+ M_NOWAIT, 0, 0xffffffff, PAGE_SIZE, 0);
if (sc_if->sk_rdata == NULL) {
printf("sk%d: no memory for list buffers!\n", sc_if->sk_unit);
diff --git a/sys/pci/if_ste.c b/sys/pci/if_ste.c
index d808578..d3fb8b3 100644
--- a/sys/pci/if_ste.c
+++ b/sys/pci/if_ste.c
@@ -1057,7 +1057,7 @@ static int ste_attach(dev)
/* Allocate the descriptor queues. */
sc->ste_ldata = contigmalloc(sizeof(struct ste_list_data), M_DEVBUF,
- M_NOWAIT, 0x100000, 0xffffffff, PAGE_SIZE, 0);
+ M_NOWAIT, 0, 0xffffffff, PAGE_SIZE, 0);
if (sc->ste_ldata == NULL) {
free(sc, M_DEVBUF);
diff --git a/sys/pci/if_ti.c b/sys/pci/if_ti.c
index 5195324..0d47987 100644
--- a/sys/pci/if_ti.c
+++ b/sys/pci/if_ti.c
@@ -603,7 +603,7 @@ static int ti_alloc_jumbo_mem(sc)
/* Grab a big chunk o' storage. */
sc->ti_cdata.ti_jumbo_buf = contigmalloc(TI_JMEM, M_DEVBUF,
- M_NOWAIT, 0x100000, 0xffffffff, PAGE_SIZE, 0);
+ M_NOWAIT, 0, 0xffffffff, PAGE_SIZE, 0);
if (sc->ti_cdata.ti_jumbo_buf == NULL) {
printf("ti%d: no memory for jumbo buffers!\n", sc->ti_unit);
@@ -1663,7 +1663,7 @@ static int ti_attach(dev)
/* Allocate the general information block and ring buffers. */
sc->ti_rdata = contigmalloc(sizeof(struct ti_ring_data), M_DEVBUF,
- M_NOWAIT, 0x100000, 0xffffffff, PAGE_SIZE, 0);
+ M_NOWAIT, 0, 0xffffffff, PAGE_SIZE, 0);
if (sc->ti_rdata == NULL) {
bus_teardown_intr(dev, sc->ti_irq, sc->ti_intrhand);
diff --git a/sys/pci/meteor.c b/sys/pci/meteor.c
index 47960c1..f306cc2 100644
--- a/sys/pci/meteor.c
+++ b/sys/pci/meteor.c
@@ -871,10 +871,9 @@ get_meteor_mem(int unit, unsigned size)
{
vm_offset_t addr = 0;
- addr = vm_page_alloc_contig(size, 0x100000, 0xffffffff, 1<<24);
+ addr = vm_page_alloc_contig(size, 0, 0xffffffff, 1<<24);
if(addr == 0)
- addr = vm_page_alloc_contig(size, 0x100000, 0xffffffff,
- PAGE_SIZE);
+ addr = vm_page_alloc_contig(size, 0, 0xffffffff, PAGE_SIZE);
if(addr == 0) {
printf("meteor%d: Unable to allocate %d bytes of memory.\n",
unit, size);
diff --git a/sys/pci/ncr.c b/sys/pci/ncr.c
index 6b166b3..cdfa875 100644
--- a/sys/pci/ncr.c
+++ b/sys/pci/ncr.c
@@ -3658,7 +3658,7 @@ ncr_attach (pcici_t config_id, int unit)
} else if (sizeof (struct script) > PAGE_SIZE) {
np->script = (struct script*) vm_page_alloc_contig
(round_page(sizeof (struct script)),
- 0x100000, 0xffffffff, PAGE_SIZE);
+ 0, 0xffffffff, PAGE_SIZE);
} else {
np->script = (struct script *)
malloc (sizeof (struct script), M_DEVBUF, M_WAITOK);
@@ -3668,7 +3668,7 @@ ncr_attach (pcici_t config_id, int unit)
if (sizeof (struct scripth) > PAGE_SIZE) {
np->scripth = (struct scripth*) vm_page_alloc_contig
(round_page(sizeof (struct scripth)),
- 0x100000, 0xffffffff, PAGE_SIZE);
+ 0, 0xffffffff, PAGE_SIZE);
} else
{
np->scripth = (struct scripth *)
OpenPOWER on IntegriCloud