From a1a2421f889986b25fdf78e0d49fb3f4e0b23558 Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Sun, 7 Sep 2014 20:47:36 +0200 Subject: [PATCH] kernel/i386: Add SMAP type constants. --- sys/platform/pc32/i386/machdep.c | 3 ++- sys/platform/pc32/include/pc/bios.h | 12 ++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/sys/platform/pc32/i386/machdep.c b/sys/platform/pc32/i386/machdep.c index 24278cfdfa..46c49559d4 100644 --- a/sys/platform/pc32/i386/machdep.c +++ b/sys/platform/pc32/i386/machdep.c @@ -96,6 +96,7 @@ #include #include #include +#include #include /* pcb.h included via sys/user.h */ #include /* CPU_prvspace */ #include @@ -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) diff --git a/sys/platform/pc32/include/pc/bios.h b/sys/platform/pc32/include/pc/bios.h index 13c443db7c..9f7d6df133 100644 --- a/sys/platform/pc32/include/pc/bios.h +++ b/sys/platform/pc32/include/pc/bios.h @@ -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 */ -- 2.41.0