Changeset 4bf0926e in mainline for kernel/arch/amd64/include


Ignore:
Timestamp:
2016-09-01T22:14:30Z (9 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2c2d54a
Parents:
8b6aa39
Message:

amd64: resurrect optional support for the 'large' memory model ('kernel' memory model stays the default)

Location:
kernel/arch/amd64/include/arch/mm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/amd64/include/arch/mm/km.h

    r8b6aa39 r4bf0926e  
    3838#include <typedefs.h>
    3939
    40 #define KM_AMD64_IDENTITY_START         UINT64_C(0xffffffff80000000)
    41 #define KM_AMD64_IDENTITY_SIZE          UINT64_C(0x0000000080000000)
     40#ifdef MEMORY_MODEL_kernel
    4241
    43 #define KM_AMD64_NON_IDENTITY_START     UINT64_C(0xffff800000000000)
    44 #define KM_AMD64_NON_IDENTITY_SIZE      UINT64_C(0x00007fff80000000)
     42#define KM_AMD64_IDENTITY_START      UINT64_C(0xffffffff80000000)
     43#define KM_AMD64_IDENTITY_SIZE       UINT64_C(0x0000000080000000)
     44
     45#define KM_AMD64_NON_IDENTITY_START  UINT64_C(0xffff800000000000)
     46#define KM_AMD64_NON_IDENTITY_SIZE   UINT64_C(0x00007fff80000000)
     47
     48#endif /* MEMORY_MODEL_kernel */
     49
     50#ifdef MEMORY_MODEL_large
     51
     52#define KM_AMD64_IDENTITY_START      UINT64_C(0xffff800000000000)
     53#define KM_AMD64_IDENTITY_SIZE       UINT64_C(0x0000400000000000)
     54
     55#define KM_AMD64_NON_IDENTITY_START  UINT64_C(0xffffc00000000000)
     56#define KM_AMD64_NON_IDENTITY_SIZE   UINT64_C(0x0000400000000000)
     57
     58#endif /* MEMORY_MODEL_large */
    4559
    4660extern void km_identity_arch_init(void);
  • kernel/arch/amd64/include/arch/mm/page.h

    r8b6aa39 r4bf0926e  
    4242#define PAGE_SIZE   FRAME_SIZE
    4343
     44#ifdef MEMORY_MODEL_kernel
     45
    4446#ifndef __ASM__
    4547
     
    5355
    5456#endif /* __ASM__ */
     57
     58#endif /* MEMORY_MODEL_kernel */
     59
     60#ifdef MEMORY_MODEL_large
     61
     62#ifndef __ASM__
     63
     64#define KA2PA(x)  (((uintptr_t) (x)) - UINT64_C(0xffff800000000000))
     65#define PA2KA(x)  (((uintptr_t) (x)) + UINT64_C(0xffff800000000000))
     66
     67#else /* __ASM__ */
     68
     69#define KA2PA(x)  ((x) - 0xffff800000000000)
     70#define PA2KA(x)  ((x) + 0xffff800000000000)
     71
     72#endif /* __ASM__ */
     73
     74#endif /* MEMORY_MODEL_large */
    5575
    5676/* Number of entries in each level. */
Note: See TracChangeset for help on using the changeset viewer.