Changes in / [bee37cf:f7a55f9] in mainline


Ignore:
Files:
2 added
13 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • boot/arch/ia64/include/types.h

    rbee37cf rf7a55f9  
    3030#define BOOT_ia64_TYPES_H_
    3131
    32 #include <arch/common.h>
    33 
    3432#define TASKMAP_MAX_RECORDS             32
    3533#define BOOTINFO_TASK_NAME_BUFLEN       32
    36 #define MEMMAP_ITEMS                    128
     34#define MEMMAP_ITEMS                    128     
    3735
    3836typedef uint64_t size_t;
     
    5553        unsigned long base;
    5654        unsigned long size;
    57 } memmap_item_t;
     55} efi_memmap_item_t;
    5856
    5957typedef struct {
    6058        binit_t taskmap;
    6159
    62         memmap_item_t memmap[MEMMAP_ITEMS];
     60        efi_memmap_item_t memmap[MEMMAP_ITEMS];
    6361        unsigned int memmap_items;
    6462
     
    6765        unsigned long freq_scale;
    6866        unsigned int wakeup_intno;
     67        int hello_configured;
    6968} bootinfo_t;
    7069
    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 
    8070#endif
  • boot/arch/ia64/src/boot.S

    rbee37cf rf7a55f9  
    3737
    3838        #
    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         #
    4639        # Initialize the register stack to some sane value.
    4740        #
     
    6962.bss
    7063
    71 .global bootpar
    72 bootpar:
    73         .quad 0
    74 
    7564.align STACK_SIZE
    7665initial_stack:
  • boot/arch/ia64/src/main.c

    rbee37cf rf7a55f9  
    3030
    3131#include <arch/main.h>
    32 #include <arch/types.h>
    3332#include <arch/arch.h>
    3433#include <arch/asm.h>
    3534#include <arch/_components.h>
    36 #include <genarch/efi.h>
    3735#include <halt.h>
    3836#include <printf.h>
     
    5351#define DEFAULT_SYS_FREQ                100000000ULL            /* 100MHz */
    5452
    55 #define MEMMAP_FREE_MEM         0
    56 #define MEMMAP_IO               1
    57 #define MEMMAP_IO_PORTS         2
    58 
    59 extern boot_param_t *bootpar;
     53#define EFI_MEMMAP_FREE_MEM             0
     54#define EFI_MEMMAP_IO                   1
     55#define EFI_MEMMAP_IO_PORTS             2
    6056
    6157static 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 }
    13158
    13259void bootstrap(void)
     
    186113       
    187114        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++;
    188129
    189         read_efi_memmap();
    190         read_sal_configuration();
     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       
    191142       
    192143        printf("Booting the kernel ...\n");
  • kernel/arch/ia64/include/bootinfo.h

    rbee37cf rf7a55f9  
    3434#define MEMMAP_ITEMS 128
    3535
    36 #define MEMMAP_FREE_MEM 0
     36#define EFI_MEMMAP_FREE_MEM 0
    3737
    3838/** Size of buffer for storing task name in binit_task_t. */
     
    5454        unsigned long base;
    5555        unsigned long size;
    56 } memmap_item_t;
     56} efi_memmap_item_t;
    5757
    5858typedef struct {
    5959        binit_t taskmap;
    6060       
    61         memmap_item_t memmap[MEMMAP_ITEMS];
     61        efi_memmap_item_t memmap[MEMMAP_ITEMS];
    6262        unsigned int memmap_items;
    6363       
     
    6666        unsigned long freq_scale;
    6767        unsigned int wakeup_intno;
     68        int hello_configured;
    6869} bootinfo_t;
    6970
  • kernel/arch/ia64/src/ia64.c

    rbee37cf rf7a55f9  
    151151        /* Set platform name. */
    152152#ifdef MACHINE_ski
    153         platform = "ski";
     153        platform = "pc";
    154154#endif
    155155#ifdef MACHINE_i460GX
  • kernel/arch/ia64/src/mm/frame.c

    rbee37cf rf7a55f9  
    5858                unsigned int i;
    5959                for (i = 0; i < bootinfo->memmap_items; i++) {
    60                         if (bootinfo->memmap[i].type == MEMMAP_FREE_MEM) {
     60                        if (bootinfo->memmap[i].type == EFI_MEMMAP_FREE_MEM) {
    6161                                uint64_t base = bootinfo->memmap[i].base;
    6262                                uint64_t size = bootinfo->memmap[i].size;
Note: See TracChangeset for help on using the changeset viewer.