VAX: Fix for unaligned longword access to Qbus space from Matt Burke for issue #88

When the conversational boot is waiting for input it uses a BLBC instruction to read the DUART status register and test the RXR bit. This generates an unaligned longword read in Qbus I/O space (Yuk!). I realised that the code to read unaligned data in vax_mmu is broken. It attempts to read the aligned longwords that the data spans, but there was no code to convert the unaligned pa passed in to it's aligned form, thus the wrong bytes are returned and the BLBC never sees the RXR bit.
This commit is contained in:
Mark Pizzolato 2013-11-10 13:04:28 -08:00
parent 24b64b517b
commit f59d86d7c0

View file

@ -23,6 +23,7 @@
used in advertising or otherwise to promote the sale, use or other dealings used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from Robert M Supnik. in this Software without prior written authorization from Robert M Supnik.
09-Nov-13 MB Fixed reading/writing of unaligned data
24-Oct-12 MB Added support for KA620 virtual addressing 24-Oct-12 MB Added support for KA620 virtual addressing
21-Jul-08 RMS Removed inlining support 21-Jul-08 RMS Removed inlining support
28-May-08 RMS Inlined physical memory routines 28-May-08 RMS Inlined physical memory routines
@ -202,6 +203,8 @@ if (mapen && ((uint32)(off + lnt) > VA_PAGSIZE)) { /* cross page? */
} }
else pa1 = (pa + 4) & PAMASK; /* not cross page */ else pa1 = (pa + 4) & PAMASK; /* not cross page */
bo = pa & 3; bo = pa & 3;
pa = pa & ~3; /* convert to aligned */
pa1 = pa1 & ~3;
if (lnt >= L_LONG) { /* lw unaligned? */ if (lnt >= L_LONG) { /* lw unaligned? */
sc = bo << 3; sc = bo << 3;
wl = ReadL (pa); /* read both lw */ wl = ReadL (pa); /* read both lw */
@ -268,6 +271,8 @@ if (mapen && ((uint32)(off + lnt) > VA_PAGSIZE)) {
} }
else pa1 = (pa + 4) & PAMASK; else pa1 = (pa + 4) & PAMASK;
bo = pa & 3; bo = pa & 3;
pa = pa & ~3; /* convert to aligned */
pa1 = pa1 & ~3;
wl = ReadL (pa); wl = ReadL (pa);
if (lnt >= L_LONG) { if (lnt >= L_LONG) {
sc = bo << 3; sc = bo << 3;