fixes an assert() firing when starting X. thanks to the report by pikpik.
. NO_MEM was 0, which is actually an existing piece
of physical memory. it can't be allocated because it's reserved
for bios data (by the kernel), but it can be mapped in (e.g.
by X), causing sanity check disaster.
. NONCONTIGUOUS is also obsolete as all allocations are single-page
now, i.e. NONCONTIGUOUS is really the default and only mode.
assert(!(flags & PAF_CONTIG));
- if(known != MAP_NONE)
+ if(known != MAP_NONE) {
+ if(known == NO_MEM) {
+ printf("VM: odd mem for alloc_mem_in_list: 0x%lx\n",
+ known);
+ return NULL;
+ }
phys_count = known;
+ }
do {
struct memlist *ml;
rempages--;
} while(rempages > 0);
- {
- struct memlist *ml;
- for(ml = head; ml; ml = ml->next) {
- assert(ml->phys);
-#if NONCONTIGUOUS
- if(!(flags & PAF_CONTIG)) {
- if(ml->next)
- assert(ml->phys + ml->length != ml->next->phys);
- }
-#endif
- }
- }
-
return head;
}
-#define NO_MEM ((phys_clicks) 0) /* returned by alloc_mem() with mem is up */
-
/* Memory flags to pt_allocmap() and alloc_mem(). */
#define PAF_CLEAR 0x01 /* Clear physical memory. */
#define PAF_CONTIG 0x02 /* Physically contiguous. */
/* VM behaviour */
#define MEMPROTECT 0 /* Slab objects not mapped. Access with USE() */
#define JUNKFREE 0 /* Fill freed pages with junk */
-#define NONCONTIGUOUS 0 /* Make phys pages max. noncontiguous */
/* How noisy are we supposed to be? */
#define VERBOSE 0
#define WMF_VERIFY 0x08 /* Check pagetable contents. */
#define MAP_NONE 0xFFFFFFFE
+#define NO_MEM ((phys_clicks) MAP_NONE) /* returned by alloc_mem() with mem is up */