FreeNOS
VMShare.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 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_VMSHARE_H
19 #define __KERNEL_API_VMSHARE_H
20 
21 #include <FreeNOS/ProcessShares.h>
22 #include <Types.h>
23 
41 inline API::Result VMShare(const ProcessID pid,
42  const API::Operation op,
44 {
45  return (API::Result) trapKernel3(API::VMShareNumber, pid, op, (Address) share);
46 }
47 
52 #ifdef __KERNEL__
53 
68 extern API::Result VMShareHandler(const ProcessID pid,
69  const API::Operation op,
71 
76 #endif /* __KERNEL__ */
77 
82 #endif /* __KERNEL_API_VMSHARE_H */
ProcessShares::MemoryShare
Definition: ProcessShares.h:48
API::Result
Result
Enumeration of generic kernel API result codes.
Definition: API.h:68
Types.h
API::Operation
Operation
Various actions which may be performed inside an APIHandler.
Definition: API.h:91
VMShareHandler
API::Result VMShareHandler(const ProcessID pid, const API::Operation op, ProcessShares::MemoryShare *share)
Kernel handler prototype.
Definition: VMShare.cpp:25
ProcessID
u32 ProcessID
Process Identification Number.
Definition: Types.h:140
Address
unsigned long Address
A memory address.
Definition: Types.h:131
VMShare
API::Result VMShare(const ProcessID pid, const API::Operation op, ProcessShares::MemoryShare *share)
Prototype for user applications.
Definition: VMShare.h:41
API::VMShareNumber
@ VMShareNumber
Definition: API.h:56
trapKernel3
ulong trapKernel3(ulong api, ulong arg1, ulong arg2, ulong arg3)
Perform a kernel trap with 3 arguments.
Definition: ARMTraps.h:103