mirror of
https://github.com/drasko/codezero.git
synced 2026-11-19 23:43:53 +01:00
Error recovery fixes to mm0 and l4_map_helper
This commit is contained in:
@@ -322,10 +322,16 @@ void *l4_del_virtual(void *virt, int npages);
|
|||||||
static inline void *l4_map_helper(void *phys, int npages)
|
static inline void *l4_map_helper(void *phys, int npages)
|
||||||
{
|
{
|
||||||
struct task_ids ids;
|
struct task_ids ids;
|
||||||
|
int err;
|
||||||
|
|
||||||
void *virt = l4_new_virtual(npages);
|
void *virt = l4_new_virtual(npages);
|
||||||
|
|
||||||
l4_getid(&ids);
|
l4_getid(&ids);
|
||||||
l4_map(phys, virt, npages, MAP_USR_RW_FLAGS, ids.tid);
|
|
||||||
|
if ((err = l4_map(phys, virt, npages,
|
||||||
|
MAP_USR_RW_FLAGS, ids.tid)) < 0)
|
||||||
|
return PTR_ERR(err);
|
||||||
|
|
||||||
return virt;
|
return virt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -271,9 +271,13 @@ void init_physmem_secondary(struct membank *membank)
|
|||||||
* Use free pages from the bank as
|
* Use free pages from the bank as
|
||||||
* the space for struct page array
|
* the space for struct page array
|
||||||
*/
|
*/
|
||||||
membank[0].page_array =
|
if (IS_ERR(membank[0].page_array =
|
||||||
l4_map_helper((void *)membank[0].free,
|
l4_map_helper((void *)membank[0].free,
|
||||||
pg_npages);
|
pg_npages))) {
|
||||||
|
printf("FATAL: Page array mapping failed. err=%d\n",
|
||||||
|
(int)membank[0].page_array);
|
||||||
|
BUG();
|
||||||
|
}
|
||||||
|
|
||||||
/* Update free memory left */
|
/* Update free memory left */
|
||||||
membank[0].free += pg_npages * PAGE_SIZE;
|
membank[0].free += pg_npages * PAGE_SIZE;
|
||||||
|
|||||||
Reference in New Issue
Block a user