Subversion Repositories HelenOS

Rev

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

Rev 2927 Rev 4343
Line 48... Line 48...
48
 
48
 
49
size_t hardcoded_unmapped_ktext_size = 0;
49
size_t hardcoded_unmapped_ktext_size = 0;
50
size_t hardcoded_unmapped_kdata_size = 0;
50
size_t hardcoded_unmapped_kdata_size = 0;
51
 
51
 
52
uintptr_t last_frame = 0;
52
uintptr_t last_frame = 0;
-
 
53
uintptr_t end_frame = 0;
53
 
54
 
54
static void init_e820_memory(pfn_t minconf)
55
static void init_e820_memory(pfn_t minconf)
55
{
56
{
56
    unsigned int i;
57
    unsigned int i;
57
    pfn_t start, conf;
58
    pfn_t start, conf;
Line 71... Line 72...
71
           
72
           
72
            if (last_frame < ALIGN_UP(e820table[i].base_address +
73
            if (last_frame < ALIGN_UP(e820table[i].base_address +
73
                e820table[i].size, FRAME_SIZE))
74
                e820table[i].size, FRAME_SIZE))
74
                last_frame =
75
                last_frame =
75
                    ALIGN_UP(e820table[i].base_address + e820table[i].size, FRAME_SIZE);
76
                    ALIGN_UP(e820table[i].base_address + e820table[i].size, FRAME_SIZE);
76
        }          
77
        }
77
    }
78
    }
-
 
79
   
-
 
80
    end_frame = last_frame;
78
}
81
}
79
 
82
 
80
static char *e820names[] = {
83
static char *e820names[] = {
81
    "invalid",
84
    "invalid",
82
    "available",
85
    "available",
Line 111... Line 114...
111
{
114
{
112
    pfn_t minconf;
115
    pfn_t minconf;
113
   
116
   
114
    if (config.cpu_active == 1) {
117
    if (config.cpu_active == 1) {
115
        minconf = 1;
118
        minconf = 1;
-
 
119
       
116
#ifdef CONFIG_SMP
120
#ifdef CONFIG_SMP
117
        minconf = max(minconf,
121
        minconf = max(minconf,
118
            ADDR2PFN(AP_BOOT_OFFSET + hardcoded_unmapped_ktext_size +
122
            ADDR2PFN(AP_BOOT_OFFSET + hardcoded_unmapped_ktext_size +
119
            hardcoded_unmapped_kdata_size));
123
            hardcoded_unmapped_kdata_size));
120
#endif
124
#endif
121
#ifdef CONFIG_SIMICS_FIX
-
 
122
        minconf = max(minconf, ADDR2PFN(0x10000));
-
 
123
#endif
-
 
124
        init_e820_memory(minconf);
125
        init_e820_memory(minconf);
125
 
126
       
126
        /* Reserve frame 0 (BIOS data) */
127
        /* Reserve frame 0 (BIOS data) */
127
        frame_mark_unavailable(0, 1);
128
        frame_mark_unavailable(0, 1);
128
       
129
       
129
#ifdef CONFIG_SMP
130
#ifdef CONFIG_SMP
130
        /* Reserve AP real mode bootstrap memory */
131
        /* Reserve AP real mode bootstrap memory */
131
        frame_mark_unavailable(AP_BOOT_OFFSET >> FRAME_WIDTH,
132
        frame_mark_unavailable(AP_BOOT_OFFSET >> FRAME_WIDTH,
132
            (hardcoded_unmapped_ktext_size +
133
            (hardcoded_unmapped_ktext_size +
133
            hardcoded_unmapped_kdata_size) >> FRAME_WIDTH);
134
            hardcoded_unmapped_kdata_size) >> FRAME_WIDTH);
134
       
-
 
135
#ifdef CONFIG_SIMICS_FIX
-
 
136
        /* Don't know why, but these addresses help */
-
 
137
        frame_mark_unavailable(0xd000 >> FRAME_WIDTH, 3);
-
 
138
#endif
-
 
139
#endif
135
#endif
140
    }
136
    }
141
}
137
}
142
 
138
 
143
/** @}
139
/** @}