Changeset 3c56c94 in mainline


Ignore:
Timestamp:
2005-09-01T16:21:05Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2793442
Parents:
69bd642
Message:

Do not use the unmapped addresses of e820 kernel structures.
Use PA2KA() to access the e820 counter and memtable.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • arch/ia32/src/mm/memory_init.c

    r69bd642 r3c56c94  
    2929#include <arch/boot/memmap.h>
    3030#include <arch/mm/memory_init.h>
     31#include <arch/mm/page.h>
    3132#include <print.h>
    3233
     
    4041        __u8 i;
    4142       
    42         for (i=e820counter;i>0;i--) {
    43                 printf("E820 base: %Q size: %Q type: ", e820table[i-1].base_address, e820table[i-1].size);
    44                 switch (e820table[i-1].type) {
     43        /*
     44         * We must not work with the original addresses for they are not mapped anymore.
     45         */
     46        struct e820memmap_ *memtable = (struct e820memmap_ *) PA2KA(e820table);
     47        __u32 *counter_p = (__u32 *) PA2KA(&e820counter);
     48       
     49       
     50        for (i=*counter_p;i>0;i--) {
     51                printf("E820 base: %Q size: %Q type: ", memtable[i-1].base_address, memtable[i-1].size);
     52                switch (memtable[i-1].type) {
    4553                        case MEMMAP_MEMORY_AVAILABLE:
    4654                                printf("available memory\n");
Note: See TracChangeset for help on using the changeset viewer.