Changeset 93165be in mainline for arch/amd64/src/mm/page.c


Ignore:
Timestamp:
2006-03-16T23:54:05Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5fceec7
Parents:
ff14c520
Message:

Add support for more then 2GB of address space for AMD64.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • arch/amd64/src/mm/page.c

    rff14c520 r93165be  
    4040#include <print.h>
    4141#include <panic.h>
     42#include <align.h>
    4243
    4344/* Definitions for identity page mapper */
     
    7172        SET_FRAME_FLAGS_ARCH(ptl3, PTL3_INDEX_ARCH(page), PAGE_WRITE | PAGE_EXEC); \
    7273    }
    73 
    7474void page_arch_init(void)
    7575{
    7676        __address cur;
    77         int flags;
     77        int i;
     78        int identity_flags = PAGE_CACHEABLE | PAGE_EXEC | PAGE_GLOBAL;
    7879
    7980        if (config.cpu_active == 1) {
     
    8485                 */
    8586                for (cur = 0; cur < last_frame; cur += FRAME_SIZE) {
    86                         flags = PAGE_CACHEABLE | PAGE_EXEC;
    87                         if ((PA2KA(cur) >= config.base) && (PA2KA(cur) < config.base + config.kernel_size))
    88                                 flags |= PAGE_GLOBAL;
    89                         page_mapping_insert(AS_KERNEL, PA2KA(cur), cur, flags);
     87                        /* Standard identity mapping */
     88                        page_mapping_insert(AS_KERNEL, PA2KA_IDENT(cur), cur, identity_flags);
    9089                }
     90                /* Upper kernel mapping
     91                 * - from zero to top of kernel (include bottom addresses
     92                 *   because some are needed for init )
     93                 */
     94                for (cur = PA2KA_CODE(0); cur < config.base+config.kernel_size; cur += FRAME_SIZE) {
     95                        page_mapping_insert(AS_KERNEL, cur, KA2PA(cur), identity_flags);
     96                }
     97                for (i=0; i < init.cnt; i++) {
     98                        for (cur=init.tasks[i].addr;cur < init.tasks[i].size; cur += FRAME_SIZE) {
     99                                page_mapping_insert(AS_KERNEL, PA2KA_CODE(KA2PA(cur)), KA2PA(cur), identity_flags);
     100                        }
     101                }
     102
    91103                exc_register(14, "page_fault", (iroutine)page_fault);
    92104                write_cr3((__address) AS_KERNEL->page_table);
Note: See TracChangeset for help on using the changeset viewer.