Done CPU api docs

This commit is contained in:
Elia Sulimanov 2020-06-17 22:29:31 +03:00
parent d25b85d787
commit 2aa182808d

View file

@ -3,32 +3,59 @@ using IL2CPU.API.Attribs;
namespace Cosmos.Core
{
// Non hardware class, only used by core and hardware drivers for ports etc.
/// <summary>
/// CPU class. Non hardware class, only used by core and hardware drivers for ports etc.
/// </summary>
public class CPU
{
// Amount of RAM in MB's.
// needs to be static, as Heap needs it before we can instantiate objects
/// <summary>
/// Get amount of RAM in MB's. Plugged.
/// </summary>
[PlugMethod(PlugRequired = true)]
public static uint GetAmountOfRAM() => throw null;
// needs to be static, as Heap needs it before we can instantiate objects
/// <summary>
/// Get end of the kernel. Plugged.
/// </summary>
[PlugMethod(PlugRequired = true)]
public static uint GetEndOfKernel() => throw null;
/// <summary>
/// Update IDT. Plugged.
/// </summary>
[PlugMethod(PlugRequired = true)]
public void UpdateIDT(bool aEnableInterruptsImmediately) => throw null;
/// <summary>
/// Init float. Plugged.
/// </summary>
[PlugMethod(PlugRequired = true)]
public void InitFloat() => throw null;
/// <summary>
/// Init SSE. Plugged.
/// </summary>
[PlugMethod(PlugRequired = true)]
public void InitSSE() => throw null;
/// <summary>
/// Zero fill. Plugged.
/// </summary>
[PlugMethod(PlugRequired = true)]
public static void ZeroFill(uint aStartAddress, uint aLength) => throw null;
/// <summary>
/// Hult the CPU. Plugged.
/// </summary>
[PlugMethod(PlugRequired = true)]
public void Halt() => throw null;
/// <summary>
/// Reboot the CPU.
/// </summary>
public void Reboot()
{
// Disable all interrupts
@ -42,15 +69,27 @@ namespace Cosmos.Core
Halt(); // If it didn't work, Halt the CPU
}
/// <summary>
/// Enable interrupts. Plugged.
/// </summary>
[PlugMethod(PlugRequired = true)]
private static void DoEnableInterrupts() => throw null;
/// <summary>
/// Disable interrupts. Plugged.
/// </summary>
[PlugMethod(PlugRequired = true)]
private static void DoDisableInterrupts() => throw null;
/// <summary>
/// Check if interrupts enabled.
/// </summary>
[AsmMarker(AsmMarker.Type.Processor_IntsEnabled)]
public static bool mInterruptsEnabled;
/// <summary>
/// Enable interrupts.
/// </summary>
public static void EnableInterrupts()
{
mInterruptsEnabled = true;
@ -58,9 +97,9 @@ namespace Cosmos.Core
}
/// <summary>
/// Returns if the interrupts were actually enabled
/// Returns if the interrupts were actually enabled.
/// </summary>
/// <returns></returns>
/// <returns>bool value.</returns>
public static bool DisableInterrupts()
{
DoDisableInterrupts();