XenevaOS
Loading...
Searching...
No Matches
vmarea.h
Go to the documentation of this file.
1
30#ifndef __VM_AREA_H__
31#define __VM_AREA_H__
32
33#include <stdint.h>
34#include <stdio.h>
35#include <Mm\vmmngr.h>
36#include <Mm\pmmngr.h>
37#include <Fs\vfs.h>
38#include <process.h>
39
40/* protection flags */
41#define VM_PRESENT (1<<0)
42#define VM_WRITE (1<<1)
43#define VM_EXEC (1<<2)
44#define VM_SHARED (1<<3)
45
46/* types of the area */
47#define VM_TYPE_TEXT 1
48#define VM_TYPE_DATA 2
49#define VM_TYPE_STACK 3
50#define VM_TYPE_HEAP 4
51#define VM_TYPE_RESOURCE 5
52
53
54/* AuVMArea -- virtual memory mapping area */
63
64/*
65* AuInsertVMArea -- insert a memory segment to the given process
66* @param proc -- pointer to the process
67* @param area -- pointer to the vm area
68*/
69extern void AuInsertVMArea(AuProcess* proc, AuVMArea* area);
70
71/*
72* AuRemoveVMArea -- removes a memory segment from the given
73* process
74* @param proc -- pointer to the process
75* @param area -- pointer to the vm area
76*/
77extern void AuRemoveVMArea(AuProcess* proc, AuVMArea* area);
78
79/*
80* AuVMAreaCreate -- create virtual memory segment for
81* current process
82* @param start -- starting address
83* @param end -- ending address
84* @param prot -- protection flags
85* @param len -- length of the area
86* @param type -- type of the area
87*/
88extern AuVMArea* AuVMAreaCreate(size_t start, size_t end, uint8_t prot, size_t len, uint8_t type);
89
90/*
91* AuVMAreaGet -- finds a virtual memory area from the
92* given address
93* @param proc -- pointer to the process
94* @param address -- address to search
95*/
96extern AuVMArea* AuVMAreaGet(AuProcess* proc, size_t address);
97
98#endif
unsigned char uint8_t
Definition acefiex.h:161
char end[]
Definition vfs.h:89
Definition process.h:94
Definition vmarea.h:55
uint8_t prot_flags
Definition vmarea.h:59
size_t end
Definition vmarea.h:57
size_t start
Definition vmarea.h:56
AuVFSNode * file
Definition vmarea.h:61
size_t len
Definition vmarea.h:58
uint8_t type
Definition vmarea.h:60
void AuInsertVMArea(AuProcess *proc, AuVMArea *area)
Definition vmarea.cpp:39
AuVMArea * AuVMAreaGet(AuProcess *proc, size_t address)
Definition vmarea.cpp:85
AuVMArea * AuVMAreaCreate(size_t start, size_t end, uint8_t prot, size_t len, uint8_t type)
Definition vmarea.cpp:67
struct _vm_area_ AuVMArea
void AuRemoveVMArea(AuProcess *proc, AuVMArea *area)
Definition vmarea.cpp:49