Adding upstream version 3.86+dfsg.
[syslinux-debian/hramrach.git] / com32 / gplinclude / memory.h
blobfe33c18d2b47a09ec2a813274b39871968a1bdca
1 /* ----------------------------------------------------------------------- *
3 * Copyright 2009 Pierre-Alexandre Meyer
5 * Some parts borrowed from meminfo.c32:
7 * Copyright 2003-2009 H. Peter Anvin - All Rights Reserved
8 * Copyright 2009 Intel Corporation; author: H. Peter Anvin
10 * Some parts borrowed from Linux:
12 * Copyright (C) 1991, 1992 Linus Torvalds
13 * Copyright 2007 rPath, Inc. - All Rights Reserved
14 * Copyright 2009 Intel Corporation; author H. Peter Anvin
16 * This file is part of Syslinux, and is made available under
17 * the terms of the GNU General Public License version 2.
19 * ----------------------------------------------------------------------- */
21 #ifndef _MEMORY_H_
22 #define _MEMORY_H_
23 #include <stdint.h>
25 #define E820MAX 128
26 #define E820_RAM 1
27 #define E820_RESERVED 2
28 #define E820_ACPI 3 /* usable as RAM once ACPI tables have been read */
29 #define E820_NVS 4
31 #define RES_START 0xa0000
32 #define RES_END 0x100000
34 struct e820entry {
35 uint64_t addr; /* start of memory segment */
36 uint64_t size; /* size of memory segment */
37 uint64_t type; /* type of memory segment */
38 } __attribute__ ((packed));
40 const char *const e820_types[5];
42 void get_type(int, char *, int);
43 void detect_memory_e820(struct e820entry *desc, int size_map, int *size_found);
44 int detect_memory_e801(int *, int *);
45 int detect_memory_88(int *);
47 /* The following stuff could be merge once the addr_t will be set to 64bits.
48 * syslinux_scan_memory can be used for that purpose */
49 unsigned long memsize_e820(struct e820entry *e820, int e820_nr);
50 int sanitize_e820_map(struct e820entry *orig_map, struct e820entry *new_bios,
51 short old_nr);
52 unsigned long detect_memsize(void);
53 #endif