All: Clear lines with only whitspace in them

This commit is contained in:
Bananymous
2023-09-09 22:52:03 +03:00
parent 1fcf122c50
commit 921d95d18f
67 changed files with 95 additions and 119 deletions

View File

@@ -154,7 +154,7 @@ found:
"popa;"
"iret;"
);
extern "C" void syscall_asm();
asm(
".global syscall_asm;"

View File

@@ -207,7 +207,6 @@ namespace Kernel
unmap_page(page);
}
uint8_t MMU::get_page_flags(vaddr_t address) const
{
uint32_t pdpte = (address & 0xC0000000) >> 30;

View File

@@ -16,7 +16,7 @@ extern uint8_t g_userspace_end[];
namespace Kernel
{
static PageTable* s_kernel = nullptr;
static PageTable* s_current = nullptr;
static bool s_has_nxe = false;

View File

@@ -35,7 +35,7 @@
.skip 16384
.global g_boot_stack_top
g_boot_stack_top:
.global g_kernel_cmdline
g_kernel_cmdline:
.skip 4096

View File

@@ -104,7 +104,7 @@ void __cxa_finalize(void *f)
**/
(*__atexit_funcs[i].destructor_func)(__atexit_funcs[i].obj_ptr);
__atexit_funcs[i].destructor_func = 0;
/*
* Notice that we didn't decrement __atexit_func_count: this is because this algorithm
* requires patching to deal with the FIXME outlined above.
@@ -113,8 +113,6 @@ void __cxa_finalize(void *f)
};
};
namespace __cxxabiv1
{
/* guard variables */
@@ -122,19 +120,19 @@ namespace __cxxabiv1
/* The ABI requires a 64-bit type. */
__extension__ typedef int __guard __attribute__((mode(__DI__)));
int __cxa_guard_acquire (__guard* g)
{
Kernel::LockGuard lock_guard(s_spin_lock);
return !*(int*)g;
}
void __cxa_guard_release (__guard* g)
{
Kernel::LockGuard lock_guard(s_spin_lock);
*(int*)g = 1;
}
void __cxa_guard_abort (__guard*)
{
Kernel::panic("__cxa_guard_abort");

View File

@@ -11,7 +11,7 @@ namespace Kernel::API
struct dirent dirent;
DirectoryEntry* next() const { return (DirectoryEntry*)((uintptr_t)this + rec_len); }
};
struct DirectoryEntryList
{
size_t entry_count { 0 };

View File

@@ -73,7 +73,7 @@ namespace CPUID
const char* feature_string_ecx(uint32_t feat);
const char* feature_string_edx(uint32_t feat);
const char* get_vendor();
void get_features(uint32_t& ecx, uint32_t& edx);
bool is_64_bit();

View File

@@ -11,7 +11,7 @@ namespace Kernel
{
BAN_NON_COPYABLE(CriticalScope);
BAN_NON_MOVABLE(CriticalScope);
public:
CriticalScope()
{

View File

@@ -18,7 +18,7 @@ namespace Kernel
virtual BAN::ErrorOr<size_t> read_impl(off_t, void*, size_t) override { return 0; }
virtual BAN::ErrorOr<size_t> write_impl(off_t, const void*, size_t size) override { return size; };
private:
const dev_t m_rdev;
};

View File

@@ -18,7 +18,7 @@ namespace Kernel
virtual BAN::ErrorOr<size_t> read_impl(off_t, void*, size_t) override;
virtual BAN::ErrorOr<size_t> write_impl(off_t, const void*, size_t size) override { return size; };
private:
const dev_t m_rdev;
};

View File

@@ -5,7 +5,7 @@
namespace Kernel
{
class DevFileSystem final : public RamFileSystem
{
public:
@@ -13,7 +13,7 @@ namespace Kernel
static DevFileSystem& get();
void initialize_device_updater();
void add_device(BAN::StringView path, BAN::RefPtr<RamInode>);
dev_t get_next_dev();

View File

@@ -4,7 +4,7 @@
namespace Kernel
{
class FileSystem
{
public:

View File

@@ -6,7 +6,7 @@
namespace Kernel
{
class RamInode;
class RamDirectoryInode;

View File

@@ -14,7 +14,7 @@ namespace Kernel
public:
static BAN::ErrorOr<BAN::RefPtr<RamInode>> create(RamFileSystem&, mode_t, uid_t, gid_t);
virtual ~RamInode() = default;
virtual ino_t ino() const override { return m_inode_info.ino; }
virtual Mode mode() const override { return { m_inode_info.mode }; }
virtual nlink_t nlink() const override { return m_inode_info.nlink; }
@@ -80,7 +80,7 @@ namespace Kernel
private:
RamDirectoryInode(RamFileSystem&, ino_t parent, mode_t, uid_t, gid_t);
private:
static constexpr size_t m_name_max = NAME_MAX;
struct Entry
@@ -106,7 +106,7 @@ namespace Kernel
virtual off_t size() const override { return m_target.size(); }
BAN::ErrorOr<void> set_link_target(BAN::StringView);
protected:
virtual BAN::ErrorOr<BAN::String> link_target_impl() override;
@@ -115,7 +115,7 @@ namespace Kernel
private:
BAN::String m_target;
friend class RamFileSystem;
};

View File

@@ -22,7 +22,7 @@ namespace Kernel
{
m_lock.unlock();
}
private:
Lock& m_lock;
};

View File

@@ -8,7 +8,7 @@
namespace Kernel
{
class Heap
{
BAN_NON_COPYABLE(Heap);

View File

@@ -18,5 +18,5 @@ namespace Kernel
using vaddr_t = uintptr_t;
using paddr_t = uintptr_t;
}

View File

@@ -30,7 +30,7 @@ namespace Kernel
virtual dev_t rdev() const override { return m_rdev; }
virtual BAN::ErrorOr<size_t> read(size_t, void*, size_t) { return BAN::Error::from_errno(ENOTSUP); }
private:
const dev_t m_rdev;
};

View File

@@ -52,7 +52,7 @@ namespace Kernel
protected:
virtual BAN::ErrorOr<size_t> read_impl(off_t, void*, size_t) override;
private:
const dev_t m_rdev;
};

View File

@@ -42,7 +42,7 @@ namespace Kernel
virtual uint32_t width() const override;
virtual uint32_t height() const override;
virtual void putchar(uint8_t) override;
virtual void update() override;
protected:
@@ -55,7 +55,7 @@ namespace Kernel
private:
BAN::String m_name;
Serial m_serial;
public:
virtual dev_t rdev() const override { return m_rdev; }
private:

View File

@@ -11,7 +11,7 @@
namespace Kernel
{
class VirtualTTY : public TTY
{
public:

View File

@@ -8,5 +8,5 @@ namespace Kernel
bool canonical { true };
bool echo { true };
};
}

View File

@@ -118,5 +118,5 @@ namespace Kernel
friend class Scheduler;
};
}

View File

@@ -9,7 +9,7 @@ namespace Kernel
{
public:
BAN::Time get_current_time();
private:
bool is_update_in_progress();
uint8_t read_register8(uint8_t reg);

View File

@@ -12,7 +12,6 @@ namespace Kernel
return BAN::RefPtr<ZeroDevice>::adopt(result);
}
BAN::ErrorOr<size_t> ZeroDevice::read_impl(off_t, void* buffer, size_t bytes)
{
memset(buffer, 0, bytes);

View File

@@ -12,7 +12,7 @@ namespace Kernel
return BAN::Error::from_errno(ENOMEM);
return BAN::RefPtr<Inode>::adopt(pipe);
}
Pipe::Pipe(const Credentials& credentials)
: m_uid(credentials.euid())
, m_gid(credentials.egid())
@@ -29,7 +29,7 @@ namespace Kernel
ASSERT(m_writing_count > 0);
m_writing_count++;
}
void Pipe::close_writing()
{
LockGuard _(m_lock);
@@ -63,7 +63,7 @@ namespace Kernel
return to_copy;
}
BAN::ErrorOr<size_t> Pipe::write_impl(off_t, const void* buffer, size_t count)
{
LockGuard _(m_lock);
@@ -81,5 +81,5 @@ namespace Kernel
return count;
}
}

View File

@@ -6,7 +6,7 @@ namespace Kernel
{
/*
RAM INODE
*/
@@ -68,7 +68,7 @@ namespace Kernel
}
/*
RAM DIRECTORY INODE
*/
@@ -217,7 +217,7 @@ namespace Kernel
}
/*
RAM SYMLINK INODE
*/

