um: Print minimum physical memory requirement
PATCH 1/1 um: Print minimum physical memory requirement
Print a more sensible message about the minimum physical memory requirement.
---
arch/um/kernel/physmem.c +11 -4
@@ -63,16 +63,23 @@ void __init setup_physmem(unsigned long start, unsigned long reserve_end,unsigned long reserve = reserve_end - start;int pfn =PFN_UP (__pa (reserve_end));int delta = (len - reserve) >>PAGE_SHIFT ; -int err, offset, bootmap_size; +int err, offset, bootmap_size, map_size; + + offset = uml_reserved - uml_physmem; + map_size = len - offset; +if (map_size <=0 ) { +printf ("Too few physical memory! Needed=%d, given=%d\n" , + offset, len); +exit (1 ); + } physmem_fd =create_mem_file (len + highmem); - offset = uml_reserved - uml_physmem; err =os_map_memory ((void *) uml_reserved, physmem_fd, offset, - len - offset,1 ,1 ,1 ); + map_size,1 ,1 ,1 );if (err <0 ) {printf ("setup_physmem - mapping %ld bytes of memory at 0x%p " -"failed - errno = %d\n" , len - offset, +"failed - errno = %d\n" , map_size, (void *) uml_reserved, err);exit (1 ); }
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Quoted 11 lines · Thomas Meyer
Print a more sensible message about the minimum physical memory requirement.
Signed-off-by Thomas Meyer <[email protected]>---
arch/um/kernel/physmem.c +0
-0
arch/um/kernel/physmem.c void __init setup_physmem(unsigned long start, unsigned long reserve_end, · line 66
Quoted 5 lines
arch/um/kernel/physmem.c +1
-1@@ -63,16 +63,23 @@ void __init setup_physmem(unsigned long start, unsigned long reserve_end,unsigned long reserve = reserve_end - start;int pfn =PFN_UP (__pa (reserve_end));int delta = (len - reserve) >>PAGE_SHIFT ; -int err, offset, bootmap_size; +int err, offset, bootmap_size, map_size;
I think all "int" variables in this function (except for "err") should be "unsigned long", to avoid overflows on 64-bit systems.
Quoted 11 lines
arch/um/kernel/physmem.c +7
-1+ offset = uml_reserved - uml_physmem; + map_size = len - offset; +if (map_size <=0 ) { +printf ("Too few physical memory! Needed=%d, given=%d\n" , + offset, len); +exit (1 ); + } physmem_fd =create_mem_file (len + highmem); - offset = uml_reserved - uml_physmem;
arch/um/kernel/physmem.c void __init setup_physmem(unsigned long start, unsigned long reserve_end, · line 85
Quoted 10 lines
arch/um/kernel/physmem.c +2
-2err =os_map_memory ((void *) uml_reserved, physmem_fd, offset, - len - offset,1 ,1 ,1 ); + map_size,1 ,1 ,1 );if (err <0 ) {printf ("setup_physmem - mapping %ld bytes of memory at 0x%p " -"failed - errno = %d\n" , len - offset, +"failed - errno = %d\n" , map_size, (void *) uml_reserved, err);exit (1 ); }
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds