Changeset bbe4828 in mainline
- Timestamp:
- 2011-07-05T19:41:46Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3714e79
- Parents:
- 547c37a
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/arch/ia64/include/types.h
r547c37a rbbe4828 30 30 #define BOOT_ia64_TYPES_H_ 31 31 32 #include <arch/common.h> 33 32 34 #define TASKMAP_MAX_RECORDS 32 33 35 #define BOOTINFO_TASK_NAME_BUFLEN 32 34 #define MEMMAP_ITEMS 128 36 #define MEMMAP_ITEMS 128 35 37 36 38 typedef uint64_t size_t; … … 53 55 unsigned long base; 54 56 unsigned long size; 55 } efi_memmap_item_t;57 } memmap_item_t; 56 58 57 59 typedef struct { 58 60 binit_t taskmap; 59 61 60 efi_memmap_item_t memmap[MEMMAP_ITEMS];62 memmap_item_t memmap[MEMMAP_ITEMS]; 61 63 unsigned int memmap_items; 62 64 … … 65 67 unsigned long freq_scale; 66 68 unsigned int wakeup_intno; 67 int hello_configured;68 69 } bootinfo_t; 69 70 71 /** This is a minimal ELILO-compatible boot parameter structure. */ 72 typedef struct { 73 uint64_t cmd_line; 74 uint64_t efi_system_table; 75 uint64_t efi_memmap; 76 uint64_t efi_memmap_sz; 77 uint64_t efi_memdesc_sz; 78 } boot_param_t; 79 70 80 #endif -
boot/arch/ia64/src/boot.S
r547c37a rbbe4828 37 37 38 38 # 39 # Save the boot parameter structure address passed from the 40 # ELILO-compatible EFI loader. 41 # 42 movl r8 = bootpar ;; 43 st8 [r8] = r28 44 45 # 39 46 # Initialize the register stack to some sane value. 40 47 # … … 62 69 .bss 63 70 71 .global bootpar 72 bootpar: 73 .quad 0 74 64 75 .align STACK_SIZE 65 76 initial_stack: -
boot/arch/ia64/src/main.c
r547c37a rbbe4828 30 30 31 31 #include <arch/main.h> 32 #include <arch/types.h> 32 33 #include <arch/arch.h> 33 34 #include <arch/asm.h> 34 35 #include <arch/_components.h> 36 #include <genarch/efi.h> 35 37 #include <halt.h> 36 38 #include <printf.h> … … 51 53 #define DEFAULT_SYS_FREQ 100000000ULL /* 100MHz */ 52 54 53 #define EFI_MEMMAP_FREE_MEM 0 54 #define EFI_MEMMAP_IO 1 55 #define EFI_MEMMAP_IO_PORTS 2 55 #define MEMMAP_FREE_MEM 0 56 #define MEMMAP_IO 1 57 #define MEMMAP_IO_PORTS 2 58 59 extern boot_param_t *bootpar; 56 60 57 61 static bootinfo_t bootinfo; 62 63 static void read_efi_memmap(void) 64 { 65 memmap_item_t *memmap = bootinfo.memmap; 66 size_t items = 0; 67 68 if (!bootpar) { 69 /* Fake-up a memory map for simulators. */ 70 memmap[items].base = DEFAULT_MEMORY_BASE; 71 memmap[items].size = DEFAULT_MEMORY_SIZE; 72 memmap[items].type = MEMMAP_FREE_MEM; 73 items++; 74 75 memmap[items].base = DEFAULT_LEGACY_IO_BASE; 76 memmap[items].size = DEFAULT_LEGACY_IO_SIZE; 77 memmap[items].type = MEMMAP_IO_PORTS; 78 items++; 79 } else { 80 char *cur, *mm_base = (char *) bootpar->efi_memmap; 81 size_t mm_size = bootpar->efi_memmap_sz; 82 size_t md_size = bootpar->efi_memdesc_sz; 83 84 /* 85 * Walk the EFI memory map using the V1 memory descriptor 86 * format. The actual memory descriptor can use newer format, 87 * but it must always be backwards compatible with the V1 88 * format. 89 */ 90 for (cur = mm_base; 91 (cur < mm_base + (mm_size - md_size)) && 92 (items < MEMMAP_ITEMS); 93 cur += md_size) { 94 efi_v1_memdesc_t *md = (efi_v1_memdesc_t *) cur; 95 96 switch ((efi_memory_type_t) md->type) { 97 case EFI_CONVENTIONAL_MEMORY: 98 memmap[items].type = MEMMAP_FREE_MEM; 99 break; 100 case EFI_MEMORY_MAPPED_IO: 101 memmap[items].type = MEMMAP_IO; 102 break; 103 case EFI_MEMORY_MAPPED_IO_PORT_SPACE: 104 memmap[items].type = MEMMAP_IO_PORTS; 105 break; 106 default: 107 continue; 108 } 109 110 memmap[items].base = md->phys_start; 111 memmap[items].size = md->pages * EFI_PAGE_SIZE; 112 items++; 113 } 114 } 115 116 bootinfo.memmap_items = items; 117 } 118 119 static void read_sal_configuration(void) 120 { 121 if (!bootpar) { 122 /* Configure default values for simulators. */ 123 bootinfo.freq_scale = DEFAULT_FREQ_SCALE; 124 bootinfo.sys_freq = DEFAULT_SYS_FREQ; 125 } else { 126 /* TODO: read the real values from SAL */ 127 bootinfo.freq_scale = DEFAULT_FREQ_SCALE; 128 bootinfo.sys_freq = DEFAULT_SYS_FREQ; 129 } 130 } 58 131 59 132 void bootstrap(void) … … 113 186 114 187 printf(".\n"); 115 116 if (!bootinfo.hello_configured) { /* XXX */117 /*118 * Load configuration defaults for simulators.119 */120 bootinfo.memmap_items = 0;121 122 bootinfo.memmap[bootinfo.memmap_items].base =123 DEFAULT_MEMORY_BASE;124 bootinfo.memmap[bootinfo.memmap_items].size =125 DEFAULT_MEMORY_SIZE;126 bootinfo.memmap[bootinfo.memmap_items].type =127 EFI_MEMMAP_FREE_MEM;128 bootinfo.memmap_items++;129 188 130 bootinfo.memmap[bootinfo.memmap_items].base = 131 DEFAULT_LEGACY_IO_BASE; 132 bootinfo.memmap[bootinfo.memmap_items].size = 133 DEFAULT_LEGACY_IO_SIZE; 134 bootinfo.memmap[bootinfo.memmap_items].type = 135 EFI_MEMMAP_IO_PORTS; 136 bootinfo.memmap_items++; 137 138 bootinfo.freq_scale = DEFAULT_FREQ_SCALE; 139 bootinfo.sys_freq = DEFAULT_SYS_FREQ; 140 } 141 189 read_efi_memmap(); 190 read_sal_configuration(); 142 191 143 192 printf("Booting the kernel ...\n"); -
kernel/arch/ia64/include/bootinfo.h
r547c37a rbbe4828 34 34 #define MEMMAP_ITEMS 128 35 35 36 #define EFI_MEMMAP_FREE_MEM 036 #define MEMMAP_FREE_MEM 0 37 37 38 38 /** Size of buffer for storing task name in binit_task_t. */ … … 54 54 unsigned long base; 55 55 unsigned long size; 56 } efi_memmap_item_t;56 } memmap_item_t; 57 57 58 58 typedef struct { 59 59 binit_t taskmap; 60 60 61 efi_memmap_item_t memmap[MEMMAP_ITEMS];61 memmap_item_t memmap[MEMMAP_ITEMS]; 62 62 unsigned int memmap_items; 63 63 … … 66 66 unsigned long freq_scale; 67 67 unsigned int wakeup_intno; 68 int hello_configured;69 68 } bootinfo_t; 70 69 -
kernel/arch/ia64/src/mm/frame.c
r547c37a rbbe4828 58 58 unsigned int i; 59 59 for (i = 0; i < bootinfo->memmap_items; i++) { 60 if (bootinfo->memmap[i].type == EFI_MEMMAP_FREE_MEM) {60 if (bootinfo->memmap[i].type == MEMMAP_FREE_MEM) { 61 61 uint64_t base = bootinfo->memmap[i].base; 62 62 uint64_t size = bootinfo->memmap[i].size;
Note:
See TracChangeset
for help on using the changeset viewer.