FreeNOS
ProcessCtl.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_PROCESSCTL_H
19 #define __KERNEL_API_PROCESSCTL_H
20 
21 #include <FreeNOS/Process.h>
22 #include <Types.h>
23 
37 typedef enum ProcessOperation
38 {
39  Spawn = 0,
57 }
59 
63 typedef struct ProcessInfo
64 {
67 
70 
73 }
75 
78 
93 inline API::Result ProcessCtl(const ProcessID proc,
94  const ProcessOperation op,
95  const Address addr = 0,
96  const Address output = 0)
97 {
98  return (API::Result) trapKernel4(API::ProcessCtlNumber, proc, op, addr, output);
99 }
100 
105 #ifdef __KERNEL__
106 
126 extern API::Result ProcessCtlHandler(const ProcessID proc,
127  const ProcessOperation op,
128  const Address addr,
129  const Address output);
130 
135 #endif /* __KERNEL__ */
136 
141 #endif /* __KERNEL_API_PROCESSCTL_H */
ProcessInfo
Process information structure, used for Info.
Definition: ProcessCtl.h:63
ProcessInfo
struct ProcessInfo ProcessInfo
Process information structure, used for Info.
API::Result
Result
Enumeration of generic kernel API result codes.
Definition: API.h:68
Types.h
EnableIRQ
@ EnableIRQ
Definition: ProcessCtl.h:44
WatchIRQ
@ WatchIRQ
Definition: ProcessCtl.h:43
ProcessInfo::parent
ProcessID parent
Parent process id.
Definition: ProcessCtl.h:69
ProcessInfo::id
ProcessID id
Process Identity number.
Definition: ProcessCtl.h:66
WaitTimer
@ WaitTimer
Definition: ProcessCtl.h:50
SendIRQ
@ SendIRQ
Definition: ProcessCtl.h:46
Resume
@ Resume
Definition: ProcessCtl.h:55
ProcessCtlHandler
API::Result ProcessCtlHandler(const ProcessID proc, const ProcessOperation op, const Address addr, const Address output)
Kernel handler prototype.
Definition: ProcessCtl.cpp:27
ProcessID
u32 ProcessID
Process Identification Number.
Definition: Types.h:140
Wakeup
@ Wakeup
Definition: ProcessCtl.h:53
Address
unsigned long Address
A memory address.
Definition: Types.h:131
ProcessCtl
API::Result ProcessCtl(const ProcessID proc, const ProcessOperation op, const Address addr=0, const Address output=0)
Prototype for user applications.
Definition: ProcessCtl.h:93
Reset
@ Reset
Definition: ProcessCtl.h:56
Log
Logging class.
Definition: Log.h:96
WaitPID
@ WaitPID
Definition: ProcessCtl.h:48
InfoTimer
@ InfoTimer
Definition: ProcessCtl.h:49
InfoPID
@ InfoPID
Definition: ProcessCtl.h:47
ProcessInfo::state
Process::State state
Defines the current state of the Process.
Definition: ProcessCtl.h:72
GetPID
@ GetPID
Definition: ProcessCtl.h:41
EnterSleep
@ EnterSleep
Definition: ProcessCtl.h:51
API::ProcessCtlNumber
@ ProcessCtlNumber
Definition: API.h:52
trapKernel4
ulong trapKernel4(ulong api, ulong arg1, ulong arg2, ulong arg3, ulong arg4)
Perform a kernel trap with 4 arguments.
Definition: ARMTraps.h:128
ProcessOperation
ProcessOperation
Available operation to perform using ProcessCtl.
Definition: ProcessCtl.h:37
Process::State
State
Represents the execution state of the Process.
Definition: Process.h:66
Schedule
@ Schedule
Definition: ProcessCtl.h:52
Spawn
@ Spawn
Definition: ProcessCtl.h:39
operator<<
Log & operator<<(Log &log, ProcessOperation op)
Operator to print a ProcessOperation to a Log.
Definition: ProcessCtl.cpp:185
DisableIRQ
@ DisableIRQ
Definition: ProcessCtl.h:45
KillPID
@ KillPID
Definition: ProcessCtl.h:40
GetParent
@ GetParent
Definition: ProcessCtl.h:42
Stop
@ Stop
Definition: ProcessCtl.h:54