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
51
61inline 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
88extern 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 */
Result
Enumeration of generic kernel API result codes.
Definition API.h:69
@ VMCtlNumber
Definition API.h:55
API::Result VMCtlHandler(const ProcessID procID, const MemoryOperation op, Memory::Range *range)
Kernel handler prototype.
Definition VMCtl.cpp:24
MemoryOperation
Memory operations which may be used as an argument to VMCtl().
Definition VMCtl.h:36
API::Result VMCtl(const ProcessID procID, const MemoryOperation op, Memory::Range *range=ZERO)
Prototype for user applications.
Definition VMCtl.h:61
@ ReleaseSections
Definition VMCtl.h:41
@ AddMem
Definition VMCtl.h:45
@ Release
Definition VMCtl.h:40
@ CacheClean
Definition VMCtl.h:46
@ MapSparse
Definition VMCtl.h:38
@ Access
Definition VMCtl.h:43
@ CacheInvalidate
Definition VMCtl.h:47
@ ReserveMem
Definition VMCtl.h:44
@ LookupVirtual
Definition VMCtl.h:42
@ UnMap
Definition VMCtl.h:39
@ MapContiguous
Definition VMCtl.h:37
@ CacheCleanInvalidate
Definition VMCtl.h:48
ulong trapKernel3(ulong api, ulong arg1, ulong arg2, ulong arg3)
Perform a kernel trap with 3 arguments.
Definition ARMTraps.h:103
u32 ProcessID
Process Identification Number.
Definition Types.h:140
unsigned long Address
A memory address.
Definition Types.h:131
#define ZERO
Zero value.
Definition Macros.h:43
Memory range.
Definition Memory.h:56