#include <ipxe/io.h>
#include <registers.h>
-#include <ipxe/memmap.h>
/*
* Originally by Eric Biederman
#include <basemem.h>
#include <fakee820.h>
#include <ipxe/init.h>
-#include <ipxe/memmap.h>
+#include <ipxe/io.h>
#include <ipxe/hidemem.h>
/** Set to true if you want to test a fake E820 map */
#include <realmode.h>
#include <bios.h>
#include <memsizes.h>
-#include <ipxe/memmap.h>
+#include <ipxe/io.h>
/**
* @file
*
* @v memmap Memory map to fill in
*/
-void get_memmap ( struct memory_map *memmap ) {
+void x86_get_memmap ( struct memory_map *memmap ) {
unsigned int basemem, extmem;
int rc;
memmap->regions[1].end = 0x100000 + ( extmem * 1024 );
memmap->count = 2;
}
+
+PROVIDE_IOAPI ( x86, get_memmap, x86_get_memmap );
#include <ipxe/image.h>
#include <ipxe/segment.h>
#include <ipxe/init.h>
-#include <ipxe/memmap.h>
+#include <ipxe/io.h>
struct image_type com32_image_type __image_type ( PROBE_NORMAL );
#include <ipxe/uaccess.h>
#include <ipxe/image.h>
#include <ipxe/segment.h>
-#include <ipxe/memmap.h>
+#include <ipxe/io.h>
#include <ipxe/elf.h>
#include <ipxe/init.h>
#include <ipxe/features.h>
#include <assert.h>
#include <ipxe/list.h>
#include <ipxe/blockdev.h>
-#include <ipxe/memmap.h>
+#include <ipxe/io.h>
#include <realmode.h>
#include <bios.h>
#include <biosint.h>
#include <errno.h>
#include <ipxe/uaccess.h>
#include <ipxe/hidemem.h>
-#include <ipxe/memmap.h>
+#include <ipxe/io.h>
#include <ipxe/umalloc.h>
/** Alignment of external allocated memory */
#include <ipxe/netdevice.h>
#include <ipxe/ethernet.h>
#include <ipxe/if_ether.h>
-#include <ipxe/memmap.h>
#include "b44.h"
struct memory_region *highest = NULL;
get_memmap(&memmap);
+ if (memmap.count == 0)
+ return 0;
highest = &memmap.regions[memmap.count - 1];
return (highest->end < limit);
#include <errno.h>
#include <ipxe/uaccess.h>
-#include <ipxe/memmap.h>
+#include <ipxe/io.h>
#include <ipxe/errortab.h>
#include <ipxe/segment.h>
#define rmb() mb()
#define wmb() mb()
+/** A usable memory region */
+struct memory_region {
+ /** Physical start address */
+ uint64_t start;
+ /** Physical end address */
+ uint64_t end;
+};
+
+/** Maximum number of memory regions we expect to encounter */
+#define MAX_MEMORY_REGIONS 8
+
+/** A memory map */
+struct memory_map {
+ /** Memory regions */
+ struct memory_region regions[MAX_MEMORY_REGIONS];
+ /** Number of used regions */
+ unsigned int count;
+};
+
+/**
+ * Get memory map
+ *
+ * @v memmap Memory map to fill in
+ */
+void get_memmap ( struct memory_map *memmap );
+
#endif /* _IPXE_IO_H */
+++ /dev/null
-#ifndef _IPXE_MEMMAP_H
-#define _IPXE_MEMMAP_H
-
-#include <stdint.h>
-
-/**
- * @file
- *
- * Memory mapping
- *
- */
-
-FILE_LICENCE ( GPL2_OR_LATER );
-
-/** A usable memory region */
-struct memory_region {
- /** Physical start address */
- uint64_t start;
- /** Physical end address */
- uint64_t end;
-};
-
-/** Maximum number of memory regions we expect to encounter */
-#define MAX_MEMORY_REGIONS 8
-
-/** A memory map */
-struct memory_map {
- /** Memory regions */
- struct memory_region regions[MAX_MEMORY_REGIONS];
- /** Number of used regions */
- unsigned int count;
-};
-
-extern void get_memmap ( struct memory_map *memmap );
-
-#endif /* _IPXE_MEMMAP_H */
outb ( 0, 0x80 );
}
+/**
+ * Get memory map
+ *
+ * Can't be done on EFI so return an empty map
+ *
+ * @v memmap Memory map to fill in
+ */
+static void efi_get_memmap ( struct memory_map *memmap ) {
+ memmap->count = 0;
+}
+
PROVIDE_IOAPI_INLINE ( efi, phys_to_bus );
PROVIDE_IOAPI_INLINE ( efi, bus_to_phys );
PROVIDE_IOAPI_INLINE ( efi, ioremap );
PROVIDE_IOAPI_INLINE ( efi, outsl );
PROVIDE_IOAPI ( efi, iodelay, efi_iodelay );
PROVIDE_IOAPI_INLINE ( efi, mb );
+PROVIDE_IOAPI ( efi, get_memmap, efi_get_memmap );
#include <stdio.h>
#include <ipxe/uaccess.h>
#include <ipxe/umalloc.h>
-#include <ipxe/memmap.h>
+#include <ipxe/io.h>
void umalloc_test ( void ) {
struct memory_map memmap;