FreeNOS
|
Generic Kernel API implementation. More...
#include <API.h>
Public Types | |
enum | Number { PrivExecNumber = 1, ProcessCtlNumber, SystemInfoNumber, VMCopyNumber, VMCtlNumber, VMShareNumber } |
Enumeration of supported generic kernel API functions. More... | |
enum | Result { Success = 0, AccessViolation, RangeError, NotFound, InvalidArgument, OutOfMemory, IOError, AlreadyExists, TemporaryUnavailable, MaxValue = UINT_MAX } |
Enumeration of generic kernel API result codes. More... | |
enum | Operation { Create = 0, Delete = 1, Send = 2, Receive = 3, SendReceive = 4, Read = 5, Write = 6, ReadPhys = 7 } |
Various actions which may be performed inside an APIHandler. More... | |
typedef enum API::Number | Number |
Enumeration of supported generic kernel API functions. More... | |
typedef Result | Handler(ulong, ulong, ulong, ulong, ulong) |
Function which handles an kernel API (system call) request. More... | |
typedef enum API::Operation | Operation |
Various actions which may be performed inside an APIHandler. More... | |
Public Member Functions | |
API () | |
Constructor. More... | |
Result | invoke (Number number, ulong arg1, ulong arg2, ulong arg3, ulong arg4, ulong arg5) |
Execute a generic API function. More... | |
Private Attributes | |
Vector< Handler * > | m_apis |
API handlers. More... | |
Generic Kernel API implementation.
typedef enum API::Number API::Number |
Enumeration of supported generic kernel API functions.
Architectures or System implementations can optionally introduce additional specific APIs.
typedef enum API::Operation API::Operation |
Various actions which may be performed inside an APIHandler.
enum API::Number |
enum API::Operation |
enum API::Result |
Enumeration of generic kernel API result codes.
Enumerator | |
---|---|
Success | |
AccessViolation | |
RangeError | |
NotFound | |
InvalidArgument | |
OutOfMemory | |
IOError | |
AlreadyExists | |
TemporaryUnavailable | |
MaxValue |
API::API | ( | ) |
Constructor.
Definition at line 21 of file API.cpp.
References DEBUG, Sequence< T >::fill(), Vector< T >::insert(), m_apis, PrivExecHandler(), PrivExecNumber, ProcessCtlHandler(), ProcessCtlNumber, SystemInfoHandler(), SystemInfoNumber, VMCopyHandler(), VMCopyNumber, VMCtlHandler(), VMCtlNumber, VMShareHandler(), VMShareNumber, and ZERO.
API::Result API::invoke | ( | Number | number, |
ulong | arg1, | ||
ulong | arg2, | ||
ulong | arg3, | ||
ulong | arg4, | ||
ulong | arg5 | ||
) |
Execute a generic API function.
Definition at line 35 of file API.cpp.
References Vector< T >::get(), InvalidArgument, and m_apis.
Referenced by ARMKernel::trap(), and IntelKernel::trap().