diff options
author | jhb <jhb@FreeBSD.org> | 2006-10-05 15:30:51 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2006-10-05 15:30:51 +0000 |
commit | f576e0540b05ad6f5454b4ef0635061887b0df3e (patch) | |
tree | c0a980f70734e248e0f6b008785916e2cb8f8138 /sys/boot | |
parent | ef1fe41dc3c511a8d3f0b53277b4948bf75de62b (diff) | |
download | FreeBSD-src-f576e0540b05ad6f5454b4ef0635061887b0df3e.zip FreeBSD-src-f576e0540b05ad6f5454b4ef0635061887b0df3e.tar.gz |
- Fix a couple of improper uses of leal in the previous space saving
commits. For some reason I thought the scale factor was a shift count
rather than the multiplicand (that is, I thought leal (%eax,%edx,4) was
going to generate %eax + %edx << 4 rather than %eax + %edx * 4). What
I need is to multiply by 16 to convert a real-mode (seg, offset) tuple
into a flat address. However, the max multiplicand for scaled/index
addressing on i386 is 8, so go back to using a shl and an add.
- Convert two more inter-register mov instructions where we don't need to
preserve the source register to xchg instructions to keep our space
savings.
Tested by: Ian FREISLICH if at hetzner.co.za
MFC after: 1 week
Diffstat (limited to 'sys/boot')
-rw-r--r-- | sys/boot/i386/btx/btx/btx.S | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/boot/i386/btx/btx/btx.S b/sys/boot/i386/btx/btx/btx.S index c8955a5..ce99622 100644 --- a/sys/boot/i386/btx/btx/btx.S +++ b/sys/boot/i386/btx/btx/btx.S @@ -443,12 +443,12 @@ intrtn.1: leal 0x10(%esi),%ebx # Saved exception frame movb $0x4,%cl # Update seg regs rep # in INT_V86 movsl # args -intrtn.2: movl %edx,%esi # Segment registers +intrtn.2: xchgl %edx,%esi # Segment registers leal 0x28(%ebp),%edi # Set up seg movb $0x4,%cl # regs for rep # later movsl # pop - movl %ebx,%esi # Restore exception + xchgl %ebx,%esi # Restore exception movb $0x5,%cl # frame to rep # supervisor movsl # stack @@ -620,9 +620,10 @@ v86popf.1: movl (%ebx),%eax # Load flags */ int15_87: pushl %esi # Save pushl %edi # registers - movzwl 0x4(%ebp),%eax # Load user's SI movl 0x3C(%ebp),%edi # Load ES - leal (%eax,%edi,4),%edi # EDI = (ES << 4) + SI + movzwl 0x4(%ebp),%eax # Load user's SI + shll $0x4,%edi # EDI = (ES << 4) + + addl %eax,%edi # SI movl 0x11(%edi),%eax # Read base of movb 0x17(%edi),%al # GDT entry ror $8,%eax # for source @@ -898,7 +899,8 @@ dump.2: testb $DMP_MEM,%ch # Dump memory? dump.3: lodsl # Set offset xchgl %eax,%edx # Save lodsl # Get segment - leal (%edx,%eax,4),%eax # * 0x10 + offset + shll $0x4,%eax # * 0x10 + addl %edx,%eax # + offset xchgl %eax,%esi # Set pointer dump.4: movb $2,%dl # Num lines dump.4a: movb $0x10,%cl # Bytes to dump |