From 2cdf880b855c7cd4fedf325a3ecdb578b36c2f5b Mon Sep 17 00:00:00 2001 From: Bart Oldeman Date: Sun, 23 May 2004 14:45:27 +0000 Subject: [PATCH] From Lucho: moved fmemcmp's into a checkHMA function. git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@940 6ac86273-5f31-0410-b378-82cca8765d1b --- kernel/inithma.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/kernel/inithma.c b/kernel/inithma.c index 34b3993..58e8057 100644 --- a/kernel/inithma.c +++ b/kernel/inithma.c @@ -118,12 +118,17 @@ VOID hdump(BYTE FAR * p) if so, it simply leaves it on */ +STATIC int checkHMA(void) +{ + return fmemcmp(MK_FP(0, 0), MK_FP(0xffff, 0x0010), 128); +} + int EnableHMA(VOID) { _EnableA20(); - if (fmemcmp(MK_FP(0x0000, 0x0000), MK_FP(0xffff, 0x0010), 128) == 0) + if (!checkHMA()) { printf("HMA can't be enabled\n"); return FALSE; @@ -132,14 +137,14 @@ int EnableHMA(VOID) _DisableA20(); #ifdef DEBUG - if (fmemcmp(MK_FP(0x0000, 0x0000), MK_FP(0xffff, 0x0010), 128) != 0) + if (!checkHMA()) { printf("HMA can't be disabled - no problem for us\n"); } #endif _EnableA20(); - if (fmemcmp(MK_FP(0x0000, 0x0000), MK_FP(0xffff, 0x0010), 128) == 0) + if (!checkHMA()) { printf("HMA can't be enabled second time\n"); return FALSE;