Rev 195 | Rev 243 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 195 | Rev 233 | ||
---|---|---|---|
Line 26... | Line 26... | ||
26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | */ |
27 | */ |
28 | 28 | ||
29 | #include <arch/boot/memmap.h> |
29 | #include <arch/boot/memmap.h> |
30 | #include <arch/mm/memory_init.h> |
30 | #include <arch/mm/memory_init.h> |
- | 31 | #include <arch/mm/page.h> |
|
31 | #include <print.h> |
32 | #include <print.h> |
32 | 33 | ||
33 | size_t get_memory_size(void) |
34 | size_t get_memory_size(void) |
34 | { |
35 | { |
35 | return e801memorysize*1024; |
36 | return e801memorysize*1024; |
Line 37... | Line 38... | ||
37 | 38 | ||
38 | void memory_print_map(void) |
39 | void memory_print_map(void) |
39 | { |
40 | { |
40 | __u8 i; |
41 | __u8 i; |
41 | 42 | ||
- | 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 | ||
42 | for (i=e820counter;i>0;i--) { |
50 | for (i=*counter_p;i>0;i--) { |
43 | printf("E820 base: %Q size: %Q type: ", e820table[i-1].base_address, e820table[i-1].size); |
51 | printf("E820 base: %Q size: %Q type: ", memtable[i-1].base_address, memtable[i-1].size); |
44 | switch (e820table[i-1].type) { |
52 | switch (memtable[i-1].type) { |
45 | case MEMMAP_MEMORY_AVAILABLE: |
53 | case MEMMAP_MEMORY_AVAILABLE: |
46 | printf("available memory\n"); |
54 | printf("available memory\n"); |
47 | break; |
55 | break; |
48 | case MEMMAP_MEMORY_RESERVED: |
56 | case MEMMAP_MEMORY_RESERVED: |
49 | printf("reserved memory\n"); |
57 | printf("reserved memory\n"); |