Date: Thu, 14 Mar 2002 17:47:36 -0800 (PST) From: Matthew Dillon <dillon@apollo.backplane.com> To: Mike Silbersack <silby@silby.com> Cc: Terry Lambert <tlambert2@mindspring.com>, "Clark C . Evans" <cce@clarkevans.com>, <freebsd-hackers@FreeBSD.ORG> Subject: Re: panic: pmap_enter Message-ID: <200203150147.g2F1laf50765@apollo.backplane.com> References: <20020314070732.H23489-100000@patrocles.silby.com>
next in thread | previous in thread | raw e-mail | index | archive | help
:On Tue, 12 Mar 2002, Terry Lambert wrote: : :> #define blkmap(fs, map, loc) \ :> (((map)[(loc) / NBBY] >> ((loc) % NBBY)) & (0xff >> (NBBY - (fs)->fs_frag))) :> :> looks a little suspect, doesn't it? "& 0" for 8 is probably :> correct, but "& 1" for 4 and "& 2" for 2 and "& 4" for 1 is :> probably not right... maybe: :> :> #define blkmap(fs, map, loc) \ :> (((map)[(loc) / NBBY] >> ((loc) % NBBY)) & 0xff & ((0xff >> (NBBY - :> (fs)->fs_frag))^0xff)) :> :> Would be more right? After all, it's the high bits of the low :> bits you want to save, not the low bits of the low bits... :> :> -- Terry : :FWIW, I didn't mean to ignore this message, I was going to look it over :carefully before commenting. However, Sid Meier told me that I needed to :spend some time taking over the world, so I was unable to. : :If anyone familiar with FFS wants to check it out, please be my guest, :otherwise I'll try to get to it soon. : :Mike "Silby" Silbersack That doesn't look like '& 0' for 8 to me. NBBY is 8, fs_frag of 8, results in 0xFF >> 0 which is 0xFF, not 0. The original code looks correct. Try this: -Matt Matthew Dillon <dillon@backplane.com> /* * BLKMAP.C * * #define blkmap(fs, map, loc) \ (((map)[(loc) / NBBY] >> ((loc) % NBBY)) & (0xff >> (NBBY - (fs)->fs_frag))) * * bno = block number (in fragment-sized blocks) * frag = fragment ratio N:1 * */ #include <stdio.h> #define NBBY 8 int main(int ac, char **av) { int bno; for (bno = 0; bno < 32; ++bno) { int frag; if ((bno & 15) == 0) printf("BLOCK\t8:1\t\t\t4:1\t\t\t2:1\t\t\t1:1\n"); printf("%5d", bno); for (frag = 8; frag >= 1; frag >>= 1) { printf("\t([%d] >> %d) & 0x%02x", bno / NBBY, bno % NBBY, 0xFF >> (NBBY - frag) ); } printf("\n"); } return(0); } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200203150147.g2F1laf50765>