Subversion Repositories HelenOS

Rev

Rev 4377 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4377 Rev 4692
Line 60... Line 60...
60
typedef struct {
60
typedef struct {
61
    pfn_t start;
61
    pfn_t start;
62
    pfn_t count;
62
    pfn_t count;
63
} phys_region_t;
63
} phys_region_t;
64
 
64
 
65
static count_t phys_regions_count = 0;
65
static size_t phys_regions_count = 0;
66
static phys_region_t phys_regions[MAX_REGIONS];
66
static phys_region_t phys_regions[MAX_REGIONS];
67
 
67
 
68
/** Check whether frame is available
68
/** Check whether frame is available
69
 *
69
 *
70
 * Returns true if given frame is generally available for use.
70
 * Returns true if given frame is generally available for use.
Line 117... Line 117...
117
        KA2PA(config.stack_base), config.stack_size))
117
        KA2PA(config.stack_base), config.stack_size))
118
        return false;
118
        return false;
119
   
119
   
120
    /* Init tasks */
120
    /* Init tasks */
121
    bool safe = true;
121
    bool safe = true;
122
    count_t i;
122
    size_t i;
123
    for (i = 0; i < init.cnt; i++)
123
    for (i = 0; i < init.cnt; i++)
124
        if (overlaps(frame << ZERO_PAGE_WIDTH, ZERO_PAGE_SIZE,
124
        if (overlaps(frame << ZERO_PAGE_WIDTH, ZERO_PAGE_SIZE,
125
            KA2PA(init.tasks[i].addr), init.tasks[i].size)) {
125
            KA2PA(init.tasks[i].addr), init.tasks[i].size)) {
126
            safe = false;
126
            safe = false;
127
            break;
127
            break;
Line 172... Line 172...
172
    cp0_pagemask_write(ZERO_PAGE_MASK);
172
    cp0_pagemask_write(ZERO_PAGE_MASK);
173
    cp0_entry_lo0_write(0);
173
    cp0_entry_lo0_write(0);
174
    cp0_entry_lo1_write(0);
174
    cp0_entry_lo1_write(0);
175
    cp0_entry_hi_write(0);
175
    cp0_entry_hi_write(0);
176
 
176
 
177
    count_t i;
177
    size_t i;
178
    for (i = 0; i < TLB_ENTRY_COUNT; i++) {
178
    for (i = 0; i < TLB_ENTRY_COUNT; i++) {
179
        cp0_index_write(i);
179
        cp0_index_write(i);
180
        tlbwi();
180
        tlbwi();
181
    }
181
    }
182
       
182
       
Line 249... Line 249...
249
void physmem_print(void)
249
void physmem_print(void)
250
{
250
{
251
    printf("Base       Size\n");
251
    printf("Base       Size\n");
252
    printf("---------- ----------\n");
252
    printf("---------- ----------\n");
253
   
253
   
254
    count_t i;
254
    size_t i;
255
    for (i = 0; i < phys_regions_count; i++) {
255
    for (i = 0; i < phys_regions_count; i++) {
256
        printf("%#010x %10u\n",
256
        printf("%#010x %10u\n",
257
            PFN2ADDR(phys_regions[i].start), PFN2ADDR(phys_regions[i].count));
257
            PFN2ADDR(phys_regions[i].start), PFN2ADDR(phys_regions[i].count));
258
    }  
258
    }  
259
}
259
}