-/* $OpenBSD: k6_mem.c,v 1.3 1999/11/24 01:43:32 deraadt Exp $ */
+/* $OpenBSD: k6_mem.c,v 1.4 2000/03/22 00:02:12 deraadt Exp $ */
/*-
* Copyright (c) 1999 Brian Fundakowski Feldman
* All rights reserved.
return EOPNOTSUPP;
for (bit = ffs(desc->mr_len >> 17) - 1; bit < 15; bit++)
- len |= 1 << (14 - bit);
+ len |= 1 << bit;
wc = (desc->mr_flags & MDF_WRITECOMBINE) ? 1 : 0;
uc = (desc->mr_flags & MDF_UNCACHEABLE) ? 1 : 0;
-/* $OpenBSD: mtrr.c,v 1.3 2000/03/13 06:56:56 matthieu Exp $ */
+/* $OpenBSD: mtrr.c,v 1.4 2000/03/22 00:02:12 deraadt Exp $ */
/*-
* Copyright (c) 1999 Michael Smith <msmith@freebsd.org>
* Copyright (c) 1999 Brian Fundakowski Feldman
if (num > 1)
return;
-#if 0
- /* XXX at least 2 people report problems with K6 MTRR */
if (strcmp(cpu_vendor, "AuthenticAMD") == 0 &&
(cpu_id & 0xf00) == 0x500 &&
((cpu_id & 0xf0) > 0x80 ||
(cpu_id & 0xf) > 0x7))) {
mem_range_softc.mr_op = &k6_mrops;
-
- } else
-#endif
- /* Try for i686 MTRRs */
- if ((cpu_feature & CPUID_MTRR) &&
- ((cpu_id & 0xf00) == 0x600) &&
- ((strcmp(cpu_vendor, "GenuineIntel") == 0) ||
- (strcmp(cpu_vendor, "AuthenticAMD") == 0))) {
+ /* Try for i686 MTRRs */
+ } else if ((cpu_feature & CPUID_MTRR) &&
+ ((cpu_id & 0xf00) == 0x600) &&
+ ((strcmp(cpu_vendor, "GenuineIntel") == 0) ||
+ (strcmp(cpu_vendor, "AuthenticAMD") == 0))) {
mem_range_softc.mr_op = &i686_mrops;
- } else {
- mem_range_softc.mr_op = NULL;
- }
+
+ }
/* Initialise memory range handling */
if (mem_range_softc.mr_op != NULL)
mem_range_softc.mr_op->init(&mem_range_softc);