mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-07-11 15:29:18 +00:00
Implemented SmartCriticalSection
This commit is contained in:
@ -4,7 +4,7 @@
|
||||
#include <printf.h>
|
||||
#include <lock.hpp>
|
||||
|
||||
NEWLOCK(DebuggerLock);
|
||||
NewLock(DebuggerLock);
|
||||
|
||||
using namespace UniversalAsynchronousReceiverTransmitter;
|
||||
|
||||
@ -57,7 +57,7 @@ namespace SysDbg
|
||||
|
||||
void WriteLine(DebugLevel Level, const char *File, int Line, const char *Function, const char *Format, ...)
|
||||
{
|
||||
// SMARTLOCK(DebuggerLock);
|
||||
// SmartLock(DebuggerLock);
|
||||
WritePrefix(Level, File, Line, Function);
|
||||
va_list args;
|
||||
va_start(args, Format);
|
||||
|
@ -6,25 +6,25 @@ namespace Memory
|
||||
{
|
||||
uint64_t Physical::GetTotalMemory()
|
||||
{
|
||||
SMARTLOCK(this->MemoryLock);
|
||||
SmartLock(this->MemoryLock);
|
||||
return this->TotalMemory;
|
||||
}
|
||||
|
||||
uint64_t Physical::GetFreeMemory()
|
||||
{
|
||||
SMARTLOCK(this->MemoryLock);
|
||||
SmartLock(this->MemoryLock);
|
||||
return this->FreeMemory;
|
||||
}
|
||||
|
||||
uint64_t Physical::GetReservedMemory()
|
||||
{
|
||||
SMARTLOCK(this->MemoryLock);
|
||||
SmartLock(this->MemoryLock);
|
||||
return this->ReservedMemory;
|
||||
}
|
||||
|
||||
uint64_t Physical::GetUsedMemory()
|
||||
{
|
||||
SMARTLOCK(this->MemoryLock);
|
||||
SmartLock(this->MemoryLock);
|
||||
return this->UsedMemory;
|
||||
}
|
||||
|
||||
@ -58,7 +58,7 @@ namespace Memory
|
||||
|
||||
void *Physical::RequestPage()
|
||||
{
|
||||
SMARTLOCK(this->MemoryLock);
|
||||
SmartLock(this->MemoryLock);
|
||||
for (; PageBitmapIndex < PageBitmap.Size * 8; PageBitmapIndex++)
|
||||
{
|
||||
if (PageBitmap[PageBitmapIndex] == true)
|
||||
@ -81,7 +81,7 @@ namespace Memory
|
||||
|
||||
void *Physical::RequestPages(uint64_t Count)
|
||||
{
|
||||
SMARTLOCK(this->MemoryLock);
|
||||
SmartLock(this->MemoryLock);
|
||||
for (; PageBitmapIndex < PageBitmap.Size * 8; PageBitmapIndex++)
|
||||
{
|
||||
if (PageBitmap[PageBitmapIndex] == true)
|
||||
@ -119,7 +119,7 @@ namespace Memory
|
||||
|
||||
void Physical::FreePage(void *Address)
|
||||
{
|
||||
SMARTLOCK(this->MemoryLock);
|
||||
SmartLock(this->MemoryLock);
|
||||
if (Address == nullptr)
|
||||
{
|
||||
warn("Null pointer passed to FreePage.");
|
||||
@ -228,7 +228,7 @@ namespace Memory
|
||||
|
||||
void Physical::Init(BootInfo *Info)
|
||||
{
|
||||
SMARTLOCK(this->MemoryLock);
|
||||
SmartLock(this->MemoryLock);
|
||||
void *LargestFreeMemorySegment = nullptr;
|
||||
uint64_t LargestFreeMemorySegmentSize = 0;
|
||||
uint64_t MemorySize = Info->Memory.Size;
|
||||
|
@ -7,7 +7,7 @@ namespace Memory
|
||||
{
|
||||
void Virtual::Map(void *VirtualAddress, void *PhysicalAddress, uint64_t Flags)
|
||||
{
|
||||
SMARTLOCK(this->MemoryLock);
|
||||
SmartLock(this->MemoryLock);
|
||||
if (!this->Table)
|
||||
{
|
||||
error("No page table");
|
||||
@ -85,7 +85,7 @@ namespace Memory
|
||||
|
||||
void Virtual::Unmap(void *VirtualAddress)
|
||||
{
|
||||
SMARTLOCK(this->MemoryLock);
|
||||
SmartLock(this->MemoryLock);
|
||||
if (!this->Table)
|
||||
{
|
||||
error("No page table");
|
||||
|
@ -7,13 +7,13 @@ extern uint64_t _binary_Files_ter_powerline_v12n_psf_start;
|
||||
extern uint64_t _binary_Files_ter_powerline_v12n_psf_end;
|
||||
extern uint64_t _binary_Files_ter_powerline_v12n_psf_size;
|
||||
|
||||
NEWLOCK(PrintLock);
|
||||
NewLock(PrintLock);
|
||||
|
||||
namespace Video
|
||||
{
|
||||
char Display::Print(char Char, int Index, bool WriteToUART)
|
||||
{
|
||||
SMARTLOCK(PrintLock);
|
||||
SmartLock(PrintLock);
|
||||
|
||||
if (this->ColorIteration)
|
||||
{
|
||||
|
Reference in New Issue
Block a user