diff options
-rw-r--r-- | i386/i386/vm_param.h | 27 | ||||
-rw-r--r-- | i386/i386at/biosmem.c | 7 |
2 files changed, 22 insertions, 12 deletions
diff --git a/i386/i386/vm_param.h b/i386/i386/vm_param.h index 19b5d9c1..056aa52e 100644 --- a/i386/i386/vm_param.h +++ b/i386/i386/vm_param.h @@ -178,14 +178,23 @@ */ #define VM_PAGE_SEG_DMA 0 -#ifdef __LP64__ -#define VM_PAGE_SEG_DMA32 1 -#define VM_PAGE_SEG_DIRECTMAP 2 -#define VM_PAGE_SEG_HIGHMEM 3 -#else /* __LP64__ */ -#define VM_PAGE_SEG_DMA32 1 /* Alias for the DIRECTMAP segment */ -#define VM_PAGE_SEG_DIRECTMAP 1 -#define VM_PAGE_SEG_HIGHMEM 2 -#endif /* __LP64__ */ +#if defined(VM_PAGE_DMA32_LIMIT) && (VM_PAGE_DMA32_LIMIT != VM_PAGE_DIRECTMAP_LIMIT) + +#if VM_PAGE_DMA32_LIMIT < VM_PAGE_DIRECTMAP_LIMIT +#define VM_PAGE_SEG_DMA32 (VM_PAGE_SEG_DMA+1) +#define VM_PAGE_SEG_DIRECTMAP (VM_PAGE_SEG_DMA32+1) +#define VM_PAGE_SEG_HIGHMEM (VM_PAGE_SEG_DIRECTMAP+1) +#else /* VM_PAGE_DMA32_LIMIT > VM_PAGE_DIRECTMAP_LIMIT */ +#define VM_PAGE_SEG_DIRECTMAP (VM_PAGE_SEG_DMA+1) +#define VM_PAGE_SEG_DMA32 (VM_PAGE_SEG_DIRECTMAP+1) +#define VM_PAGE_SEG_HIGHMEM (VM_PAGE_SEG_DMA32+1) +#endif + +#else + +#define VM_PAGE_SEG_DIRECTMAP (VM_PAGE_SEG_DMA+1) +#define VM_PAGE_SEG_DMA32 VM_PAGE_SEG_DIRECTMAP /* Alias for the DIRECTMAP segment */ +#define VM_PAGE_SEG_HIGHMEM (VM_PAGE_SEG_DIRECTMAP+1) +#endif #endif /* _I386_KERNEL_I386_VM_PARAM_ */ diff --git a/i386/i386at/biosmem.c b/i386/i386at/biosmem.c index 6d0a03ae..03736af3 100644 --- a/i386/i386at/biosmem.c +++ b/i386/i386at/biosmem.c @@ -840,10 +840,11 @@ biosmem_directmap_end(void) { if (biosmem_segment_size(VM_PAGE_SEG_DIRECTMAP) != 0) return biosmem_segment_end(VM_PAGE_SEG_DIRECTMAP); - else if (biosmem_segment_size(VM_PAGE_SEG_DMA32) != 0) +#if defined(VM_PAGE_DMA32_LIMIT) && (VM_PAGE_DMA32_LIMIT < VM_PAGE_DIRECTMAP_LIMIT) + if (biosmem_segment_size(VM_PAGE_SEG_DMA32) != 0) return biosmem_segment_end(VM_PAGE_SEG_DMA32); - else - return biosmem_segment_end(VM_PAGE_SEG_DMA); +#endif + return biosmem_segment_end(VM_PAGE_SEG_DMA); } static const char * __init |