2009-05-02 Vladimir Serbinenko <phcoder@gmail.com>
Mmap services * loader/i386/efi/linux.c (grub_linux_boot): use grub_mmap_iterate * loader/i386/linux.c (find_mmap_size): likewise (allocate_pages): likewise * loader/i386/multiboot.c (grub_get_multiboot_mmap_len): likewise (grub_fill_multiboot_mmap): likewise (grub_multiboot): use grub_mmap_get_lower and grub_mmap_get_upper * loader/i386/pc/linux.c (grub_cmd_linux): use grub_mmap_get_lower * include/grub/i386/bsd.h (OPENBSD_MMAP_AVAILABLE): new definition (OPENBSD_MMAP_RESERVED): likewise * include/grub/i386/pc/memory.h: include grub/memory.h (grub_lower_mem): removed (grub_upper_mem): likewise (GRUB_MACHINE_MEMORY_ACPI): new definition (GRUB_MACHINE_MEMORY_NVS): likewise (GRUB_MACHINE_MEMORY_MAX_TYPE): likewise (GRUB_MACHINE_MEMORY_HOLE): likewise (grub_machine_mmap_register): likewise (grub_machine_mmap_unregister): likewise (grub_machine_get_upper): likewise (grub_machine_get_lower): likewise (grub_machine_get_post64): likewise * include/grub/i386/efi/memory.h: new file * include/grub/x86_64/efi/memory.h: likewise * include/grub/efi/memory.h: likewise * conf/i386-pc.rmk (pkglib_MODULES): added mmap.mod (mmap_mod_SOURCES): new variable (mmap_mod_LDFLAGS): likewise (mmap_mod_ASFLAGS): likewise * conf/i386-coreboot.rmk: likewise * conf/i386-ieee1275.rmk: likewise * conf/i386-efi.rmk: likewise * conf/x86_64-efi.rmk: likewise * include/grub/types.h (UINT_TO_PTR): new macro (PTR_TO_UINT32): likewise (PTR_TO_UINT64): likewise * include/grub/memory.h: new file * mmap/i386/pc/mmap.c: likewise * mmap/i386/pc/mmap_helper.S: likewise * mmap/i386/uppermem.c: likewise * mmap/mmap.c: likewise * mmap/efi/mmap.c: likewise * kern/i386/coreboot/init.c (grub_machine_init): don't use grub_upper_mem * kern/i386/pc/init.c (grub_lower_mem): removed variable (grub_upper_mem): likewise (grub_machine_init): don't use grub_upper_mem, make grub_lower_mem local * loader/i386/bsd.c (grub_openbsd_boot): use grub_mmap_get_lower, grub_mmap_iterate and grub_mmap_get_upper (grub_netbsd_boot): use grub_mmap_get_lower and grub_mmap_get_upper
This commit is contained in:
		
							parent
							
								
									d558e6b5ac
								
							
						
					
					
						commit
						09d842b9c6
					
				
					 27 changed files with 1579 additions and 128 deletions
				
			
		|  | @ -82,16 +82,11 @@ grub_machine_init (void) | |||
| #if GRUB_CPU_SIZEOF_VOID_P == 4 | ||||
|     /* Restrict ourselves to 32-bit memory space.  */ | ||||
|     if (addr > GRUB_ULONG_MAX) | ||||
|       { | ||||
| 	grub_upper_mem = GRUB_ULONG_MAX; | ||||
| 	return 0; | ||||
|       } | ||||
|       return 0; | ||||
|     if (addr + size > GRUB_ULONG_MAX) | ||||
|       size = GRUB_ULONG_MAX - addr; | ||||
| #endif | ||||
| 
 | ||||
|     grub_upper_mem = grub_max (grub_upper_mem, addr + size); | ||||
| 
 | ||||
|     if (type != GRUB_MACHINE_MEMORY_AVAILABLE) | ||||
|       return 0; | ||||
| 
 | ||||
|  | @ -128,9 +123,6 @@ grub_machine_init (void) | |||
|   grub_machine_mmap_init (); | ||||
|   grub_machine_mmap_iterate (heap_init); | ||||
| 
 | ||||
|   /* This variable indicates size, not offset.  */ | ||||
|   grub_upper_mem -= GRUB_MEMORY_MACHINE_UPPER_START; | ||||
| 
 | ||||
|   grub_tsc_init (); | ||||
| } | ||||
| 
 | ||||
|  |  | |||
|  | @ -45,7 +45,6 @@ static int num_regions; | |||
| 
 | ||||
| grub_addr_t grub_os_area_addr; | ||||
| grub_size_t grub_os_area_size; | ||||
| grub_size_t grub_lower_mem, grub_upper_mem; | ||||
| 
 | ||||
| void  | ||||
| grub_arch_sync_caches (void *address __attribute__ ((unused)), | ||||
|  | @ -133,6 +132,7 @@ void | |||
| grub_machine_init (void) | ||||
| { | ||||
|   int i; | ||||
|   int grub_lower_mem; | ||||
|    | ||||
|   /* Initialize the console as early as possible.  */ | ||||
|   grub_console_init (); | ||||
|  | @ -197,7 +197,6 @@ grub_machine_init (void) | |||
|       { | ||||
| 	grub_size_t quarter = mem_regions[i].size >> 2; | ||||
| 
 | ||||
| 	grub_upper_mem = mem_regions[i].size; | ||||
| 	grub_os_area_addr = mem_regions[i].addr; | ||||
| 	grub_os_area_size = mem_regions[i].size - quarter; | ||||
| 	grub_mm_init_region ((void *) (grub_os_area_addr + grub_os_area_size), | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue