FreeNOS
VMCtl.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2009 Niek Linnenbank
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef __KERNEL_API_VMCTL_H
19 #define __KERNEL_API_VMCTL_H
20 
21 #include <Types.h>
22 #include <Memory.h>
23 
35 typedef enum MemoryOperation
36 {
49 }
51 
61 inline API::Result VMCtl(const ProcessID procID,
62  const MemoryOperation op,
63  Memory::Range *range = ZERO)
64 {
65  return (API::Result) trapKernel3(API::VMCtlNumber, procID, op, (Address) range);
66 }
67 
72 #ifdef __KERNEL__
73 
88 extern API::Result VMCtlHandler(const ProcessID procID,
89  const MemoryOperation op,
90  Memory::Range *range);
91 
96 #endif /* __KERNEL__ */
97 
102 #endif /* __KERNEL_API_VMCTL_H */
Memory::Range
Memory range.
Definition: Memory.h:55
API::Result
Result
Enumeration of generic kernel API result codes.
Definition: API.h:68
CacheClean
@ CacheClean
Definition: VMCtl.h:46
MapSparse
@ MapSparse
Definition: VMCtl.h:38
Types.h
AddMem
@ AddMem
Definition: VMCtl.h:45
ProcessID
u32 ProcessID
Process Identification Number.
Definition: Types.h:140
Address
unsigned long Address
A memory address.
Definition: Types.h:131
VMCtl
API::Result VMCtl(const ProcessID procID, const MemoryOperation op, Memory::Range *range=ZERO)
Prototype for user applications.
Definition: VMCtl.h:61
CacheInvalidate
@ CacheInvalidate
Definition: VMCtl.h:47
UnMap
@ UnMap
Definition: VMCtl.h:39
API::VMCtlNumber
@ VMCtlNumber
Definition: API.h:55
CacheCleanInvalidate
@ CacheCleanInvalidate
Definition: VMCtl.h:48
Release
@ Release
Definition: VMCtl.h:40
Access
@ Access
Definition: VMCtl.h:43
Memory.h
LookupVirtual
@ LookupVirtual
Definition: VMCtl.h:42
MemoryOperation
MemoryOperation
Memory operations which may be used as an argument to VMCtl().
Definition: VMCtl.h:35
VMCtlHandler
API::Result VMCtlHandler(const ProcessID procID, const MemoryOperation op, Memory::Range *range)
Kernel handler prototype.
Definition: VMCtl.cpp:24
ReleaseSections
@ ReleaseSections
Definition: VMCtl.h:41
trapKernel3
ulong trapKernel3(ulong api, ulong arg1, ulong arg2, ulong arg3)
Perform a kernel trap with 3 arguments.
Definition: ARMTraps.h:103
ZERO
#define ZERO
Zero value.
Definition: Macros.h:43
MapContiguous
@ MapContiguous
Definition: VMCtl.h:37
ReserveMem
@ ReserveMem
Definition: VMCtl.h:44