aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/kernel/physmem.c
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2007-07-23 21:43:48 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-24 15:24:58 -0400
commit97a1fcbb20fcbb0177567fd2dbcc6ed1bcc450ce (patch)
tree0331a8685599fbe23532bd69cd89ef82e4ed7806 /arch/um/kernel/physmem.c
parentda3e30e78ed9652322dccb49fa149e7b4e985f74 (diff)
uml: more __init annotations
2.6.23-rc1 turned up another batch of references from non-__init code to __init code. In most cases, these were missing __init annotations. In one case (os_drop_memory), the annotation was present but wrong. init_maps is __init, but for some reason was being very careful about the mechanism by which it allocated memory, checking whether it was OK to use kmalloc (at this point in the boot, it definitely isn't) and using either alloc_bootmem_low_pages or kmalloc/vmalloc. So, the kmalloc/vmalloc code is removed. Signed-off-by: Jeff Dike <jdike@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/um/kernel/physmem.c')
-rw-r--r--arch/um/kernel/physmem.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/arch/um/kernel/physmem.c b/arch/um/kernel/physmem.c
index 3ba6e4c841da..5ee7e851bbc1 100644
--- a/arch/um/kernel/physmem.c
+++ b/arch/um/kernel/physmem.c
@@ -28,7 +28,8 @@ unsigned long high_physmem;
28 28
29extern unsigned long long physmem_size; 29extern unsigned long long physmem_size;
30 30
31int init_maps(unsigned long physmem, unsigned long iomem, unsigned long highmem) 31int __init init_maps(unsigned long physmem, unsigned long iomem,
32 unsigned long highmem)
32{ 33{
33 struct page *p, *map; 34 struct page *p, *map;
34 unsigned long phys_len, phys_pages, highmem_len, highmem_pages; 35 unsigned long phys_len, phys_pages, highmem_len, highmem_pages;
@@ -47,13 +48,7 @@ int init_maps(unsigned long physmem, unsigned long iomem, unsigned long highmem)
47 total_pages = phys_pages + iomem_pages + highmem_pages; 48 total_pages = phys_pages + iomem_pages + highmem_pages;
48 total_len = phys_len + iomem_len + highmem_len; 49 total_len = phys_len + iomem_len + highmem_len;
49 50
50 if(kmalloc_ok){ 51 map = alloc_bootmem_low_pages(total_len);
51 map = kmalloc(total_len, GFP_KERNEL);
52 if(map == NULL)
53 map = vmalloc(total_len);
54 }
55 else map = alloc_bootmem_low_pages(total_len);
56
57 if(map == NULL) 52 if(map == NULL)
58 return -ENOMEM; 53 return -ENOMEM;
59 54
@@ -98,8 +93,8 @@ void map_memory(unsigned long virt, unsigned long phys, unsigned long len,
98 93
99extern int __syscall_stub_start; 94extern int __syscall_stub_start;
100 95
101void setup_physmem(unsigned long start, unsigned long reserve_end, 96void __init setup_physmem(unsigned long start, unsigned long reserve_end,
102 unsigned long len, unsigned long long highmem) 97 unsigned long len, unsigned long long highmem)
103{ 98{
104 unsigned long reserve = reserve_end - start; 99 unsigned long reserve = reserve_end - start;
105 int pfn = PFN_UP(__pa(reserve_end)); 100 int pfn = PFN_UP(__pa(reserve_end));