diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-31 15:51:37 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-31 15:51:37 -0700 |
commit | 8ddf83fed6c283dd941ca76ae715eb268ee8c04e (patch) | |
tree | 309628fccc4ec213afd8ebd28181703050bb046a /arch/i386/boot/edd.c | |
parent | 0d6caa1795090bd22ede96b84daa4600b63eee37 (diff) | |
parent | ff659d13ed91dd0b237064aba91a5259f827aeb3 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hpa/linux-2.6-x86setup
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hpa/linux-2.6-x86setup:
[x86 setup] EDD: Fix the computation of the MBR sector buffer
[x86 setup] Newline after setup signature failure message
x86 boot code comments typos
Diffstat (limited to 'arch/i386/boot/edd.c')
-rw-r--r-- | arch/i386/boot/edd.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/i386/boot/edd.c b/arch/i386/boot/edd.c index 25a282494f4..77d92daf792 100644 --- a/arch/i386/boot/edd.c +++ b/arch/i386/boot/edd.c @@ -72,17 +72,18 @@ static u32 read_mbr_sig(u8 devno, struct edd_info *ei) u32 mbrsig; u32 buf_base, mbr_base; extern char _end[]; - static char mbr_buf[1024]; sector_size = ei->params.bytes_per_sector; if (!sector_size) sector_size = 512; /* Best available guess */ + /* Produce a naturally aligned buffer on the heap */ buf_base = (ds() << 4) + (u32)&_end; mbr_base = (buf_base+sector_size-1) & ~(sector_size-1); - mbrbuf_ptr = mbr_buf + (mbr_base-buf_base); + mbrbuf_ptr = _end + (mbr_base-buf_base); mbrbuf_end = mbrbuf_ptr + sector_size; + /* Make sure we actually have space on the heap... */ if (!(boot_params.hdr.loadflags & CAN_USE_HEAP)) return 0; if (mbrbuf_end > (char *)(size_t)boot_params.hdr.heap_end_ptr) |