Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site rochester.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!wjh12!harvard!seismo!rochester!bukys From: bukys@rochester.UUCP (Liudvikas Bukys) Newsgroups: net.unix-wizards Subject: obscure problem with 4.xBSD vaxuba/uba.c Message-ID: <3474@rochester.UUCP> Date: Thu, 15-Nov-84 19:47:20 EST Article-I.D.: rocheste.3474 Posted: Thu Nov 15 19:47:20 1984 Date-Received: Sat, 17-Nov-84 04:37:58 EST Distribution: net Organization: U. of Rochester, CS Dept. Lines: 41 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@rochester (arpa)