Added mm_record_mmap_entry() and calls to it in k_bootstrap().
git-svn-id: svn://anubis/hos/trunk@26 5b3e749e-e535-0410-8002-a9bb6afbdfca
This commit is contained in:
1 parent
6ea8fe1a27
commit
be8d6015ff
5 files changed
+56
-1
No files matched your search
@@ -1,4 +1,30 @@
|
||||
|
||||
#include "mm.h"
|
||||
#include "boot/k_early_panic.h"
|
||||
|
||||
#define MM_MAX_MMAP_ENTRIES 64
|
||||
|
||||
pagedirectory_t page_directory __attribute__ ((aligned (4096)));
|
||||
|
||||
static mm_mem_range_t mm_mmap_entries[MM_MAX_MMAP_ENTRIES];
|
||||
static int mm_mmap_num_entries = 0;
|
||||
|
||||
/**************************************************************************
|
||||
* This function is run in segmented memory before paging is in effect. *
|
||||
*************************************************************************/
|
||||
void mm_record_mmap_entry(mb_mmap_t * mmap)
|
||||
{
|
||||
if (mm_mmap_num_entries < MM_MAX_MMAP_ENTRIES)
|
||||
{
|
||||
if (mmap->type == MB_MMAP_TYPE_RAM)
|
||||
{
|
||||
mm_mmap_entries[mm_mmap_num_entries].base = mmap->base;
|
||||
mm_mmap_entries[mm_mmap_num_entries].length = mmap->length;
|
||||
mm_mmap_num_entries++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
k_early_panic("Too many mmap_entries!");
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
#include "hos_types.h"
|
||||
#include "hos_defines.h"
|
||||
#include "multiboot.h"
|
||||
|
||||
typedef u32_t pagedirectory_entry_t;
|
||||
|
||||
@@ -12,5 +13,13 @@ typedef pagedirectory_entry_t
|
||||
|
||||
extern pagedirectory_t page_directory;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
u64_t base;
|
||||
u64_t length;
|
||||
} mm_mem_range_t;
|
||||
|
||||
void mm_record_mmap_entry(mb_mmap_t * mmap);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in new issue
Block a user