Subversion Repositories HelenOS

Rev

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

Rev 4342 Rev 4343
Line 63... Line 63...
63
} phys_region_t;
63
} phys_region_t;
64
 
64
 
65
static count_t phys_regions_count = 0;
65
static count_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
uintptr_t end_frame = 0;
-
 
69
 
68
 
70
 
69
/** Check whether frame is available
71
/** Check whether frame is available
70
 *
72
 *
71
 * Returns true if given frame is generally available for use.
73
 * Returns true if given frame is generally available for use.
72
 * Returns false if given frame is used for physical memory
74
 * Returns false if given frame is used for physical memory
73
 * mapped devices and cannot be used.
75
 * mapped devices and cannot be used.
74
 *
76
 *
75
 */
77
 */
76
static bool frame_available(pfn_t frame)
78
static bool frame_available(pfn_t frame)
77
{
79
{
78
#ifdef msim
80
#ifdef MACHINE_msim
79
    /* MSIM device (dprinter) */
81
    /* MSIM device (dprinter) */
80
    if (frame == (KA2PA(MSIM_VIDEORAM) >> ZERO_PAGE_WIDTH))
82
    if (frame == (KA2PA(MSIM_VIDEORAM) >> ZERO_PAGE_WIDTH))
81
        return false;
83
        return false;
82
   
84
   
83
    /* MSIM device (dkeyboard) */
85
    /* MSIM device (dkeyboard) */
84
    if (frame == (KA2PA(MSIM_KBD_ADDRESS) >> ZERO_PAGE_WIDTH))
86
    if (frame == (KA2PA(MSIM_KBD_ADDRESS) >> ZERO_PAGE_WIDTH))
85
        return false;
87
        return false;
86
#endif
88
#endif
87
 
89
 
88
#ifdef simics
90
#ifdef MACHINE_simics
89
    /* Simics device (serial line) */
91
    /* Simics device (serial line) */
90
    if (frame == (KA2PA(SERIAL_ADDRESS) >> ZERO_PAGE_WIDTH))
92
    if (frame == (KA2PA(SERIAL_ADDRESS) >> ZERO_PAGE_WIDTH))
91
        return false;
93
        return false;
92
#endif
94
#endif
93
 
95
 
94
#if defined(lgxemul) || defined(bgxemul)
96
#if defined(MACHINE_lgxemul) || defined(MACHINE_bgxemul)
95
    /* gxemul devices */
97
    /* gxemul devices */
96
    if (overlaps(frame << ZERO_PAGE_WIDTH, ZERO_PAGE_SIZE,
98
    if (overlaps(frame << ZERO_PAGE_WIDTH, ZERO_PAGE_SIZE,
97
        0x10000000, MB2SIZE(256)))
99
        0x10000000, MB2SIZE(256)))
98
        return false;
100
        return false;
99
#endif
101
#endif
Line 234... Line 236...
234
            start_frame = frame + 1;
236
            start_frame = frame + 1;
235
            avail = true;
237
            avail = true;
236
        }
238
        }
237
    }
239
    }
238
   
240
   
-
 
241
    end_frame = frame;
-
 
242
   
239
    frame_add_region(start_frame, frame);
243
    frame_add_region(start_frame, end_frame);
240
   
244
   
241
    /* Blacklist interrupt vector frame */
245
    /* Blacklist interrupt vector frame */
242
    frame_mark_unavailable(0, 1);
246
    frame_mark_unavailable(0, 1);
243
   
247
   
244
    /* Cleanup */
248
    /* Cleanup */