diff options
author | Michael Brown <mcb30@ipxe.org> | 2011-03-15 10:47:22 -0600 |
---|---|---|
committer | Aurelien Jarno <aurelien@aurel32.net> | 2011-04-01 22:35:25 +0200 |
commit | 366c9332450caace5843c17806ba4879bf2d005c (patch) | |
tree | 1f852cf550f22eff813c385597299fc1b3903146 /cmd.c | |
parent | e318a60b94b152c1e80125861a8917ae177d845e (diff) |
pcnet: Fix sign extension: make ipxe work with >2G RAM
The problem is with definitions in hw/pcnet.c such as:
#define CSR_CRDA(S) ((S)->csr[28] | ((S)->csr[29] << 16))
"(S)->csr[29]" is a uint16_t, but "(S)->csr[29] << 16" gets promoted to
int, so the overall CSR_CRDA(s) is a (signed) int rather than a uint32_t.
This then gets assigned to a uint64_t using
target_phys_addr_t crda = CSR_CRDA(s);
so when (S)->csr[29] has the high bit set, we end up with
crda=0xffffffffxxxxxxxx.
From: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'cmd.c')
0 files changed, 0 insertions, 0 deletions