diff --git a/hdr/mcb.h b/hdr/mcb.h index 0531b4c..6ff077c 100644 --- a/hdr/mcb.h +++ b/hdr/mcb.h @@ -45,6 +45,8 @@ static BYTE *mcb_hRcsId = #define FIRST_FIT_U 0x80 #define BEST_FIT_U 0x81 #define LAST_FIT_U 0x82 +#define FIT_U_MASK 0xc0 +#define FIT_MASK 0x3f #define MCB_NORMAL 0x4d #define MCB_LAST 0x5a diff --git a/kernel/inthndlr.c b/kernel/inthndlr.c index f4233ed..0a7f815 100644 --- a/kernel/inthndlr.c +++ b/kernel/inthndlr.c @@ -1210,25 +1210,10 @@ dispatch: break; case 0x01: - { - switch (lr.BL) - { - case LAST_FIT: - case LAST_FIT_U: - case LAST_FIT_UO: - case BEST_FIT: - case BEST_FIT_U: - case BEST_FIT_UO: - case FIRST_FIT: - case FIRST_FIT_U: - case FIRST_FIT_UO: - mem_access_mode = lr.BL; - break; - - default: - goto error_invalid; - } - } + if ((lr.BL & FIT_U_MASK) > FIRST_FIT_U || /* 0xc0, 0x80 */ + (lr.BL & FIT_MASK) > LAST_FIT) /* 0x3f, 0x02 */ + goto error_invalid; + mem_access_mode = lr.BL; break; case 0x02: