summaryrefslogtreecommitdiffstats
path: root/src/include/strings.h
diff options
context:
space:
mode:
authorMichael Brown2016-02-18 15:38:41 +0100
committerMichael Brown2016-02-18 16:12:51 +0100
commita3b4d6328c99c1c9bd731521e00bb8b495057931 (patch)
tree04e91621d78c47f37f5779121f113dcc2eb1157a /src/include/strings.h
parent[romprefix] Align PMM temporary decompression area to a page boundary (diff)
downloadipxe-a3b4d6328c99c1c9bd731521e00bb8b495057931.tar.gz
ipxe-a3b4d6328c99c1c9bd731521e00bb8b495057931.tar.xz
ipxe-a3b4d6328c99c1c9bd731521e00bb8b495057931.zip
[bios] Make uses of REAL_CODE() and PHYS_CODE() 64-bit clean
On a 64-bit CPU, any modification of a register by 32-bit or 16-bit code will destroy the invisible upper 32 bits of the corresponding 64-bit register. For example: a 32-bit "pushl %eax" followed by a "popl %eax" will zero the upper half of %rax. This differs from the treatment of upper halves of 32-bit registers by 16-bit code: a "pushw %ax" followed by a "popw %ax" will leave the upper 16 bits of %eax unmodified. Inline assembly generated using REAL_CODE() or PHYS_CODE() will therefore have to preserve the upper halves of all registers, to avoid clobbering registers that gcc expects to be preserved. Output operands from REAL_CODE() and PHYS_CODE() assembly may therefore contain undefined values in the upper 32 bits. Fix by using explicit variable widths (e.g. uint32_t) for non-discarded output operands, to ensure that undefined values in the upper 32 bits of 64-bit registers are ignored. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/strings.h')
0 files changed, 0 insertions, 0 deletions