.. | .. |
---|
18 | 18 | #include <linux/init.h> |
---|
19 | 19 | #include <linux/ioport.h> |
---|
20 | 20 | #include <linux/kernel.h> |
---|
21 | | -#include <linux/bootmem.h> |
---|
| 21 | +#include <linux/memblock.h> |
---|
22 | 22 | #include <linux/module.h> |
---|
23 | 23 | #include <linux/cache.h> |
---|
24 | 24 | #include <linux/slab.h> |
---|
.. | .. |
---|
392 | 392 | { |
---|
393 | 393 | struct pci_controller *hose; |
---|
394 | 394 | |
---|
395 | | - hose = alloc_bootmem(sizeof(*hose)); |
---|
| 395 | + hose = memblock_alloc(sizeof(*hose), SMP_CACHE_BYTES); |
---|
| 396 | + if (!hose) |
---|
| 397 | + panic("%s: Failed to allocate %zu bytes\n", __func__, |
---|
| 398 | + sizeof(*hose)); |
---|
396 | 399 | |
---|
397 | 400 | *hose_tail = hose; |
---|
398 | 401 | hose_tail = &hose->next; |
---|
.. | .. |
---|
403 | 406 | struct resource * __init |
---|
404 | 407 | alloc_resource(void) |
---|
405 | 408 | { |
---|
406 | | - return alloc_bootmem(sizeof(struct resource)); |
---|
| 409 | + void *ptr = memblock_alloc(sizeof(struct resource), SMP_CACHE_BYTES); |
---|
| 410 | + |
---|
| 411 | + if (!ptr) |
---|
| 412 | + panic("%s: Failed to allocate %zu bytes\n", __func__, |
---|
| 413 | + sizeof(struct resource)); |
---|
| 414 | + |
---|
| 415 | + return ptr; |
---|
407 | 416 | } |
---|
408 | 417 | |
---|
409 | 418 | |
---|