Skip to content

Commit

Permalink
Update kernel.h
Browse files Browse the repository at this point in the history
  • Loading branch information
illusion0001 authored Jul 7, 2023
1 parent 04bf155 commit e88e491
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion include/orbis/_types/kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include <sys/time.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/vm.h>

#ifndef MAP_TYPE
#define MAP_TYPE 0x0f
Expand Down Expand Up @@ -97,6 +96,20 @@
#define ORBIS_KERNEL_WC_GARLIC 0x3
#define ORBIS_KERNEL_WB_GARLIC 0xA


// https://github.com/freebsd/freebsd-src/blob/eec2228f5545242471ebda48e26e79eb85156ee5/sys/vm/vm.h#L73
typedef unsigned char vm_prot_t; // freebsd protection codes

#define VM_PROT_NONE ((vm_prot_t)0x00)
#define VM_PROT_READ ((vm_prot_t)0x01)
#define VM_PROT_WRITE ((vm_prot_t)0x02)
#define VM_PROT_EXECUTE ((vm_prot_t)0x04)
#define VM_PROT_COPY ((vm_prot_t)0x08) // copy-on-read

#define VM_PROT_ALL (VM_PROT_READ | VM_PROT_WRITE | VM_PROT_EXECUTE)
#define VM_PROT_RW (VM_PROT_READ | VM_PROT_WRITE)
#define VM_PROT_DEFAULT VM_PROT_ALL

#define ORBIS_KERNEL_PROT_CPU_NONE VM_PROT_NONE
#define ORBIS_KERNEL_PROT_CPU_READ VM_PROT_READ
#define ORBIS_KERNEL_PROT_CPU_WRITE VM_PROT_WRITE
Expand Down

0 comments on commit e88e491

Please sign in to comment.