mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
Fixed incorrect x86-family protection flags.
This commit is contained in:
parent
49ad293d1d
commit
2e3843ffce
1 changed files with 2 additions and 2 deletions
|
@ -380,14 +380,14 @@ namespace Sortix
|
||||||
if ( prot & PROT_WRITE ) { result |= PML_USERSPACE | PML_WRITABLE; }
|
if ( prot & PROT_WRITE ) { result |= PML_USERSPACE | PML_WRITABLE; }
|
||||||
if ( prot & PROT_KEXEC ) { result |= 0; }
|
if ( prot & PROT_KEXEC ) { result |= 0; }
|
||||||
if ( prot & PROT_KREAD ) { result |= 0; }
|
if ( prot & PROT_KREAD ) { result |= 0; }
|
||||||
if ( prot & PROT_KWRITE ) { result |= PML_WRITABLE; }
|
if ( prot & PROT_KWRITE ) { result |= 0; }
|
||||||
if ( prot & PROT_FORK ) { result |= PML_FORK; }
|
if ( prot & PROT_FORK ) { result |= PML_FORK; }
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
int PMLFlagsToProtection(addr_t flags)
|
int PMLFlagsToProtection(addr_t flags)
|
||||||
{
|
{
|
||||||
int prot = PROT_KREAD | PROT_KEXEC;
|
int prot = PROT_KREAD | PROT_KWRITE | PROT_KEXEC;
|
||||||
bool user = flags & PML_USERSPACE;
|
bool user = flags & PML_USERSPACE;
|
||||||
bool write = flags & PML_WRITABLE;
|
bool write = flags & PML_WRITABLE;
|
||||||
if ( user ) { prot |= PROT_EXEC | PROT_READ; }
|
if ( user ) { prot |= PROT_EXEC | PROT_READ; }
|
||||||
|
|
Loading…
Reference in a new issue