View File

@@ -35,7 +35,7 @@ namespace Kernel
auto* tmpfs = MUST(RamFileSystem::create(1024 * 1024, tmpfs_mode, 0, 0));
MUST(s_instance->mount(root_creds, tmpfs, "/tmp"));
}
VirtualFileSystem& VirtualFileSystem::get()
{
ASSERT(s_instance);

View File

@@ -245,7 +245,7 @@ namespace Kernel
result.m_pitch = header.glyph_size / header.height;
return result;
}
bool Font::has_glyph(uint32_t codepoint) const
{
return m_glyph_offsets.contains(codepoint);

View File

@@ -121,7 +121,7 @@ namespace Kernel::Input
}
m_command_queue.push(byte);
}
void PS2Keyboard::append_command_queue(uint8_t byte1, uint8_t byte2)
{
if (m_command_queue.size() + 2 > m_command_queue.capacity())

View File

@@ -59,7 +59,7 @@ namespace Kernel
return page;
return 0;
}
void Heap::release_page(paddr_t addr)
{
LockGuard _(m_lock);

View File

@@ -192,7 +192,7 @@ static void* kmalloc_fixed()
// allocate the node on top of free list
auto* node = info.free_list_head;
ASSERT(node->next == kmalloc_fixed_info::node::invalid);
// remove the node from free list
if (info.free_list_head->prev != kmalloc_fixed_info::node::invalid)
{
@@ -326,7 +326,7 @@ void* kmalloc(size_t size, size_t align, bool force_indentity_map)
if (ptrdiff_t rem = size % s_kmalloc_min_align)
size += s_kmalloc_min_align - rem;
if (void* res = kmalloc_impl(size, align))
return res;

View File

@@ -7,7 +7,6 @@
namespace Kernel
{
OpenFileDescriptorSet::OpenFileDescriptorSet(const Credentials& credentials)
: m_credentials(credentials)
{

View File

@@ -995,7 +995,7 @@ namespace Kernel
auto inode = TRY(m_open_file_descriptors.inode_of(fd));
if (!inode->is_tty())
return BAN::Error::from_errno(ENOTTY);
if ((TTY*)inode.ptr() != m_controlling_terminal.ptr())
return BAN::Error::from_errno(ENOTTY);

View File

@@ -2,13 +2,13 @@
#include <stdint.h>
#include <stdlib.h>
#if UINT32_MAX == UINTPTR_MAX
#define STACK_CHK_GUARD 0xe2dee396
#else
#define STACK_CHK_GUARD 0x595e9fbd94fda766
#endif
uintptr_t __stack_chk_guard = STACK_CHK_GUARD;
__BEGIN_DECLS

View File

@@ -304,7 +304,7 @@ namespace Kernel
execute_current_thread();
ASSERT_NOT_REACHED();
}
void Scheduler::unblock_threads(Semaphore* semaphore)
{
CriticalScope critical;

View File

@@ -323,5 +323,5 @@ namespace Kernel
return {};
}
}

View File

@@ -181,7 +181,7 @@ namespace Kernel
{
return s_has_devices;
}
void Serial::putchar(char c)
{
while (!(IO::inb(m_port + 5) & 0x20))
@@ -275,7 +275,7 @@ namespace Kernel
if (m_serial.port() == COM2_PORT)
update_com(s_com2, s_com2_input);
}
uint32_t SerialTTY::width() const
{
return m_serial.width();
@@ -285,7 +285,7 @@ namespace Kernel
{
return m_serial.height();
}
void SerialTTY::putchar(uint8_t ch)
{
m_serial.putchar(ch);

View File

@@ -57,7 +57,6 @@ VesaTerminalDriver* VesaTerminalDriver::create()
return driver;
}
VesaTerminalDriver::~VesaTerminalDriver()
{
PageTable::kernel().unmap_range(m_address, m_pitch * m_height);

View File

@@ -25,7 +25,6 @@ namespace Kernel
memcpy((void*)rsp, (void*)&value, sizeof(uintptr_t));
}
Thread::TerminateBlocker::TerminateBlocker(Thread& thread)
: m_thread(thread)
{

View File

@@ -47,7 +47,7 @@ namespace Kernel
void PIT::initialize()
{
constexpr uint16_t timer_reload = BASE_FREQUENCY / TICKS_PER_SECOND;
IO::outb(PIT_CTL, SELECT_CHANNEL0 | ACCESS_LO | ACCESS_HI | MODE_SQUARE_WAVE);
IO::outb(TIMER0_CTL, (timer_reload >> 0) & 0xff);

View File

@@ -169,7 +169,7 @@ static void init2(void*)
PCI::initialize();
dprintln("PCI initialized");
VirtualFileSystem::initialize(cmdline.root);
if (auto res = PS2Controller::initialize(); res.is_error())

View File

@@ -10,14 +10,14 @@ extern "C"
uint32_t line;
uint32_t column;
};
struct type_descriptor
{
uint16_t kind;
uint16_t info;
char name[1];
};
struct type_mismatch_data
{
source_location location;
@@ -25,7 +25,7 @@ extern "C"
uint8_t alignment;
uint8_t type_check_kind;
};
struct out_of_bounds_data
{
source_location location;