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.
This commit is contained in:
parent
a932c8483a
commit
b40f30707d
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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 *)
|
||||
|
Loading…
x
Reference in New Issue
Block a user