Skip to content
Browse files

Remove the STATIC_VMEM support left over from the Xen backend.

  • Loading branch information...
1 parent 245dd84 commit 498e9590d0e66bcdc340ac3d02c48e2f34d4d226 @pgj committed
View
17 packages/mirage-platform/runtime/ocaml/major_gc.c
@@ -33,10 +33,6 @@
#include "roots.h"
#include "weak.h"
-#ifdef USE_STATIC_VMEM
-#include <mini-os/lib.h>
-#endif
-
uintnat caml_percent_free;
uintnat caml_major_heap_increment;
CAMLexport char *caml_heap_start;
@@ -391,7 +387,7 @@ intnat caml_major_collection_slice (intnat howmuch)
caml_stat_major_words += caml_allocated_words;
caml_allocated_words = 0;
caml_dependent_allocated = 0;
- caml_extra_heap_resources = 0.0;
+ caml_extra_heap_resources = 0;
return computed_work;
}
#else
@@ -525,18 +521,7 @@ static asize_t clip_heap_chunk_size (asize_t request)
request = Bsize_wsize (Heap_chunk_min);
}
-#ifdef USE_STATIC_VMEM
- /* For superpages, round up to the nearest 2MB chunk. The additional 2
- * 4KB pages account for the heap chunk (so that the caml_aligned_malloc
- * receives precisely a 2MB request and not a page more.
- */
-#define roundup(x,y) ((((x)+((y)-1))/(y))*(y))
- asize_t result;
- result = roundup(request + (Page_size*2), PAGE_SIZE << 9) - (Page_size*2);
- return result;
-#else
return ((request + Page_size - 1) >> Page_log) << Page_log;
-#endif
}
/* Make sure the request is >= caml_major_heap_increment, then call
View
14 packages/mirage-platform/runtime/ocaml/memory.c
@@ -73,22 +73,8 @@ static struct page_table caml_page_table;
#endif
#define Hash(v) (((v) * HASH_FACTOR) >> caml_page_table.shift)
-#ifdef USE_STATIC_VMEM
-extern unsigned long _mlstart, _mlend;
-static unsigned long mlstart = (unsigned long)&_mlstart;
-static unsigned long mlend = (unsigned long)&_mlend;
-#endif
-
int caml_page_table_lookup(void * addr)
{
-#ifdef USE_STATIC_VMEM
- if (addr >= (void *)MAJOR_HEAP_BASE)
- return In_heap;
- else if (addr >= (void *)MINOR_HEAP_BASE)
- return In_young;
- else if ((unsigned long)addr >= mlstart && (unsigned long)addr < mlend)
- return In_static_data;
-#endif
uintnat h, e;
h = Hash(Page(addr));
View
10 packages/mirage-platform/runtime/ocaml/misc.c
@@ -121,16 +121,6 @@ char *caml_aligned_malloc_for_minor (asize_t size, int modulo, void **block)
return (char *) (aligned_mem - modulo);
}
-#ifdef USE_STATIC_VMEM
-/* If we ever get a superpage mapping failure, then turn off this flag
- * and fall back to normal 4Kb pages. Note that Xen is required to be booted
- * with the "allowsuperpage" hypervisor option to permit this to work at all,
- * and so most Xen installations will fail on superpage mappings. It may
- * also affect suspend/resume.
- */
-static int use_superpages = 1;
-#endif
-
char *caml_aligned_malloc_for_major (asize_t size, int modulo, void **block)
{
char *raw_mem;

0 comments on commit 498e959

Please sign in to comment.
Something went wrong with that request. Please try again.