fix: memcpy not in the right order
This commit is contained in:
@ -32,7 +32,10 @@
|
|||||||
((uint32_t *)(VIRT_PT_BASE + ((uint32_t)pd_index) * 4096 + \
|
((uint32_t *)(VIRT_PT_BASE + ((uint32_t)pd_index) * 4096 + \
|
||||||
((uint32_t)pt_index) * 4))
|
((uint32_t)pt_index) * 4))
|
||||||
|
|
||||||
#define PTE2VA(pd_index, pt_index) ((uint32_t*) ((((((uint32_t)pd_index) * 1024) + ((uint32_t)pt_index)) * 4096)))
|
#define PTE2VA(pd_index, pt_index) \
|
||||||
|
((uint32_t *)(( \
|
||||||
|
((((uint32_t)pd_index) * 1024) + ((uint32_t)pt_index)) * 4096)))
|
||||||
|
|
||||||
static inline uint32_t *VA2PTE(uint32_t va)
|
static inline uint32_t *VA2PTE(uint32_t va)
|
||||||
{
|
{
|
||||||
uint32_t pde = va >> 22;
|
uint32_t pde = va >> 22;
|
||||||
|
|||||||
@ -102,7 +102,7 @@ pid_t fork(void)
|
|||||||
kfree(e);
|
kfree(e);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
memcpy(it->content, new_content, sizeof(struct tcb));
|
memcpy(new_content, it->content, sizeof(struct tcb));
|
||||||
new_content->process = new_pcb;
|
new_content->process = new_pcb;
|
||||||
e->next = NULL;
|
e->next = NULL;
|
||||||
prev = e;
|
prev = e;
|
||||||
|
|||||||
Reference in New Issue
Block a user