|
悬赏10RD币未解决
本帖最后由 xiaoganga 于 2016-7-6 22:02 编辑
请问xlat_tables.c中函数init_xlation_table的作用是什么,next_xlat,MAX_XLAT_TABLES分别是什么作用?
现在遇到了很奇怪的问题,麻烦同行指点:
如果屏的分辨率是720*1280或800*1280开机时正常.
如果屏的分辨率是480*800开机时会重启,重启处为红色加粗语句处
.h文件中MAX_XLAT_TABLES = 11
mmap_region_t *init_xlation_table(mmap_region_t *mm, unsigned long base,unsigned long *table, unsigned level)
{
unsigned level_size_shift = L1_XLAT_ADDRESS_SHIFT - (level - 1) *XLAT_TABLE_ENTRIES_SHIFT;
unsigned level_size = 1 << level_size_shift;
unsigned long level_index_mask = XLAT_TABLE_ENTRIES_MASK << level_size_shift;
do {
unsigned long desc = UNSET_DESC;
if (mm->base + mm->size <= base)
{
++mm;
continue;
}
if (mm->base >= base + level_size)
{
desc = INVALID_DESC;
}
else if (mm->base <= base &&mm->base + mm->size >= base + level_size)
{
int attr = mmap_region_attr(mm, base, level_size);
if (attr >= 0)
desc = mmap_desc(attr, base, level);
}
if (desc == UNSET_DESC)
{
unsigned long *new_table = xlat_tables[next_xlat++];
assert(next_xlat <= MAX_XLAT_TABLES);
desc = TABLE_DESC | (unsigned long)new_table;
mm = init_xlation_table(mm, base, new_table, level+1);
}
*table++ = desc;
base += level_size;
} while (mm->size && (base & level_index_mask));
return mm;
} |
|