Kernel binman: fix off-by-one error, allowing COMMONMEM to use the last
authorWill Sowerbutts <will@sowerbutts.com>
Wed, 28 Dec 2016 17:26:06 +0000 (17:26 +0000)
committerWill Sowerbutts <will@sowerbutts.com>
Wed, 28 Dec 2016 17:33:37 +0000 (17:33 +0000)
byte of RAM (at address 0xFFFF).

Kernel/tools/binman.c

index 72de486..25dc4a1 100644 (file)
@@ -109,9 +109,9 @@ int main(int argc, char *argv[])
        ProcessMap(map);
        fclose(map);
 
-       if (s__COMMONMEM > 0xFFFF || s__COMMONMEM + l__COMMONMEM > 0xFFFF) {
+       if (s__COMMONMEM > 0xFFFF || s__COMMONMEM + l__COMMONMEM > 0x10000) {
                fprintf(stderr, "Move common down by at least %d bytes\n",
-                       s__COMMONMEM + l__COMMONMEM - 0xFFFF);
+                       s__COMMONMEM + l__COMMONMEM - 0x10000);
                exit(1);
        }