Ignore:
Timestamp:
Jun 30, 2017, 11:26:32 AM (5 years ago)
Author:
max@…
Message:

compute the offset for bootinfo

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/hal/x86_64/core/hal_init.c

    r99 r114  
    109109static void init_bootinfo(boot_info_t *info)
    110110{
     111        extern paddr_t pa_avail;
     112        extern vaddr_t va_avail;
     113
    111114        extern uint64_t __kernel_data_start;
    112115        extern uint64_t __kernel_end;
     116
     117        size_t pa_offset = pa_avail - 0;
     118        size_t va_offset = va_avail - CLUSTER_MIN_VA(0);
    113119
    114120        memset(info, 0, sizeof(boot_info_t));
     
    135141        /* dev_ XXX */
    136142
    137         info->pages_offset = 0;
    138         info->pages_nr = 0;
     143        info->pages_offset = MAX(pa_offset, va_offset);
     144        info->pages_nr = 0; /* XXX */
    139145
    140146        info->kernel_code_start = (intptr_t)(KERNTEXTOFF - KERNBASE);
Note: See TracChangeset for help on using the changeset viewer.