CyberEngineMkIII
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
CYBSyscalls.hpp
Go to the documentation of this file.
1 #pragma once
3 
4 namespace CYB {
5  namespace Platform {
6  namespace System {
12  class Sys : public Implementation::Sys {
13  public:
15  union Union64 {
16  public:
17  void* FPointer;
18  unsigned long long FNumber;
19  public:
24  constexpr Union64(void* const APointer) noexcept;
31  constexpr Union64(const unsigned long long ANumber) noexcept;
32  };
33  private:
41  static bool CallRedirected(const CallNumber ACallNumber) noexcept;
56  static unsigned long long RedirectedCall(const CallNumber ACallNumber, const Union64 AArg1 = Union64(nullptr), const Union64 AArg2 = Union64(nullptr), const Union64 AArg3 = Union64(nullptr), const Union64 AArg4 = Union64(nullptr), const Union64 AArg5 = Union64(nullptr), const Union64 AArg6 = Union64(nullptr));
57 
65  static unsigned long long DoCall(const CallNumber ACallNumber) noexcept;
74  static unsigned long long DoCall(const CallNumber ACallNumber, const Union64 AArg1) noexcept;
84  static unsigned long long DoCall(const CallNumber ACallNumber, const Union64 AArg1, const Union64 AArg2) noexcept;
95  static unsigned long long DoCall(const CallNumber ACallNumber, const Union64 AArg1, const Union64 AArg2, const Union64 AArg3) noexcept;
107  static unsigned long long DoCall(const CallNumber ACallNumber, const Union64 AArg1, const Union64 AArg2, const Union64 AArg3, const Union64 AArg4) noexcept;
120  static unsigned long long DoCall(const CallNumber ACallNumber, const Union64 AArg1, const Union64 AArg2, const Union64 AArg3, const Union64 AArg4, const Union64 AArg5) noexcept;
134  static unsigned long long DoCall(const CallNumber ACallNumber, const Union64 AArg1, const Union64 AArg2, const Union64 AArg3, const Union64 AArg4, const Union64 AArg5, const Union64 AArg6) noexcept;
135 
143  static unsigned long long LinkedCall(const CallNumber ACallNumber) noexcept;
144 
153  static unsigned long long LinkedCall(const CallNumber ACallNumber, const Union64 AArg1) noexcept;
154 
164  static unsigned long long LinkedCall(const CallNumber ACallNumber, const Union64 AArg1, const Union64 AArg2) noexcept;
165 
176  static unsigned long long LinkedCall(const CallNumber ACallNumber, const Union64 AArg1, const Union64 AArg2, const Union64 AArg3) noexcept;
177 
189  static unsigned long long LinkedCall(const CallNumber ACallNumber, const Union64 AArg1, const Union64 AArg2, const Union64 AArg3, const Union64 AArg4) noexcept;
190 
203  static unsigned long long LinkedCall(const CallNumber ACallNumber, const Union64 AArg1, const Union64 AArg2, const Union64 AArg3, const Union64 AArg4, const Union64 AArg5) noexcept;
204 
218  static unsigned long long LinkedCall(const CallNumber ACallNumber, const Union64 AArg1, const Union64 AArg2, const Union64 AArg3, const Union64 AArg4, const Union64 AArg5, const Union64 AArg6) noexcept;
219 
225  static void VerifyArgumentCount(const CallNumber ACallNumber, const unsigned long long ANumArgs) noexcept;
226  public:
236  template <typename... Args> static unsigned long long Call(const CallNumber ACallNumber, Args&&... AArgs) noexcept;
237  };
238  };
239  };
240 };
241 
242 #include "CYBSyscalls.inl"
void * FPointer
The argument interpreted as a pointer.
Definition: CYBSyscalls.hpp:17
static unsigned long long Call(const CallNumber ACallNumber, Args &&...AArgs) noexcept
Do a linked or system call.
Contains the functionality for making asm syscalls and linked calls.
Definition: CYBSyscalls.hpp:12
static unsigned long long RedirectedCall(const CallNumber ACallNumber, const Union64 AArg1=Union64(nullptr), const Union64 AArg2=Union64(nullptr), const Union64 AArg3=Union64(nullptr), const Union64 AArg4=Union64(nullptr), const Union64 AArg5=Union64(nullptr), const Union64 AArg6=Union64(nullptr))
Calls a redirected call using the parameters.
Definition: CYBEntry.cpp:40
Used for passing arguments to calls to this class. If the call in question requires const...
Definition: CYBSyscalls.hpp:15
static unsigned long long DoCall(const CallNumber ACallNumber) noexcept
Do an asm syscall for ACallNumber. The number of arguments must match system specification.
static unsigned long long LinkedCall(const CallNumber ACallNumber) noexcept
Do linked call for ACallNumber. The number of arguments must match system specification.
unsigned long long FNumber
The argument interpreted as a number.
Definition: CYBSyscalls.hpp:18
static void VerifyArgumentCount(const CallNumber ACallNumber, const unsigned long long ANumArgs) noexcept
Checks the number of arguments for syscalls and calls HCF if something is wrong.
constexpr Union64(void *const APointer) noexcept
Construct a Union64 from a pointer.
static bool CallRedirected(const CallNumber ACallNumber) noexcept
Check if a certain call has been redirected. Used for testing, always evaluates to false in the runti...
Definition: CYBEntry.cpp:35