From c470b77c7fddb6c44f846646a032ed24e88f3881 Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Sat, 29 Oct 2016 11:40:52 +0200 Subject: [PATCH] boot/libi386: Use SMAP_TYPE_MEMORY constant. --- sys/boot/pc32/libi386/biosmem.c | 6 ++++-- sys/boot/pc32/libi386/biossmap.c | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/boot/pc32/libi386/biosmem.c b/sys/boot/pc32/libi386/biosmem.c index e80e7d5d69..178c044da2 100644 --- a/sys/boot/pc32/libi386/biosmem.c +++ b/sys/boot/pc32/libi386/biosmem.c @@ -29,6 +29,7 @@ * Obtain memory configuration information from the BIOS */ #include +#include #include #include "libi386.h" #include "btxv86.h" @@ -77,12 +78,13 @@ bios_getmem(void) if ((v86.efl & PSL_C) || (v86.eax != SMAPSIG)) break; /* look for a low-memory segment that's large enough */ - if ((smap.type == 1) && (smap.base == 0) && (smap.length >= (512 * 1024))) { + if ((smap.type == SMAP_TYPE_MEMORY) && (smap.base == 0) && + (smap.length >= (512 * 1024))) { bios_basemem = smap.length; bios_howmem = 1; } /* look for the first segment in 'extended' memory */ - if ((smap.type == 1) && (smap.base == 0x100000)) { + if ((smap.type == SMAP_TYPE_MEMORY) && (smap.base == 0x100000)) { bios_extmem = smap.length; } } while (v86.ebx != 0); diff --git a/sys/boot/pc32/libi386/biossmap.c b/sys/boot/pc32/libi386/biossmap.c index 99e6878a2c..20ba7af79d 100644 --- a/sys/boot/pc32/libi386/biossmap.c +++ b/sys/boot/pc32/libi386/biossmap.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include "bootstrap.h" #include "libi386.h" @@ -97,7 +98,7 @@ bios_getsmap(void) * * This wastes a little memory. */ - if (smap.type == 1 && + if (smap.type == SMAP_TYPE_MEMORY && smap.base + smap.length > heapbase && smap.base < memtop) { if (smap.base <= heapbase) { -- 2.11.4.GIT