| .. | .. |
|---|
| 7 | 7 | |
|---|
| 8 | 8 | #include <linux/pci.h> |
|---|
| 9 | 9 | #include <linux/init.h> |
|---|
| 10 | | -#include <linux/bootmem.h> |
|---|
| 10 | +#include <linux/memblock.h> |
|---|
| 11 | 11 | #include <linux/gfp.h> |
|---|
| 12 | 12 | #include <linux/capability.h> |
|---|
| 13 | 13 | #include <linux/mm.h> |
|---|
| .. | .. |
|---|
| 33 | 33 | { |
|---|
| 34 | 34 | struct pci_controller *hose; |
|---|
| 35 | 35 | |
|---|
| 36 | | - hose = alloc_bootmem(sizeof(*hose)); |
|---|
| 36 | + hose = memblock_alloc(sizeof(*hose), SMP_CACHE_BYTES); |
|---|
| 37 | + if (!hose) |
|---|
| 38 | + panic("%s: Failed to allocate %zu bytes\n", __func__, |
|---|
| 39 | + sizeof(*hose)); |
|---|
| 37 | 40 | |
|---|
| 38 | 41 | *hose_tail = hose; |
|---|
| 39 | 42 | hose_tail = &hose->next; |
|---|
| .. | .. |
|---|
| 44 | 47 | struct resource * __init |
|---|
| 45 | 48 | alloc_resource(void) |
|---|
| 46 | 49 | { |
|---|
| 47 | | - return alloc_bootmem(sizeof(struct resource)); |
|---|
| 50 | + void *ptr = memblock_alloc(sizeof(struct resource), SMP_CACHE_BYTES); |
|---|
| 51 | + |
|---|
| 52 | + if (!ptr) |
|---|
| 53 | + panic("%s: Failed to allocate %zu bytes\n", __func__, |
|---|
| 54 | + sizeof(struct resource)); |
|---|
| 55 | + |
|---|
| 56 | + return ptr; |
|---|
| 48 | 57 | } |
|---|
| 49 | 58 | |
|---|
| 50 | 59 | SYSCALL_DEFINE3(pciconfig_iobase, long, which, unsigned long, bus, |
|---|
| .. | .. |
|---|
| 54 | 63 | |
|---|
| 55 | 64 | /* from hose or from bus.devfn */ |
|---|
| 56 | 65 | if (which & IOBASE_FROM_HOSE) { |
|---|
| 57 | | - for (hose = hose_head; hose; hose = hose->next) |
|---|
| 66 | + for (hose = hose_head; hose; hose = hose->next) |
|---|
| 58 | 67 | if (hose->index == bus) |
|---|
| 59 | 68 | break; |
|---|
| 60 | 69 | if (!hose) |
|---|