aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/kernel/um_arch.c
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2007-10-16 04:27:00 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-16 12:43:05 -0400
commitba180fd437156f7fd8cfb2fdd021d949eeef08d6 (patch)
treeb9f38b9cdd7a5b1aacf00341d1948314663c5871 /arch/um/kernel/um_arch.c
parent77bf4400319db9d2a8af6b00c2be6faa0f3d07cb (diff)
uml: style fixes pass 3
Formatting changes in the files which have been changed in the course of folding foo_skas functions into their callers. These include: copyright updates header file trimming style fixes adding severity to printks These changes should be entirely non-functional. 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/um_arch.c')
-rw-r--r--arch/um/kernel/um_arch.c74
1 files changed, 31 insertions, 43 deletions
diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c
index 5f3e13c365e5..1993e5e12256 100644
--- a/arch/um/kernel/um_arch.c
+++ b/arch/um/kernel/um_arch.c
@@ -1,39 +1,22 @@
1/* 1/*
2 * Copyright (C) 2000, 2002 Jeff Dike (jdike@karaya.com) 2 * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
3 * Licensed under the GPL 3 * Licensed under the GPL
4 */ 4 */
5 5
6#include "linux/kernel.h"
7#include "linux/sched.h"
8#include "linux/notifier.h"
9#include "linux/mm.h"
10#include "linux/types.h"
11#include "linux/tty.h"
12#include "linux/init.h"
13#include "linux/bootmem.h"
14#include "linux/spinlock.h"
15#include "linux/utsname.h"
16#include "linux/sysrq.h"
17#include "linux/seq_file.h"
18#include "linux/delay.h" 6#include "linux/delay.h"
7#include "linux/mm.h"
19#include "linux/module.h" 8#include "linux/module.h"
9#include "linux/seq_file.h"
10#include "linux/string.h"
20#include "linux/utsname.h" 11#include "linux/utsname.h"
21#include "asm/page.h"
22#include "asm/pgtable.h" 12#include "asm/pgtable.h"
23#include "asm/ptrace.h" 13#include "asm/processor.h"
24#include "asm/elf.h"
25#include "asm/user.h"
26#include "asm/setup.h" 14#include "asm/setup.h"
27#include "ubd_user.h"
28#include "asm/current.h"
29#include "kern_util.h"
30#include "as-layout.h"
31#include "arch.h" 15#include "arch.h"
16#include "as-layout.h"
17#include "init.h"
32#include "kern.h" 18#include "kern.h"
33#include "mem_user.h" 19#include "mem_user.h"
34#include "mem.h"
35#include "initrd.h"
36#include "init.h"
37#include "os.h" 20#include "os.h"
38#include "skas.h" 21#include "skas.h"
39 22
@@ -48,7 +31,7 @@ static void __init add_arg(char *arg)
48 printf("add_arg: Too many command line arguments!\n"); 31 printf("add_arg: Too many command line arguments!\n");
49 exit(1); 32 exit(1);
50 } 33 }
51 if(strlen(command_line) > 0) 34 if (strlen(command_line) > 0)
52 strcat(command_line, " "); 35 strcat(command_line, " ");
53 strcat(command_line, arg); 36 strcat(command_line, arg);
54} 37}
@@ -133,7 +116,7 @@ static int have_root __initdata = 0;
133/* Set in uml_mem_setup and modified in linux_main */ 116/* Set in uml_mem_setup and modified in linux_main */
134long long physmem_size = 32 * 1024 * 1024; 117long long physmem_size = 32 * 1024 * 1024;
135 118
136static char *usage_string = 119static char *usage_string =
137"User Mode Linux v%s\n" 120"User Mode Linux v%s\n"
138" available at http://user-mode-linux.sourceforge.net/\n\n"; 121" available at http://user-mode-linux.sourceforge.net/\n\n";
139 122
@@ -191,7 +174,7 @@ static int __init uml_ncpus_setup(char *line, int *add)
191 174
192__uml_setup("ncpus=", uml_ncpus_setup, 175__uml_setup("ncpus=", uml_ncpus_setup,
193"ncpus=<# of desired CPUs>\n" 176"ncpus=<# of desired CPUs>\n"
194" This tells an SMP kernel how many virtual processors to start.\n\n" 177" This tells an SMP kernel how many virtual processors to start.\n\n"
195); 178);
196#endif 179#endif
197 180
@@ -223,9 +206,8 @@ static int __init uml_checksetup(char *line, int *add)
223 int n; 206 int n;
224 207
225 n = strlen(p->str); 208 n = strlen(p->str);
226 if(!strncmp(line, p->str, n)){ 209 if (!strncmp(line, p->str, n) && p->setup_func(line + n, add))
227 if (p->setup_func(line + n, add)) return 1; 210 return 1;
228 }
229 p++; 211 p++;
230 } 212 }
231 return 0; 213 return 0;
@@ -236,7 +218,7 @@ static void __init uml_postsetup(void)
236 initcall_t *p; 218 initcall_t *p;
237 219
238 p = &__uml_postsetup_start; 220 p = &__uml_postsetup_start;
239 while(p < &__uml_postsetup_end){ 221 while(p < &__uml_postsetup_end) {
240 (*p)(); 222 (*p)();
241 p++; 223 p++;
242 } 224 }
@@ -272,16 +254,18 @@ int __init linux_main(int argc, char **argv)
272 unsigned int i, add; 254 unsigned int i, add;
273 char * mode; 255 char * mode;
274 256
275 for (i = 1; i < argc; i++){ 257 for (i = 1; i < argc; i++) {
276 if((i == 1) && (argv[i][0] == ' ')) continue; 258 if ((i == 1) && (argv[i][0] == ' '))
259 continue;
277 add = 1; 260 add = 1;
278 uml_checksetup(argv[i], &add); 261 uml_checksetup(argv[i], &add);
279 if (add) 262 if (add)
280 add_arg(argv[i]); 263 add_arg(argv[i]);
281 } 264 }
282 if(have_root == 0) 265 if (have_root == 0)
283 add_arg(DEFAULT_COMMAND_LINE); 266 add_arg(DEFAULT_COMMAND_LINE);
284 267
268 /* OS sanity checks that need to happen before the kernel runs */
285 os_early_checks(); 269 os_early_checks();
286 270
287 can_do_skas(); 271 can_do_skas();
@@ -302,12 +286,14 @@ int __init linux_main(int argc, char **argv)
302 286
303 brk_start = (unsigned long) sbrk(0); 287 brk_start = (unsigned long) sbrk(0);
304 288
305 /* Increase physical memory size for exec-shield users 289 /*
306 so they actually get what they asked for. This should 290 * Increase physical memory size for exec-shield users
307 add zero for non-exec shield users */ 291 * so they actually get what they asked for. This should
292 * add zero for non-exec shield users
293 */
308 294
309 diff = UML_ROUND_UP(brk_start) - UML_ROUND_UP(&_end); 295 diff = UML_ROUND_UP(brk_start) - UML_ROUND_UP(&_end);
310 if(diff > 1024 * 1024){ 296 if (diff > 1024 * 1024) {
311 printf("Adding %ld bytes to physical memory to account for " 297 printf("Adding %ld bytes to physical memory to account for "
312 "exec-shield gap\n", diff); 298 "exec-shield gap\n", diff);
313 physmem_size += UML_ROUND_UP(brk_start) - UML_ROUND_UP(&_end); 299 physmem_size += UML_ROUND_UP(brk_start) - UML_ROUND_UP(&_end);
@@ -324,11 +310,12 @@ int __init linux_main(int argc, char **argv)
324 iomem_size = (iomem_size + PAGE_SIZE - 1) & PAGE_MASK; 310 iomem_size = (iomem_size + PAGE_SIZE - 1) & PAGE_MASK;
325 max_physmem = get_kmem_end() - uml_physmem - iomem_size - MIN_VMALLOC; 311 max_physmem = get_kmem_end() - uml_physmem - iomem_size - MIN_VMALLOC;
326 312
327 /* Zones have to begin on a 1 << MAX_ORDER page boundary, 313 /*
314 * Zones have to begin on a 1 << MAX_ORDER page boundary,
328 * so this makes sure that's true for highmem 315 * so this makes sure that's true for highmem
329 */ 316 */
330 max_physmem &= ~((1 << (PAGE_SHIFT + MAX_ORDER)) - 1); 317 max_physmem &= ~((1 << (PAGE_SHIFT + MAX_ORDER)) - 1);
331 if(physmem_size + iomem_size > max_physmem){ 318 if (physmem_size + iomem_size > max_physmem) {
332 highmem = physmem_size + iomem_size - max_physmem; 319 highmem = physmem_size + iomem_size - max_physmem;
333 physmem_size -= highmem; 320 physmem_size -= highmem;
334#ifndef CONFIG_HIGHMEM 321#ifndef CONFIG_HIGHMEM
@@ -345,7 +332,7 @@ int __init linux_main(int argc, char **argv)
345 start_vm = VMALLOC_START; 332 start_vm = VMALLOC_START;
346 333
347 setup_physmem(uml_physmem, uml_reserved, physmem_size, highmem); 334 setup_physmem(uml_physmem, uml_reserved, physmem_size, highmem);
348 if(init_maps(physmem_size, iomem_size, highmem)){ 335 if (init_maps(physmem_size, iomem_size, highmem)) {
349 printf("Failed to allocate mem_map for %Lu bytes of physical " 336 printf("Failed to allocate mem_map for %Lu bytes of physical "
350 "memory and %Lu bytes of highmem\n", physmem_size, 337 "memory and %Lu bytes of highmem\n", physmem_size,
351 highmem); 338 highmem);
@@ -354,10 +341,11 @@ int __init linux_main(int argc, char **argv)
354 341
355 virtmem_size = physmem_size; 342 virtmem_size = physmem_size;
356 avail = get_kmem_end() - start_vm; 343 avail = get_kmem_end() - start_vm;
357 if(physmem_size > avail) virtmem_size = avail; 344 if (physmem_size > avail)
345 virtmem_size = avail;
358 end_vm = start_vm + virtmem_size; 346 end_vm = start_vm + virtmem_size;
359 347
360 if(virtmem_size < physmem_size) 348 if (virtmem_size < physmem_size)
361 printf("Kernel virtual memory size shrunk to %lu bytes\n", 349 printf("Kernel virtual memory size shrunk to %lu bytes\n",
362 virtmem_size); 350 virtmem_size);
363 351