All: rename every function from UpperCamelCase to snake_case

This was a mess since I didn't know which to use but now I decided
to go with snake_case :)
This commit is contained in:
Bananymous
2023-02-01 21:05:44 +02:00
parent 4faa662a59
commit 9b8de5025a
50 changed files with 737 additions and 709 deletions

View File

@@ -17,7 +17,7 @@
asm volatile("movl %%cr2, %%eax":"=a"(cr2)); \
asm volatile("movl %%cr3, %%eax":"=a"(cr3)); \
asm volatile("movl %%cr4, %%eax":"=a"(cr4)); \
Kernel::Panic(msg "\r\nRegister dump\r\n" \
Kernel::panic(msg "\r\nRegister dump\r\n" \
"eax=0x{8H}, ebx=0x{8H}, ecx=0x{8H}, edx=0x{8H}\r\n" \
"esp=0x{8H}, ebp=0x{8H}\r\n" \
"CR0=0x{8H}, CR2=0x{8H}, CR3=0x{8H}, CR4=0x{8H}\r\n", \
@@ -39,7 +39,7 @@
asm volatile("movl %%cr3, %%eax":"=a"(cr3)); \
asm volatile("movl %%cr4, %%eax":"=a"(cr4)); \
asm volatile("popl %%eax":"=a"(error_code)); \
Kernel::Panic(msg " (error code: 0x{8H})\r\n" \
Kernel::panic(msg " (error code: 0x{8H})\r\n" \
"Register dump\r\n" \
"eax=0x{8H}, ebx=0x{8H}, ecx=0x{8H}, edx=0x{8H}\r\n" \
"esp=0x{8H}, ebp=0x{8H}\r\n" \
@@ -114,7 +114,7 @@ namespace IDT
uint8_t irq = 0;
for (uint32_t i = 0; i <= 0xFF; i++)
{
if (InterruptController::Get().IsInService(i))
if (InterruptController::get().is_in_service(i))
{
irq = i;
break;
@@ -132,7 +132,7 @@ namespace IDT
else
dprintln("no handler for irq 0x{2H}\n", irq);
InterruptController::Get().EOI(irq);
InterruptController::get().eoi(irq);
}
extern "C" void handle_irq_common();

View File

@@ -16,13 +16,13 @@
static MMU* s_instance = nullptr;
void MMU::Intialize()
void MMU::intialize()
{
ASSERT(s_instance == nullptr);
s_instance = new MMU();
}
MMU& MMU::Get()
MMU& MMU::get()
{
ASSERT(s_instance);
return *s_instance;
@@ -70,7 +70,7 @@ MMU::MMU()
asm volatile("movl %0, %%cr3" :: "r"(m_highest_paging_struct));
}
void MMU::AllocatePage(uintptr_t address)
void MMU::allocate_page(uintptr_t address)
{
#if MMU_DEBUG_PRINT
dprintln("AllocatePage(0x{8H})", address & PAGE_MASK);
@@ -93,15 +93,15 @@ void MMU::AllocatePage(uintptr_t address)
asm volatile("invlpg (%0)" :: "r"(address & PAGE_MASK) : "memory");
}
void MMU::AllocateRange(uintptr_t address, ptrdiff_t size)
void MMU::allocate_range(uintptr_t address, ptrdiff_t size)
{
uintptr_t s_page = address & PAGE_MASK;
uintptr_t e_page = (address + size - 1) & PAGE_MASK;
for (uintptr_t page = s_page; page <= e_page; page += PAGE_SIZE)
AllocatePage(page);
allocate_page(page);
}
void MMU::UnAllocatePage(uintptr_t address)
void MMU::unallocate_page(uintptr_t address)
{
#if MMU_DEBUG_PRINT
dprintln("UnAllocatePage(0x{8H})", address & PAGE_MASK);
@@ -126,10 +126,10 @@ void MMU::UnAllocatePage(uintptr_t address)
asm volatile("invlpg (%0)" :: "r"(address & PAGE_MASK) : "memory");
}
void MMU::UnAllocateRange(uintptr_t address, ptrdiff_t size)
void MMU::unallocate_range(uintptr_t address, ptrdiff_t size)
{
uintptr_t s_page = address & PAGE_MASK;
uintptr_t e_page = (address + size - 1) & PAGE_MASK;
for (uintptr_t page = s_page; page <= e_page; page += PAGE_SIZE)
UnAllocatePage(page);
unallocate_page(page);
}

View File

@@ -97,7 +97,7 @@ namespace IDT
extern "C" void cpp_isr_handler(uint64_t isr, uint64_t error, const Registers* regs)
{
Kernel::Panic(
Kernel::panic(
"{} (error code: 0x{16H})\r\n"
"Register dump\r\n"
"rax=0x{16H}, rbx=0x{16H}, rcx=0x{16H}, rdx=0x{16H}\r\n"
@@ -118,7 +118,7 @@ namespace IDT
s_irq_handlers[irq]();
else
{
if (!InterruptController::Get().IsInService(irq))
if (!InterruptController::get().is_in_service(irq))
{
dprintln("spurious irq 0x{2H}", irq);
return;
@@ -126,7 +126,7 @@ namespace IDT
dprintln("no handler for irq 0x{2H}\n", irq);
}
InterruptController::Get().EOI(irq);
InterruptController::get().eoi(irq);
}
static void flush_idt()

View File

@@ -16,13 +16,13 @@
static MMU* s_instance = nullptr;
void MMU::Intialize()
void MMU::intialize()
{
ASSERT(s_instance == nullptr);
s_instance = new MMU();
}
MMU& MMU::Get()
MMU& MMU::get()
{
ASSERT(s_instance);
return *s_instance;
@@ -89,7 +89,7 @@ MMU::~MMU()
kfree(pml4);
}
void MMU::AllocatePage(uintptr_t address)
void MMU::allocate_page(uintptr_t address)
{
ASSERT((address >> 48) == 0);
@@ -129,15 +129,15 @@ void MMU::AllocatePage(uintptr_t address)
}
}
void MMU::AllocateRange(uintptr_t address, ptrdiff_t size)
void MMU::allocate_range(uintptr_t address, ptrdiff_t size)
{
uintptr_t s_page = address & PAGE_MASK;
uintptr_t e_page = (address + size - 1) & PAGE_MASK;
for (uintptr_t page = s_page; page <= e_page; page += PAGE_SIZE)
AllocatePage(page);
allocate_page(page);
}
void MMU::UnAllocatePage(uintptr_t address)
void MMU::unallocate_page(uintptr_t address)
{
ASSERT((address >> 48) == 0);
@@ -177,10 +177,10 @@ cleanup_done:
asm volatile("invlpg (%0)" :: "r"(address) : "memory");
}
void MMU::UnAllocateRange(uintptr_t address, ptrdiff_t size)
void MMU::unallocate_range(uintptr_t address, ptrdiff_t size)
{
uintptr_t s_page = address & PAGE_MASK;
uintptr_t e_page = (address + size - 1) & PAGE_MASK;
for (uintptr_t page = s_page; page <= e_page; page += PAGE_SIZE)
UnAllocatePage(page);
unallocate_page(page);
}