aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2005-11-07 03:58:57 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-07 10:53:31 -0500
commitae17381608a11781a6a67e0ce51607f36780aac7 (patch)
treee4bd104cb7f3728f2e91646d4def091f8f933447 /arch
parent858259cf7d1c443c836a2022b78cb281f0a9b95e (diff)
[PATCH] uml: big memory fixes
A number of fixes to improve behavior when large physical memory sizes are specified: - libc files need -D_FILE_OFFSET_BITS=64 because there are unavoidable uses of non-64 interfaces in libc - some %d need to be %u Signed-off-by: Jeff Dike <jdike@addtoit.com> Cc: Paolo Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/um/Makefile2
-rw-r--r--arch/um/include/mem_user.h2
-rw-r--r--arch/um/include/os.h2
-rw-r--r--arch/um/kernel/physmem.c4
-rw-r--r--arch/um/kernel/um_arch.c10
-rw-r--r--arch/um/os-Linux/mem.c6
-rw-r--r--arch/um/os-Linux/start_up.c2
7 files changed, 14 insertions, 14 deletions
diff --git a/arch/um/Makefile b/arch/um/Makefile
index e1ffad224605..e55d32e903bc 100644
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
@@ -60,7 +60,7 @@ AFLAGS += $(ARCH_INCLUDE)
60 60
61USER_CFLAGS := $(patsubst -I%,,$(CFLAGS)) 61USER_CFLAGS := $(patsubst -I%,,$(CFLAGS))
62USER_CFLAGS := $(patsubst -D__KERNEL__,,$(USER_CFLAGS)) $(ARCH_INCLUDE) \ 62USER_CFLAGS := $(patsubst -D__KERNEL__,,$(USER_CFLAGS)) $(ARCH_INCLUDE) \
63 $(MODE_INCLUDE) 63 $(MODE_INCLUDE) -D_FILE_OFFSET_BITS=64
64 64
65# -Derrno=kernel_errno - This turns all kernel references to errno into 65# -Derrno=kernel_errno - This turns all kernel references to errno into
66# kernel_errno to separate them from the libc errno. This allows -fno-common 66# kernel_errno to separate them from the libc errno. This allows -fno-common
diff --git a/arch/um/include/mem_user.h b/arch/um/include/mem_user.h
index 9fef4123a65a..a1064c5823bf 100644
--- a/arch/um/include/mem_user.h
+++ b/arch/um/include/mem_user.h
@@ -57,7 +57,7 @@ extern int init_maps(unsigned long physmem, unsigned long iomem,
57 unsigned long highmem); 57 unsigned long highmem);
58extern unsigned long get_vm(unsigned long len); 58extern unsigned long get_vm(unsigned long len);
59extern void setup_physmem(unsigned long start, unsigned long usable, 59extern void setup_physmem(unsigned long start, unsigned long usable,
60 unsigned long len, unsigned long highmem); 60 unsigned long len, unsigned long long highmem);
61extern void add_iomem(char *name, int fd, unsigned long size); 61extern void add_iomem(char *name, int fd, unsigned long size);
62extern unsigned long phys_offset(unsigned long phys); 62extern unsigned long phys_offset(unsigned long phys);
63extern void unmap_physmem(void); 63extern void unmap_physmem(void);
diff --git a/arch/um/include/os.h b/arch/um/include/os.h
index 112d7288f0cf..2cccfa5b8ab5 100644
--- a/arch/um/include/os.h
+++ b/arch/um/include/os.h
@@ -167,7 +167,7 @@ extern int can_do_skas(void);
167#endif 167#endif
168 168
169/* mem.c */ 169/* mem.c */
170extern int create_mem_file(unsigned long len); 170extern int create_mem_file(unsigned long long len);
171 171
172/* process.c */ 172/* process.c */
173extern unsigned long os_process_pc(int pid); 173extern unsigned long os_process_pc(int pid);
diff --git a/arch/um/kernel/physmem.c b/arch/um/kernel/physmem.c
index ea670fcc8af5..f3b583a878a6 100644
--- a/arch/um/kernel/physmem.c
+++ b/arch/um/kernel/physmem.c
@@ -246,7 +246,7 @@ int is_remapped(void *virt)
246/* Changed during early boot */ 246/* Changed during early boot */
247unsigned long high_physmem; 247unsigned long high_physmem;
248 248
249extern unsigned long physmem_size; 249extern unsigned long long physmem_size;
250 250
251int init_maps(unsigned long physmem, unsigned long iomem, unsigned long highmem) 251int init_maps(unsigned long physmem, unsigned long iomem, unsigned long highmem)
252{ 252{
@@ -321,7 +321,7 @@ void map_memory(unsigned long virt, unsigned long phys, unsigned long len,
321extern int __syscall_stub_start, __binary_start; 321extern int __syscall_stub_start, __binary_start;
322 322
323void setup_physmem(unsigned long start, unsigned long reserve_end, 323void setup_physmem(unsigned long start, unsigned long reserve_end,
324 unsigned long len, unsigned long highmem) 324 unsigned long len, unsigned long long highmem)
325{ 325{
326 unsigned long reserve = reserve_end - start; 326 unsigned long reserve = reserve_end - start;
327 int pfn = PFN_UP(__pa(reserve_end)); 327 int pfn = PFN_UP(__pa(reserve_end));
diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c
index 93dc782dc1cc..142a9493912b 100644
--- a/arch/um/kernel/um_arch.c
+++ b/arch/um/kernel/um_arch.c
@@ -137,7 +137,7 @@ static char *argv1_end = NULL;
137 137
138/* Set in early boot */ 138/* Set in early boot */
139static int have_root __initdata = 0; 139static int have_root __initdata = 0;
140long physmem_size = 32 * 1024 * 1024; 140long long physmem_size = 32 * 1024 * 1024;
141 141
142void set_cmdline(char *cmd) 142void set_cmdline(char *cmd)
143{ 143{
@@ -402,7 +402,7 @@ int linux_main(int argc, char **argv)
402#ifndef CONFIG_HIGHMEM 402#ifndef CONFIG_HIGHMEM
403 highmem = 0; 403 highmem = 0;
404 printf("CONFIG_HIGHMEM not enabled - physical memory shrunk " 404 printf("CONFIG_HIGHMEM not enabled - physical memory shrunk "
405 "to %ld bytes\n", physmem_size); 405 "to %lu bytes\n", physmem_size);
406#endif 406#endif
407 } 407 }
408 408
@@ -414,8 +414,8 @@ int linux_main(int argc, char **argv)
414 414
415 setup_physmem(uml_physmem, uml_reserved, physmem_size, highmem); 415 setup_physmem(uml_physmem, uml_reserved, physmem_size, highmem);
416 if(init_maps(physmem_size, iomem_size, highmem)){ 416 if(init_maps(physmem_size, iomem_size, highmem)){
417 printf("Failed to allocate mem_map for %ld bytes of physical " 417 printf("Failed to allocate mem_map for %lu bytes of physical "
418 "memory and %ld bytes of highmem\n", physmem_size, 418 "memory and %lu bytes of highmem\n", physmem_size,
419 highmem); 419 highmem);
420 exit(1); 420 exit(1);
421 } 421 }
@@ -426,7 +426,7 @@ int linux_main(int argc, char **argv)
426 end_vm = start_vm + virtmem_size; 426 end_vm = start_vm + virtmem_size;
427 427
428 if(virtmem_size < physmem_size) 428 if(virtmem_size < physmem_size)
429 printf("Kernel virtual memory size shrunk to %ld bytes\n", 429 printf("Kernel virtual memory size shrunk to %lu bytes\n",
430 virtmem_size); 430 virtmem_size);
431 431
432 uml_postsetup(); 432 uml_postsetup();
diff --git a/arch/um/os-Linux/mem.c b/arch/um/os-Linux/mem.c
index 8e71edaaf80b..9d7d69a523bb 100644
--- a/arch/um/os-Linux/mem.c
+++ b/arch/um/os-Linux/mem.c
@@ -88,7 +88,7 @@ int make_tempfile(const char *template, char **out_tempname, int do_unlink)
88 * This proc is used in start_up.c 88 * This proc is used in start_up.c
89 * So it isn't 'static'. 89 * So it isn't 'static'.
90 */ 90 */
91int create_tmp_file(unsigned long len) 91int create_tmp_file(unsigned long long len)
92{ 92{
93 int fd, err; 93 int fd, err;
94 char zero; 94 char zero;
@@ -121,7 +121,7 @@ int create_tmp_file(unsigned long len)
121 return(fd); 121 return(fd);
122} 122}
123 123
124static int create_anon_file(unsigned long len) 124static int create_anon_file(unsigned long long len)
125{ 125{
126 void *addr; 126 void *addr;
127 int fd; 127 int fd;
@@ -144,7 +144,7 @@ static int create_anon_file(unsigned long len)
144 144
145extern int have_devanon; 145extern int have_devanon;
146 146
147int create_mem_file(unsigned long len) 147int create_mem_file(unsigned long long len)
148{ 148{
149 int err, fd; 149 int err, fd;
150 150
diff --git a/arch/um/os-Linux/start_up.c b/arch/um/os-Linux/start_up.c
index 553a09c7d0bc..37517d49c4ae 100644
--- a/arch/um/os-Linux/start_up.c
+++ b/arch/um/os-Linux/start_up.c
@@ -296,7 +296,7 @@ static void __init check_ptrace(void)
296 check_sysemu(); 296 check_sysemu();
297} 297}
298 298
299extern int create_tmp_file(unsigned long len); 299extern int create_tmp_file(unsigned long long len);
300 300
301static void check_tmpexec(void) 301static void check_tmpexec(void)
302{ 302{