Lines Matching refs:memory_management_struct
17 struct memory_desc memory_management_struct = {{0}, 0}; variable
51 memory_management_struct.kernel_code_start = (ul)&_text; in mm_init()
52 memory_management_struct.kernel_code_end = (ul)&_etext; in mm_init()
53 memory_management_struct.kernel_data_end = (ul)&_edata; in mm_init()
54 memory_management_struct.rodata_end = (ul)&_erodata; in mm_init()
55 memory_management_struct.start_brk = (ul)&_end; in mm_init()
71 memory_management_struct.e820[i].BaseAddr = mb2_mem_info[i].addr; in mm_init()
72 memory_management_struct.e820[i].Length = mb2_mem_info[i].len; in mm_init()
73 memory_management_struct.e820[i].type = mb2_mem_info[i].type; in mm_init()
74 memory_management_struct.len_e820 = i; in mm_init()
84 for (int i = 0; i < memory_management_struct.len_e820; ++i) in mm_init()
86 if (memory_management_struct.e820[i].type != 1) in mm_init()
90 ul addr_start = PAGE_2M_ALIGN(memory_management_struct.e820[i].BaseAddr); in mm_init()
92 …ul addr_end = ((memory_management_struct.e820[i].BaseAddr + memory_management_struct.e820[i].Lengt… in mm_init()
103 …max_addr = memory_management_struct.e820[memory_management_struct.len_e820].BaseAddr + memory_mana… in mm_init()
107 …memory_management_struct.bmp = (unsigned long *)((memory_management_struct.start_brk + PAGE_4K_SIZ… in mm_init()
108 …memory_management_struct.bits_size = max_addr >> PAGE_2M_SHIFT; … in mm_init()
109 …memory_management_struct.bmp_len = (((unsigned long)(max_addr >> PAGE_2M_SHIFT) + sizeof(unsigned … in mm_init()
113 memset(memory_management_struct.bmp, 0xff, memory_management_struct.bmp_len); in mm_init()
117 …memory_management_struct.pages_struct = (struct Page *)(((unsigned long)memory_management_struct.b… in mm_init()
119 memory_management_struct.count_pages = max_addr >> PAGE_2M_SHIFT; in mm_init()
120 …memory_management_struct.pages_struct_len = ((max_addr >> PAGE_2M_SHIFT) * sizeof(struct Page) + s… in mm_init()
122 …memset(memory_management_struct.pages_struct, 0x00, memory_management_struct.pages_struct_len); //… in mm_init()
126 …memory_management_struct.zones_struct = (struct Zone *)(((ul)memory_management_struct.pages_struct… in mm_init()
129 memory_management_struct.count_zones = 0; in mm_init()
132 …memory_management_struct.zones_struct_len = (10 * sizeof(struct Zone) + sizeof(ul) - 1) & (~(sizeo… in mm_init()
134 memset(memory_management_struct.zones_struct, 0x00, memory_management_struct.zones_struct_len); in mm_init()
138 for (int i = 0; i < memory_management_struct.len_e820; ++i) in mm_init()
141 if (memory_management_struct.e820[i].type != 1) // 不是操作系统可以使用的物理内存 in mm_init()
143 ul addr_start = PAGE_2M_ALIGN(memory_management_struct.e820[i].BaseAddr); in mm_init()
144 …ul addr_end = (memory_management_struct.e820[i].BaseAddr + memory_management_struct.e820[i].Length… in mm_init()
150 … struct Zone *z = memory_management_struct.zones_struct + memory_management_struct.count_zones; in mm_init()
151 ++memory_management_struct.count_zones; in mm_init()
162 z->gmd_struct = &memory_management_struct; in mm_init()
165 …z->pages_group = (struct Page *)(memory_management_struct.pages_struct + (addr_start >> PAGE_2M_SH… in mm_init()
180 …*(memory_management_struct.bmp + ((p->addr_phys >> PAGE_2M_SHIFT) >> 6)) ^= (1UL << ((p->addr_phys… in mm_init()
187 memory_management_struct.pages_struct->zone = memory_management_struct.zones_struct; in mm_init()
188 memory_management_struct.pages_struct->addr_phys = 0UL; in mm_init()
189 …set_page_attr(memory_management_struct.pages_struct, PAGE_PGT_MAPPED | PAGE_KERNEL_INIT | PAGE_KER… in mm_init()
190 memory_management_struct.pages_struct->ref_counts = 1; in mm_init()
191 memory_management_struct.pages_struct->age = 0; in mm_init()
196 …memory_management_struct.zones_struct_len = (memory_management_struct.count_zones * sizeof(struct … in mm_init()
199 ZONE_NORMAL_INDEX = memory_management_struct.count_zones ; in mm_init()
204 …memory_management_struct.end_of_struct = (ul)((ul)memory_management_struct.zones_struct + memory_m… in mm_init()
207 …ul mms_max_page = (virt_2_phys(memory_management_struct.end_of_struct) >> PAGE_2M_SHIFT); // 内存管理单… in mm_init()
216 tmp_page = memory_management_struct.pages_struct + j; in mm_init()
220 *(memory_management_struct.bmp + (page_num >> 6)) |= (1UL << (page_num % 64)); in mm_init()
235 initial_mm.code_addr_start = memory_management_struct.kernel_code_start; in mm_init()
236 initial_mm.code_addr_end = memory_management_struct.kernel_code_end; in mm_init()
239 initial_mm.data_addr_end = memory_management_struct.kernel_data_end; in mm_init()
246 initial_mm.brk_start = memory_management_struct.start_brk; in mm_init()
328 if ((memory_management_struct.zones_struct + i)->count_pages_free < num) in alloc_pages()
331 struct Zone *z = memory_management_struct.zones_struct + i; in alloc_pages()
341 ul *p = memory_management_struct.bmp + (j >> 6); in alloc_pages()
354 struct Page *x = memory_management_struct.pages_struct + start_page_num + l; in alloc_pages()
358 …*(memory_management_struct.bmp + ((x->addr_phys >> PAGE_2M_SHIFT) >> 6)) |= (1UL << (x->addr_phys … in alloc_pages()
365 return (struct Page *)(memory_management_struct.pages_struct + start_page_num); in alloc_pages()
456 *(memory_management_struct.bmp + (page_num >> 6)) &= ~(1UL << (page_num % 64)); in free_pages()
477 for (int i = 0; i < memory_management_struct.count_zones; ++i) in page_table_init()
479 struct Zone *z = memory_management_struct.zones_struct + i; in page_table_init()
591 if ((memory_management_struct.zones_struct + i)->count_pages_using == 0) in mm_find_page()
594 struct Zone *z = memory_management_struct.zones_struct + i; in mm_find_page()
605 ul *p = memory_management_struct.bmp + (j >> 6); in mm_find_page()
613 struct Page *x = memory_management_struct.pages_struct + page_num; in mm_find_page()