]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
x86, setup: When probing memory with e801, use ax/bx as a pair
authorH. Peter Anvin <hpa@linux.intel.com>
Mon, 25 Apr 2011 21:52:37 +0000 (14:52 -0700)
committerH. Peter Anvin <hpa@linux.intel.com>
Mon, 25 Apr 2011 21:52:37 +0000 (14:52 -0700)
When we use BIOS function e801 to probe memory, we should use ax/bx
(or cx/dx) as a pair, not mix and match.  This was a typo during the
translation from assembly code, and breaks at least one set of
machines in the field (which return cx = dx = 0).

Reported-and-tested-by: Chris Samuel <chris@csamuel.org>
Fix-proposed-by: Thomas Meyer <thomas@m3y3r.de>
Link: http://lkml.kernel.org/r/1303566747.12067.10.camel@localhost.localdomain
arch/x86/boot/memory.c

index cae3feb1035e3da73826b518de4d47c15ad4e58d..db75d07c3645c0375090596ae29d1085f0f8a38a 100644 (file)
@@ -91,7 +91,7 @@ static int detect_memory_e801(void)
        if (oreg.ax > 15*1024) {
                return -1;      /* Bogus! */
        } else if (oreg.ax == 15*1024) {
-               boot_params.alt_mem_k = (oreg.dx << 6) + oreg.ax;
+               boot_params.alt_mem_k = (oreg.bx << 6) + oreg.ax;
        } else {
                /*
                 * This ignores memory above 16MB if we have a memory