diff options
author | green <green@FreeBSD.org> | 2000-06-22 20:53:36 +0000 |
---|---|---|
committer | green <green@FreeBSD.org> | 2000-06-22 20:53:36 +0000 |
commit | 3c5c819ded19cbabe4a26d63a97e9e974bc12c48 (patch) | |
tree | d82dcdbc98b3474ae1b8b6df631ddc2b903bf48e /sys/i386 | |
parent | 5008f3663ffe019323d6f8b1017e942c2f688779 (diff) | |
download | FreeBSD-src-3c5c819ded19cbabe4a26d63a97e9e974bc12c48.zip FreeBSD-src-3c5c819ded19cbabe4a26d63a97e9e974bc12c48.tar.gz |
Rename macros to all-uppercase. Get rid of a comment that was ironic
(I goofed on the bitshifts myself long ago ;) and a bit redundant:
code should be clear enough that it seldom needs comments at all.
Diffstat (limited to 'sys/i386')
-rw-r--r-- | sys/i386/i386/k6_mem.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/sys/i386/i386/k6_mem.c b/sys/i386/i386/k6_mem.c index 2f44892..48af3dd 100644 --- a/sys/i386/i386/k6_mem.c +++ b/sys/i386/i386/k6_mem.c @@ -47,22 +47,16 @@ * There are two of these in the 64-bit UWCCR. */ -/* - * NOTE: I do _not_ comment my code unless it's truly necessary. Don't - * expect anything frivolous here, and do NOT touch my bit-shifts - * unless you want to break this. - */ - #define UWCCR 0xc0000085 -#define k6_reg_get(reg, addr, mask, wc, uc) do { \ +#define K6_REG_GET(reg, addr, mask, wc, uc) do { \ addr = (reg) & 0xfffe0000; \ mask = ((reg) & 0x1fffc) >> 2; \ wc = ((reg) & 0x2) >> 1; \ uc = (reg) & 0x1; \ } while (0) -#define k6_reg_make(addr, mask, wc, uc) \ +#define K6_REG_MAKE(addr, mask, wc, uc) \ ((addr) | ((mask) << 2) | ((wc) << 1) | uc) static void k6_mrinit(struct mem_range_softc *sc); @@ -93,7 +87,7 @@ k6_mrmake(struct mem_range_desc *desc, u_int32_t *mtrr) { wc = (desc->mr_flags & MDF_WRITECOMBINE) ? 1 : 0; uc = (desc->mr_flags & MDF_UNCACHEABLE) ? 1 : 0; - *mtrr = k6_reg_make(desc->mr_base, len, wc, uc); + *mtrr = K6_REG_MAKE(desc->mr_base, len, wc, uc); return 0; } @@ -115,7 +109,7 @@ k6_mrinit(struct mem_range_softc *sc) { for (d = 0; d < sc->mr_ndesc; d++) { u_int32_t one = (reg & (0xffffffff << (32 * d))) >> (32 * d); - k6_reg_get(one, addr, mask, wc, uc); + K6_REG_GET(one, addr, mask, wc, uc); sc->mr_desc[d].mr_base = addr; sc->mr_desc[d].mr_len = ffs(mask) << 17; if (wc) |