mirror of
https://github.com/drasko/codezero.git
synced 2026-01-13 11:23:16 +01:00
Added mutex_control syscall for userspace mutexes.
- Compiles and Codezero runs as normal without touching mutex implementation - Mutex implementation needs testing. The mutex control syscall allows userspace programs to declare any virtual address as a mutex lock and ask for help from the kernel syscall for resolving locking contentions.
This commit is contained in:
@@ -178,6 +178,17 @@ pte_t virt_to_pte(unsigned long virtual)
|
||||
return virt_to_pte_from_pgd(virtual, TASK_PGD(current));
|
||||
}
|
||||
|
||||
unsigned long virt_to_phys_by_pgd(unsigned long vaddr, pgd_table_t *pgd)
|
||||
{
|
||||
pte_t pte = virt_to_pte_from_pgd(vaddr, pgd);
|
||||
return pte & ~PAGE_MASK;
|
||||
}
|
||||
|
||||
unsigned long virt_to_phys_by_task(unsigned long vaddr, struct ktcb *task)
|
||||
{
|
||||
return virt_to_phys_by_pgd(vaddr, TASK_PGD(task));
|
||||
}
|
||||
|
||||
void attach_pmd(pgd_table_t *pgd, pmd_table_t *pmd, unsigned int vaddr)
|
||||
{
|
||||
u32 pgd_i = PGD_INDEX(vaddr);
|
||||
@@ -268,12 +279,6 @@ int check_mapping_pgd(unsigned long vaddr, unsigned long size,
|
||||
return 1;
|
||||
}
|
||||
|
||||
unsigned long virt_to_phys_by_pgd(unsigned long vaddr, pgd_table_t *pgd)
|
||||
{
|
||||
pte_t pte = virt_to_pte_from_pgd(vaddr, pgd);
|
||||
return pte & ~PAGE_MASK;
|
||||
}
|
||||
|
||||
int check_mapping(unsigned long vaddr, unsigned long size,
|
||||
unsigned int flags)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user