diff options
author | jhb <jhb@FreeBSD.org> | 2007-10-28 21:23:49 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2007-10-28 21:23:49 +0000 |
commit | ae8e7ec2a3a62350e0e8adf6cc88be3a8330aab9 (patch) | |
tree | 7b9079349353dab6e5c41cb3230d6c339d05d93e /sys/amd64 | |
parent | 80e186726f434f12eda8b927b4d96a968a6753f5 (diff) | |
download | FreeBSD-src-ae8e7ec2a3a62350e0e8adf6cc88be3a8330aab9.zip FreeBSD-src-ae8e7ec2a3a62350e0e8adf6cc88be3a8330aab9.tar.gz |
- Add constants for the different memory types in the SMAP table.
- Use the SMAP types and constants from <machine/pc/bios.h> in the boot
code rather than duplicating it.
Diffstat (limited to 'sys/amd64')
-rw-r--r-- | sys/amd64/amd64/machdep.c | 2 | ||||
-rw-r--r-- | sys/amd64/amd64/nexus.c | 2 | ||||
-rw-r--r-- | sys/amd64/include/pc/bios.h | 10 |
3 files changed, 10 insertions, 4 deletions
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index 7252386..d79e87f 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -881,7 +881,7 @@ getmemsize(caddr_t kmdp, u_int64_t first) printf("SMAP type=%02x base=%016lx len=%016lx\n", smap->type, smap->base, smap->length); - if (smap->type != 0x01) + if (smap->type != SMAP_TYPE_MEMORY) continue; if (smap->length == 0) diff --git a/sys/amd64/amd64/nexus.c b/sys/amd64/amd64/nexus.c index b5498b7..54d9e5f 100644 --- a/sys/amd64/amd64/nexus.c +++ b/sys/amd64/amd64/nexus.c @@ -587,7 +587,7 @@ ram_attach(device_t dev) rid = 0; for (smap = smapbase; smap < smapend; smap++) { - if (smap->type != 0x01 || smap->length == 0) + if (smap->type != SMAP_TYPE_MEMORY || smap->length == 0) continue; error = bus_set_resource(dev, SYS_RES_MEMORY, rid, smap->base, smap->length); diff --git a/sys/amd64/include/pc/bios.h b/sys/amd64/include/pc/bios.h index ffad369..782d4bf 100644 --- a/sys/amd64/include/pc/bios.h +++ b/sys/amd64/include/pc/bios.h @@ -38,10 +38,16 @@ extern u_int32_t bios_sigsearch(u_int32_t start, u_char *sig, int siglen, /* * 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; |