Subversion Repositories HelenOS

Rev

Rev 3973 | Rev 4669 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3973 Rev 4117
Line 33... Line 33...
33
 *  @brief Frame related functions.
33
 *  @brief Frame related functions.
34
 */
34
 */
35
 
35
 
36
#include <mm/frame.h>
36
#include <mm/frame.h>
37
#include <arch/mm/frame.h>
37
#include <arch/mm/frame.h>
38
#include <arch/machine.h>
38
#include <arch/drivers/gxemul.h>
39
#include <config.h>
39
#include <config.h>
40
#include <arch/debug/print.h>
-
 
41
 
40
 
42
/** Address of the last frame in the memory. */
41
/** Address of the last frame in the memory. */
43
uintptr_t last_frame = 0;
42
uintptr_t last_frame = 0;
44
 
43
 
45
/** Creates memory zones. */
44
/** Creates memory zones. */
46
void frame_arch_init(void)
45
void frame_arch_init(void)
47
{
46
{
-
 
47
    last_frame = *((uintptr_t *) (GXEMUL_MP_ADDRESS + GXEMUL_MP_MEMSIZE_OFFSET));
-
 
48
   
48
    /* all memory as one zone */
49
    /* All memory as one zone */
49
    zone_create(0, ADDR2PFN(machine_get_memory_size()),
50
    zone_create(0, ADDR2PFN(last_frame),
50
        BOOT_PAGE_TABLE_START_FRAME + BOOT_PAGE_TABLE_SIZE_IN_FRAMES, 0);
51
        BOOT_PAGE_TABLE_START_FRAME + BOOT_PAGE_TABLE_SIZE_IN_FRAMES, 0);
51
    last_frame = machine_get_memory_size();
-
 
52
   
52
   
53
    /* blacklist boot page table */
53
    /* blacklist boot page table */
54
    frame_mark_unavailable(BOOT_PAGE_TABLE_START_FRAME,
54
    frame_mark_unavailable(BOOT_PAGE_TABLE_START_FRAME,
55
        BOOT_PAGE_TABLE_SIZE_IN_FRAMES);
55
        BOOT_PAGE_TABLE_SIZE_IN_FRAMES);
56
}
56
}
57
 
57
 
58
/** Frees the boot page table. */
58
/** Frees the boot page table. */
59
void boot_page_table_free(void)
59
void boot_page_table_free(void)
60
{
60
{
61
    int i;
61
    unsigned int i;
62
    for (i = 0; i < BOOT_PAGE_TABLE_SIZE_IN_FRAMES; i++) {
62
    for (i = 0; i < BOOT_PAGE_TABLE_SIZE_IN_FRAMES; i++)
63
        frame_free(i * FRAME_SIZE + BOOT_PAGE_TABLE_ADDRESS);
63
        frame_free(i * FRAME_SIZE + BOOT_PAGE_TABLE_ADDRESS);
64
    }
-
 
65
}
64
}
66
 
65
 
67
/** @}
66
/** @}
68
 */
67
 */