All: Cleanup all files

Add newline to end of files and remove whitespace from end of lines
This commit is contained in:
2024-01-24 14:43:46 +02:00
parent 3441f63298
commit dfe5a2d665
226 changed files with 466 additions and 460 deletions

View File

@@ -63,7 +63,7 @@ namespace Kernel::GDT
uint8_t flags : 4;
uint8_t base3;
} __attribute__((packed));
struct
{
uint32_t low;
@@ -101,7 +101,7 @@ namespace Kernel::GDT
{
s_tss = new TaskStateSegment();
ASSERT(s_tss);
memset(s_tss, 0x00, sizeof(TaskStateSegment));
s_tss->ss0 = 0x10;
s_tss->esp0 = (uintptr_t)g_boot_stack_top;
@@ -127,7 +127,7 @@ namespace Kernel::GDT
void initialize()
{
constexpr uint32_t descriptor_count = 6;
s_gdt = new SegmentDescriptor[descriptor_count];
s_gdt = new SegmentDescriptor[descriptor_count];
ASSERT(s_gdt);
s_gdtr.address = (uint64_t)s_gdt;
@@ -144,4 +144,4 @@ namespace Kernel::GDT
flush_tss(0x28);
}
}
}

View File

@@ -123,7 +123,7 @@ namespace IDT
}
dprintln("Spurious irq");
return;
return;
found:
if (s_irq_handlers[irq])
s_irq_handlers[irq]();
@@ -174,7 +174,7 @@ found:
"addl $16, %esp;"
"popw %es;"
"popw %ds;"
// NOTE: following instructions are same as in 'popa', except we skip eax
// since it holds the return value of the syscall.
"popl %edi;"
@@ -185,7 +185,7 @@ found:
"popl %edx;"
"popl %ecx;"
"addl $4, %esp;"
"iret;"
);
@@ -267,4 +267,4 @@ found:
flush_idt();
}
}
}

View File

@@ -76,7 +76,7 @@ namespace Kernel
{
if (s_instance == nullptr)
return;
// Here we copy the s_instances paging structs since they are
// global for every process
@@ -84,7 +84,7 @@ namespace Kernel
uint64_t* pdpt = (uint64_t*)kmalloc(sizeof(uint64_t) * 4, 32);
ASSERT(pdpt);
for (uint32_t pdpte = 0; pdpte < 4; pdpte++)
{
if (!(global_pdpt[pdpte] & Flags::Present))

View File

@@ -16,4 +16,4 @@ spinlock_lock_asm:
spinlock_unlock_asm:
movl 4(%esp), %eax
movl $0, (%eax)
ret
ret

View File

@@ -25,4 +25,4 @@ SECTIONS
}
g_kernel_end = .;
}
}

View File

@@ -39,7 +39,7 @@ namespace Kernel::GDT
uint8_t flags : 4;
uint8_t base3;
} __attribute__((packed));
struct
{
uint32_t low;
@@ -81,7 +81,7 @@ namespace Kernel::GDT
{
memset(&s_tss, 0x00, sizeof(TaskStateSegment));
s_tss.iopb = sizeof(TaskStateSegment);
uint64_t base = (uint64_t)&s_tss;
write_entry(s_tss_offset, (uint32_t)base, sizeof(TaskStateSegment), 0x89, 0x0);
@@ -122,4 +122,4 @@ namespace Kernel::GDT
flush_tss();
}
}
}

View File

@@ -121,7 +121,7 @@ namespace Kernel::IDT
uint32_t reserved2 : 16;
};
};
};
static_assert(sizeof(PageFaultError) == 4);
@@ -290,7 +290,7 @@ namespace Kernel::IDT
break;
case ISR::PageFault:
signal = SIGSEGV;
break;
break;
default:
dwarnln("Unhandled exception");
signal = SIGABRT;
@@ -305,7 +305,7 @@ namespace Kernel::IDT
}
ASSERT(Thread::current().state() != Thread::State::Terminated);
done:
return;
}

View File

@@ -138,7 +138,7 @@ namespace Kernel
s_global_pml4e = V2P(allocate_zeroed_page_aligned_page());
m_highest_paging_struct = V2P(allocate_zeroed_page_aligned_page());
uint64_t* pml4 = (uint64_t*)P2V(m_highest_paging_struct);
pml4[511] = s_global_pml4e;
@@ -436,7 +436,7 @@ namespace Kernel
ASSERT(vaddr % PAGE_SIZE == 0);
size_t page_count = range_page_count(vaddr, size);
LockGuard _(m_lock);
for (size_t page = 0; page < page_count; page++)
map_page_at(paddr + page * PAGE_SIZE, vaddr + page * PAGE_SIZE, flags);
@@ -453,7 +453,7 @@ namespace Kernel
uint64_t pdpte = (uc_vaddr >> 30) & 0x1FF;
uint64_t pde = (uc_vaddr >> 21) & 0x1FF;
uint64_t pte = (uc_vaddr >> 12) & 0x1FF;
LockGuard _(m_lock);
uint64_t* pml4 = (uint64_t*)P2V(m_highest_paging_struct);
@@ -533,7 +533,7 @@ namespace Kernel
const uint16_t e_pdpte = (uc_vaddr_end >> 30) & 0x1FF;
const uint16_t e_pde = (uc_vaddr_end >> 21) & 0x1FF;
const uint16_t e_pte = (uc_vaddr_end >> 12) & 0x1FF;
LockGuard _(m_lock);
// Try to find free page that can be mapped without
@@ -714,7 +714,7 @@ namespace Kernel
if (!(pt[pte] & Flags::Used))
continue;
if (start == 0)
{
flags = parse_flags(pt[pte]);

View File

@@ -192,4 +192,4 @@ syscall_asm:
addq $8, %rsp
popaq_no_rax
addq $8, %rsp
iretq
iretq

View File

@@ -35,4 +35,4 @@ SECTIONS
*(.bss)
}
g_kernel_end = .;
}
}