obscure problem with 4.xBSD vaxuba/uba.c
Liudvikas Bukys
bukys at rochester.UUCP
Fri Nov 16 10:47:20 AEST 1984
This is probably not a real problem with any machines out there,
but I thought I'd point it out as a gift to posterity.
The ubamem() routine reserves pieces of the unibus address space for
devices with on-board memory (like 3Com Ethernet controllers). One of
the things it does is twiddle the UBA configuration register to disable
some map registers...
#if VAX780
/*
* On a 780, set up the map register disable
* field in the configuration register. Beware
* of callers that request memory ``out of order''.
*/
if (cpu == VAX_780) {
int cr = uh->uh_uba->uba_cr;
i = (addr + npg * 512 + 8191) / 8192;
if (i > (cr >> 26))
uh->uh_uba->uba_cr |= i << 26;
}
#endif
I believe this will disable a few too many map registers.
Consider two calls to ubamem, one which ends up with i==3,
another with i==4. The result will be 7 banks of registers
disabled, not 4, which is what I think the result should be.
In my opinion, the correct code in that assignment statement
would be
uh->uh_uba->uba_cr = (i<<26)|(cr&0x3ffffff);
/* (notice the absence of '|=') */
I can't vouch for this, as I don't have *any* devices like this,
and it probably doesn't matter unless you stuff your unibus full
of them anyway. I hope it helps some poor future hacker grepping
through unix-wizards archives, though.
Liudvikas Bukys
rochester!bukys (uucp) via allegra, decvax, seismo
bukys at rochester (arpa)
More information about the Comp.unix.wizards
mailing list