fix: memcpy not in the right order

This commit is contained in:
0x35c
2025-11-30 14:14:03 +01:00
parent afe83d5059
commit 5b25422f8d
2 changed files with 5 additions and 2 deletions

View File

@ -32,7 +32,10 @@
((uint32_t *)(VIRT_PT_BASE + ((uint32_t)pd_index) * 4096 + \
((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)
{
uint32_t pde = va >> 22;

View File

@ -102,7 +102,7 @@ pid_t fork(void)
kfree(e);
goto error;
}
memcpy(it->content, new_content, sizeof(struct tcb));
memcpy(new_content, it->content, sizeof(struct tcb));
new_content->process = new_pcb;
e->next = NULL;
prev = e;