Ignore:
Timestamp:
Jun 23, 2017, 9:57:35 AM (7 years ago)
Author:
max@…
Message:

Update. We need to use two separate arrays: one for the heap and one for
the kimg. The size of a heap entry is configurable, but that of the kimg
is not (fixed by mcmodel).

As a result, we also need to use two XPTRs: XPTR_HEAP and XPTR_KIMG. For
now we only declare XPTR_KIMG, and are not using it yet.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/hal/x86_64/hal_boot.h

    r42 r44  
    130130#define NPDPG   (PAGE_SIZE / sizeof (pt_entry_t))
    131131
    132 #define CLUSTERS_BASE_VA        0xffff800000000000
     132/* -------------------------------------------------------------------------- */
    133133
    134134/*
    135  * These parameters are configurable.
     135 * There are two arrays: one for the heap, one for the kernel image. They are
     136 * separated by 64TB of VA, which is more than enough to avoid collision.
    136137 */
    137 #define CLUSTER_VA_SIZE 0x100000000 /* 4GB */
    138 #define CLUSTER_PA_SIZE 0x200000000 /* 8GB */
     138#define CLUSTERS_HEAP_BASE_VA   0xffff800000000000
     139#define CLUSTERS_KIMG_BASE_VA   0xffffc00000000000
    139140
    140 #define CLUSTER_MIN_VA(n)       (CLUSTERS_BASE_VA + n * CLUSTER_VA_SIZE)
    141 #define CLUSTER_MAX_VA(n)       (CLUSTER_MIN_VA(n) + CLUSTER_VA_SIZE)
     141/* These parameters are configurable. */
     142#define CLUSTER_HEAP_VA_SIZE    0x100000000 /* 4GB */
     143#define CLUSTER_HEAP_PA_SIZE    0x200000000 /* 8GB */
    142144
     145/* These parameters are *not* configurable. */
     146#define CLUSTER_KIMG_VA_SIZE    0x80000000  /* 2GB */
     147
     148/* Macros to get the heap/kimg ranges for a cluster */
     149#define CLUSTER_HEAP_MIN_VA(n) \
     150        (CLUSTERS_HEAP_BASE_VA + n * CLUSTER_HEAP_VA_SIZE)
     151#define CLUSTER_HEAP_MAX_VA(n) \
     152        (CLUSTER_HEAP_MIN_VA(n) + CLUSTER_HEAP_VA_SIZE)
     153#define CLUSTER_KIMG_MIN_VA(n) \
     154        (CLUSTERS_KIMG_BASE_VA + n * CLUSTER_KIMG_VA_SIZE)
     155#define CLUSTER_KIMG_MAX_VA(n) \
     156        (CLUSTER_KIMG_MIN_VA(n) + CLUSTER_KIMG_VA_SIZE)
     157
Note: See TracChangeset for help on using the changeset viewer.