kernel/i386: Add SMAP type constants.
authorSascha Wildner <saw@online.de>
Sun, 7 Sep 2014 18:47:36 +0000 (20:47 +0200)
committerSascha Wildner <saw@online.de>
Sun, 7 Sep 2014 18:48:57 +0000 (20:48 +0200)
sys/platform/pc32/i386/machdep.c
sys/platform/pc32/include/pc/bios.h

index 24278cf..46c4955 100644 (file)
@@ -96,6 +96,7 @@
 #include <machine/specialreg.h>
 #include <machine/bootinfo.h>
 #include <machine/md_var.h>
+#include <machine/pc/bios.h>
 #include <machine/pcb_ext.h>           /* pcb.h included via sys/user.h */
 #include <machine/globaldata.h>                /* CPU_prvspace */
 #include <machine/smp.h>
@@ -1393,7 +1394,7 @@ int15e820:
                                *(u_int32_t *)((char *)&smap->length + 4),
                                (u_int32_t)smap->length);
 
-               if (smap->type != 0x01)
+               if (smap->type != SMAP_TYPE_MEMORY)
                        goto next_run;
 
                if (smap->length == 0)
index 13c443d..9f7d6df 100644 (file)
@@ -25,7 +25,6 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/sys/i386/include/pc/bios.h,v 1.7.2.3 2001/10/21 03:16:56 yokota Exp $
- * $DragonFly: src/sys/platform/pc32/include/pc/bios.h,v 1.3 2003/11/08 02:55:19 dillon Exp $
  */
 
 /* 
@@ -286,15 +285,20 @@ struct PIR_table
 
 /*
  * Int 15:E820 'SMAP' structure
- *
- * XXX add constants for type
  */
 #define SMAP_SIG       0x534D4150                      /* 'SMAP' */
+
+#define        SMAP_TYPE_MEMORY        1
+#define        SMAP_TYPE_RESERVED      2
+#define        SMAP_TYPE_ACPI_RECLAIM  3
+#define        SMAP_TYPE_ACPI_NVS      4
+#define        SMAP_TYPE_ACPI_ERROR    5
+
 struct bios_smap {
     u_int64_t  base;
     u_int64_t  length;
     u_int32_t  type;
-} __attribute__ ((packed));
+} __packed;
 
 struct bios_oem_signature {
        char * anchor;          /* search anchor string in BIOS memory */