Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/x86/x86 Use macros instead of hard-coded constants....



details:   https://anonhg.NetBSD.org/src/rev/bdc01bbdde4a
branches:  trunk
changeset: 351343:bdc01bbdde4a
user:      maxv <maxv%NetBSD.org@localhost>
date:      Fri Feb 10 10:02:26 2017 +0000

description:
Use macros instead of hard-coded constants. By the way, I don't think this
code is correct, but whatever.

diffstat:

 sys/arch/x86/x86/x86_machdep.c |  21 ++++++++-------------
 1 files changed, 8 insertions(+), 13 deletions(-)

diffs (49 lines):

diff -r cb3b943107b8 -r bdc01bbdde4a sys/arch/x86/x86/x86_machdep.c
--- a/sys/arch/x86/x86/x86_machdep.c    Fri Feb 10 09:57:04 2017 +0000
+++ b/sys/arch/x86/x86/x86_machdep.c    Fri Feb 10 10:02:26 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: x86_machdep.c,v 1.85 2017/02/10 09:57:04 maxv Exp $    */
+/*     $NetBSD: x86_machdep.c,v 1.86 2017/02/10 10:02:26 maxv Exp $    */
 
 /*-
  * Copyright (c) 2002, 2006, 2007 YAMAMOTO Takashi,
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: x86_machdep.c,v 1.85 2017/02/10 09:57:04 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: x86_machdep.c,v 1.86 2017/02/10 10:02:26 maxv Exp $");
 
 #include "opt_modular.h"
 #include "opt_physmem.h"
@@ -704,24 +704,19 @@
                seg_end = addr + size;
 
                /*
-                * XXX XXX: Avoid compatibility holes.
-                *
-                * Holes within memory space that allow access to be directed
-                * to the PC-compatible frame buffer (0xa0000-0xbffff), to
-                * adapter ROM space (0xc0000-0xdffff), and to system BIOS
-                * space (0xe0000-0xfffff).
+                * XXX XXX: Avoid the ISA I/O MEM.
                 * 
-                * Some laptop (for example, Toshiba Satellite2550X) report
-                * this area and occurred problems, so we avoid this area.
+                * Some laptops (for example, Toshiba Satellite2550X) report
+                * this area as valid.
                 */
-               if (seg_start < 0x100000 && seg_end > 0xa0000) {
+               if (seg_start < IOM_END && seg_end > IOM_BEGIN) {
                        printf("WARNING: memory map entry overlaps "
                            "with ``Compatibility Holes'': "
                            "0x%"PRIx64"/0x%"PRIx64"/0x%x\n", seg_start,
                            seg_end - seg_start, type);
 
-                       x86_add_cluster(seg_start, 0xa0000, type);
-                       x86_add_cluster(0x100000, seg_end, type);
+                       x86_add_cluster(seg_start, IOM_BEGIN, type);
+                       x86_add_cluster(IOM_END, seg_end, type);
                } else {
                        x86_add_cluster(seg_start, seg_end, type);
                }



Home | Main Index | Thread Index | Old Index