mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 05:58:11 +00:00
Meta+Kernel: Make clang-format-10 clean
This commit is contained in:
parent
fa62c5595e
commit
64cc3f51d0
61 changed files with 123 additions and 118 deletions
|
@ -56,7 +56,7 @@ int main(int argc, char** argv, char** env)
|
|||
auto elf = ELF::Loader::create((const u8*)mapped_file.data(), mapped_file.size());
|
||||
|
||||
Vector<String> arguments;
|
||||
for (auto arg: command) {
|
||||
for (auto arg : command) {
|
||||
arguments.append(arg);
|
||||
}
|
||||
|
||||
|
|
|
@ -30,8 +30,8 @@
|
|||
#include <Kernel/ACPI/Parser.h>
|
||||
#include <Kernel/Interrupts/IRQHandler.h>
|
||||
#include <Kernel/Lock.h>
|
||||
#include <Kernel/VM/PhysicalPage.h>
|
||||
#include <Kernel/PhysicalAddress.h>
|
||||
#include <Kernel/VM/PhysicalPage.h>
|
||||
|
||||
namespace Kernel {
|
||||
namespace ACPI {
|
||||
|
|
|
@ -30,8 +30,8 @@
|
|||
#include <Kernel/ACPI/Definitions.h>
|
||||
#include <Kernel/ACPI/Initialize.h>
|
||||
#include <Kernel/FileSystem/File.h>
|
||||
#include <Kernel/VM/Region.h>
|
||||
#include <Kernel/PhysicalAddress.h>
|
||||
#include <Kernel/VM/Region.h>
|
||||
#include <Kernel/VirtualAddress.h>
|
||||
|
||||
namespace Kernel {
|
||||
|
|
|
@ -415,7 +415,6 @@ void page_fault_handler(TrapFrame* trap)
|
|||
return;
|
||||
}
|
||||
|
||||
|
||||
auto current_thread = Thread::current();
|
||||
if (!faulted_in_kernel && !MM.validate_user_stack(current_thread->process(), VirtualAddress(regs.userspace_esp))) {
|
||||
dbg() << "Invalid stack pointer: " << VirtualAddress(regs.userspace_esp);
|
||||
|
@ -1745,8 +1744,7 @@ bool Processor::smp_process_pending_messages()
|
|||
u32 prev_flags;
|
||||
enter_critical(prev_flags);
|
||||
|
||||
if (auto pending_msgs = atomic_exchange(&m_message_queue, nullptr, AK::MemoryOrder::memory_order_acq_rel))
|
||||
{
|
||||
if (auto pending_msgs = atomic_exchange(&m_message_queue, nullptr, AK::MemoryOrder::memory_order_acq_rel)) {
|
||||
// We pulled the stack of pending messages in LIFO order, so we need to reverse the list first
|
||||
auto reverse_list =
|
||||
[](ProcessorMessageEntry* list) -> ProcessorMessageEntry*
|
||||
|
@ -1833,8 +1831,7 @@ void Processor::smp_broadcast_message(ProcessorMessage& msg, bool async)
|
|||
atomic_store(&msg.refs, count() - 1, AK::MemoryOrder::memory_order_release);
|
||||
ASSERT(msg.refs > 0);
|
||||
for_each(
|
||||
[&](Processor& proc) -> IterationDecision
|
||||
{
|
||||
[&](Processor& proc) -> IterationDecision {
|
||||
if (&proc != &cur_proc) {
|
||||
if (proc.smp_queue_message(msg)) {
|
||||
// TODO: only send IPI to that CPU if we queued the first
|
||||
|
@ -1890,8 +1887,7 @@ void Processor::smp_broadcast_halt()
|
|||
// We don't want to use a message, because this could have been triggered
|
||||
// by being out of memory and we might not be able to get a message
|
||||
for_each(
|
||||
[&](Processor& proc) -> IterationDecision
|
||||
{
|
||||
[&](Processor& proc) -> IterationDecision {
|
||||
proc.m_halt_requested = true;
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
|
|
|
@ -26,8 +26,8 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Types.h>
|
||||
#include <AK/Assertions.h>
|
||||
#include <AK/Types.h>
|
||||
#include <Kernel/Arch/i386/CPU.h>
|
||||
|
||||
extern "C" void interrupt_common_asm_entry();
|
||||
|
@ -40,6 +40,7 @@ extern "C" void interrupt_common_asm_entry();
|
|||
" pushw $0\n" \
|
||||
" jmp interrupt_common_asm_entry\n");
|
||||
|
||||
// clang-format off
|
||||
asm(
|
||||
".globl interrupt_common_asm_entry\n"
|
||||
"interrupt_common_asm_entry: \n"
|
||||
|
@ -81,3 +82,4 @@ asm(
|
|||
" addl $0x4, %esp\n" // skip exception_code, isr_number
|
||||
" iret\n"
|
||||
);
|
||||
// clang-format on
|
||||
|
|
|
@ -32,8 +32,7 @@ namespace Kernel {
|
|||
|
||||
class Processor;
|
||||
|
||||
class ProcessorInfo
|
||||
{
|
||||
class ProcessorInfo {
|
||||
Processor& m_processor;
|
||||
String m_cpuid;
|
||||
String m_brandstr;
|
||||
|
|
|
@ -38,7 +38,7 @@ void CommandLine::early_initialize(const char* cmd_line)
|
|||
return;
|
||||
size_t length = strlen(cmd_line);
|
||||
if (length >= sizeof(s_cmd_line))
|
||||
length = sizeof(s_cmd_line) -1;
|
||||
length = sizeof(s_cmd_line) - 1;
|
||||
memcpy(s_cmd_line, cmd_line, length);
|
||||
s_cmd_line[length] = '\0';
|
||||
}
|
||||
|
|
|
@ -27,8 +27,8 @@
|
|||
#include <AK/Singleton.h>
|
||||
#include <Kernel/Console.h>
|
||||
#include <Kernel/IO.h>
|
||||
#include <Kernel/kstdio.h>
|
||||
#include <Kernel/SpinLock.h>
|
||||
#include <Kernel/kstdio.h>
|
||||
|
||||
// Bytes output to 0xE9 end up on the Bochs console. It's very handy.
|
||||
#define CONSOLE_OUT_TO_E9
|
||||
|
|
|
@ -29,9 +29,9 @@
|
|||
#include <AK/CircularQueue.h>
|
||||
#include <AK/DoublyLinkedList.h>
|
||||
#include <AK/Types.h>
|
||||
#include <Kernel/API/KeyCode.h>
|
||||
#include <Kernel/Devices/CharacterDevice.h>
|
||||
#include <Kernel/Interrupts/IRQHandler.h>
|
||||
#include <Kernel/API/KeyCode.h>
|
||||
#include <Kernel/Random.h>
|
||||
#include <LibKeyboard/CharacterMap.h>
|
||||
|
||||
|
|
|
@ -26,8 +26,8 @@
|
|||
|
||||
#include <Kernel/Arch/i386/CPU.h>
|
||||
#include <Kernel/Devices/PCSpeaker.h>
|
||||
#include <Kernel/Time/PIT.h>
|
||||
#include <Kernel/IO.h>
|
||||
#include <Kernel/Time/PIT.h>
|
||||
|
||||
void PCSpeaker::tone_on(int frequency)
|
||||
{
|
||||
|
|
|
@ -27,9 +27,9 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/CircularQueue.h>
|
||||
#include <Kernel/API/MousePacket.h>
|
||||
#include <Kernel/Devices/CharacterDevice.h>
|
||||
#include <Kernel/Interrupts/IRQHandler.h>
|
||||
#include <Kernel/API/MousePacket.h>
|
||||
#include <Kernel/Random.h>
|
||||
|
||||
namespace Kernel {
|
||||
|
|
|
@ -28,10 +28,10 @@
|
|||
#include <AK/Singleton.h>
|
||||
#include <AK/StringView.h>
|
||||
#include <Kernel/Devices/SB16.h>
|
||||
#include <Kernel/IO.h>
|
||||
#include <Kernel/Thread.h>
|
||||
#include <Kernel/VM/AnonymousVMObject.h>
|
||||
#include <Kernel/VM/MemoryManager.h>
|
||||
#include <Kernel/IO.h>
|
||||
|
||||
//#define SB16_DEBUG
|
||||
|
||||
|
|
|
@ -28,9 +28,9 @@
|
|||
|
||||
#include <Kernel/Devices/CharacterDevice.h>
|
||||
#include <Kernel/Interrupts/IRQHandler.h>
|
||||
#include <Kernel/PhysicalAddress.h>
|
||||
#include <Kernel/VM/PhysicalPage.h>
|
||||
#include <Kernel/WaitQueue.h>
|
||||
#include <Kernel/PhysicalAddress.h>
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
|
|
|
@ -28,10 +28,10 @@
|
|||
#include <AK/OwnPtr.h>
|
||||
#include <AK/Singleton.h>
|
||||
#include <AK/String.h>
|
||||
#include <Kernel/API/MousePacket.h>
|
||||
#include <Kernel/Arch/i386/CPU.h>
|
||||
#include <Kernel/CommandLine.h>
|
||||
#include <Kernel/Devices/VMWareBackdoor.h>
|
||||
#include <Kernel/API/MousePacket.h>
|
||||
#include <Kernel/IO.h>
|
||||
|
||||
namespace Kernel {
|
||||
|
@ -82,8 +82,7 @@ inline void vmware_high_bandwidth_get(VMWareCommand& command)
|
|||
: "+a"(command.ax), "+b"(command.bx), "+c"(command.cx), "+d"(command.dx), "+S"(command.si), "+D"(command.di));
|
||||
}
|
||||
|
||||
class VMWareBackdoorDetector
|
||||
{
|
||||
class VMWareBackdoorDetector {
|
||||
public:
|
||||
VMWareBackdoorDetector()
|
||||
{
|
||||
|
|
|
@ -78,7 +78,7 @@ public:
|
|||
u8 file_type { 0 };
|
||||
};
|
||||
|
||||
virtual void flush_writes() {}
|
||||
virtual void flush_writes() { }
|
||||
|
||||
size_t block_size() const { return m_block_size; }
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ struct InodeMetadata;
|
|||
|
||||
class InodeIdentifier {
|
||||
public:
|
||||
InodeIdentifier() {}
|
||||
InodeIdentifier() { }
|
||||
InodeIdentifier(u32 fsid, u32 inode)
|
||||
: m_fsid(fsid)
|
||||
, m_index(inode)
|
||||
|
|
|
@ -1206,7 +1206,7 @@ ssize_t ProcFSInode::read_bytes(off_t offset, ssize_t count, UserOrKernelBuffer&
|
|||
|
||||
auto* directory_entry = fs().get_directory_entry(identifier());
|
||||
|
||||
Optional<KBuffer>(*read_callback)(InodeIdentifier) = nullptr;
|
||||
Optional<KBuffer> (*read_callback)(InodeIdentifier) = nullptr;
|
||||
if (directory_entry)
|
||||
read_callback = directory_entry->read_callback;
|
||||
else
|
||||
|
@ -1482,7 +1482,7 @@ ssize_t ProcFSInode::write_bytes(off_t offset, ssize_t size, const UserOrKernelB
|
|||
|
||||
auto* directory_entry = fs().get_directory_entry(identifier());
|
||||
|
||||
ssize_t(*write_callback)(InodeIdentifier, const UserOrKernelBuffer&, size_t) = nullptr;
|
||||
ssize_t (*write_callback)(InodeIdentifier, const UserOrKernelBuffer&, size_t) = nullptr;
|
||||
|
||||
if (directory_entry == nullptr) {
|
||||
if (to_proc_parent_directory(identifier()) == PDI_Root_sys) {
|
||||
|
|
|
@ -59,7 +59,7 @@ private:
|
|||
|
||||
struct ProcFSDirectoryEntry {
|
||||
ProcFSDirectoryEntry() { }
|
||||
ProcFSDirectoryEntry(const char* a_name, unsigned a_proc_file_type, bool a_supervisor_only, Optional<KBuffer>(*read_callback)(InodeIdentifier) = nullptr, ssize_t(*write_callback)(InodeIdentifier, const UserOrKernelBuffer&, size_t) = nullptr, RefPtr<ProcFSInode>&& a_inode = nullptr)
|
||||
ProcFSDirectoryEntry(const char* a_name, unsigned a_proc_file_type, bool a_supervisor_only, Optional<KBuffer> (*read_callback)(InodeIdentifier) = nullptr, ssize_t (*write_callback)(InodeIdentifier, const UserOrKernelBuffer&, size_t) = nullptr, RefPtr<ProcFSInode>&& a_inode = nullptr)
|
||||
: name(a_name)
|
||||
, proc_file_type(a_proc_file_type)
|
||||
, supervisor_only(a_supervisor_only)
|
||||
|
@ -72,8 +72,8 @@ private:
|
|||
const char* name { nullptr };
|
||||
unsigned proc_file_type { 0 };
|
||||
bool supervisor_only { false };
|
||||
Optional<KBuffer>(*read_callback)(InodeIdentifier);
|
||||
ssize_t(*write_callback)(InodeIdentifier, const UserOrKernelBuffer&, size_t);
|
||||
Optional<KBuffer> (*read_callback)(InodeIdentifier);
|
||||
ssize_t (*write_callback)(InodeIdentifier, const UserOrKernelBuffer&, size_t);
|
||||
RefPtr<ProcFSInode> inode;
|
||||
InodeIdentifier identifier(unsigned fsid) const;
|
||||
};
|
||||
|
|
|
@ -38,7 +38,7 @@ namespace Kernel {
|
|||
template<size_t templated_slab_size>
|
||||
class SlabAllocator {
|
||||
public:
|
||||
SlabAllocator() {}
|
||||
SlabAllocator() { }
|
||||
|
||||
void init(size_t size)
|
||||
{
|
||||
|
|
|
@ -86,8 +86,8 @@ private:
|
|||
};
|
||||
|
||||
ICRReg(u8 vector, DeliveryMode delivery_mode, DestinationMode destination_mode, Level level, TriggerMode trigger_mode, DestinationShorthand destinationShort, u8 destination = 0)
|
||||
: m_low(vector | (delivery_mode << 8) | (destination_mode << 11) | (level << 14) | (static_cast<u32>(trigger_mode) << 15) | (destinationShort << 18)),
|
||||
m_high((u32)destination << 24)
|
||||
: m_low(vector | (delivery_mode << 8) | (destination_mode << 11) | (level << 14) | (static_cast<u32>(trigger_mode) << 15) | (destinationShort << 18))
|
||||
, m_high((u32)destination << 24)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -98,10 +98,10 @@ private:
|
|||
OwnPtr<Region> m_apic_base;
|
||||
Vector<OwnPtr<Processor>> m_ap_processor_info;
|
||||
Vector<Thread*> m_ap_idle_threads;
|
||||
AK::Atomic<u8> m_apic_ap_count{0};
|
||||
AK::Atomic<u8> m_apic_ap_continue{0};
|
||||
u32 m_processor_cnt{0};
|
||||
u32 m_processor_enabled_cnt{0};
|
||||
AK::Atomic<u8> m_apic_ap_count { 0 };
|
||||
AK::Atomic<u8> m_apic_ap_continue { 0 };
|
||||
u32 m_processor_cnt { 0 };
|
||||
u32 m_processor_enabled_cnt { 0 };
|
||||
|
||||
static PhysicalAddress get_base();
|
||||
static void set_base(const PhysicalAddress& base);
|
||||
|
|
|
@ -37,8 +37,8 @@ GenericInterruptHandler& GenericInterruptHandler::from(u8 interrupt_number)
|
|||
}
|
||||
|
||||
GenericInterruptHandler::GenericInterruptHandler(u8 interrupt_number, bool disable_remap)
|
||||
: m_interrupt_number(interrupt_number),
|
||||
m_disable_remap(disable_remap)
|
||||
: m_interrupt_number(interrupt_number)
|
||||
, m_disable_remap(disable_remap)
|
||||
{
|
||||
if (m_disable_remap)
|
||||
register_generic_interrupt_handler(m_interrupt_number, *this);
|
||||
|
|
|
@ -39,7 +39,7 @@ enum class IRQControllerType {
|
|||
|
||||
class IRQController : public RefCounted<IRQController> {
|
||||
public:
|
||||
virtual ~IRQController() {}
|
||||
virtual ~IRQController() { }
|
||||
|
||||
virtual void enable(const GenericInterruptHandler&) = 0;
|
||||
virtual void disable(const GenericInterruptHandler&) = 0;
|
||||
|
@ -57,7 +57,7 @@ public:
|
|||
virtual IRQControllerType type() const = 0;
|
||||
|
||||
protected:
|
||||
IRQController() {}
|
||||
IRQController() { }
|
||||
virtual void initialize() = 0;
|
||||
bool m_hard_disabled { false };
|
||||
};
|
||||
|
|
|
@ -37,7 +37,7 @@ class MSIHandler final : public GenericInterruptHandler {
|
|||
public:
|
||||
virtual ~MSIHandler();
|
||||
|
||||
virtual void handle_interrupt(RegisterState&) override {}
|
||||
virtual void handle_interrupt(RegisterState&) override { }
|
||||
|
||||
void enable_irq();
|
||||
void disable_irq();
|
||||
|
|
|
@ -27,9 +27,9 @@
|
|||
#include <AK/Assertions.h>
|
||||
#include <AK/Types.h>
|
||||
#include <Kernel/Arch/i386/CPU.h>
|
||||
#include <Kernel/IO.h>
|
||||
#include <Kernel/Interrupts/GenericInterruptHandler.h>
|
||||
#include <Kernel/Interrupts/PIC.h>
|
||||
#include <Kernel/IO.h>
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ public:
|
|||
using OutputType = KBuffer;
|
||||
|
||||
explicit KBufferBuilder();
|
||||
~KBufferBuilder() {}
|
||||
~KBufferBuilder() { }
|
||||
|
||||
void append(const StringView&);
|
||||
void append(char);
|
||||
|
|
|
@ -35,7 +35,8 @@ enum KSuccessTag {
|
|||
KSuccess
|
||||
};
|
||||
|
||||
class [[nodiscard]] KResult {
|
||||
class [[nodiscard]] KResult
|
||||
{
|
||||
public:
|
||||
ALWAYS_INLINE explicit KResult(int negative_e)
|
||||
: m_error(negative_e)
|
||||
|
@ -61,7 +62,8 @@ private:
|
|||
};
|
||||
|
||||
template<typename T>
|
||||
class alignas(T) [[nodiscard]] KResultOr {
|
||||
class alignas(T) [[nodiscard]] KResultOr
|
||||
{
|
||||
public:
|
||||
KResultOr(KResult error)
|
||||
: m_error(error)
|
||||
|
@ -69,20 +71,29 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
// FIXME: clang-format gets confused about T. Why?
|
||||
// clang-format off
|
||||
ALWAYS_INLINE KResultOr(T&& value)
|
||||
// clang-format on
|
||||
{
|
||||
new (&m_storage) T(move(value));
|
||||
m_have_storage = true;
|
||||
}
|
||||
|
||||
template<typename U>
|
||||
// FIXME: clang-format gets confused about U. Why?
|
||||
// clang-format off
|
||||
ALWAYS_INLINE KResultOr(U&& value)
|
||||
// clang-format on
|
||||
{
|
||||
new (&m_storage) T(move(value));
|
||||
m_have_storage = true;
|
||||
}
|
||||
|
||||
// FIXME: clang-format gets confused about KResultOr. Why?
|
||||
// clang-format off
|
||||
KResultOr(KResultOr&& other)
|
||||
// clang-format on
|
||||
{
|
||||
m_is_error = other.m_is_error;
|
||||
if (m_is_error)
|
||||
|
|
|
@ -39,8 +39,8 @@ struct ICMPType {
|
|||
class [[gnu::packed]] ICMPHeader
|
||||
{
|
||||
public:
|
||||
ICMPHeader() {}
|
||||
~ICMPHeader() {}
|
||||
ICMPHeader() { }
|
||||
~ICMPHeader() { }
|
||||
|
||||
u8 type() const { return m_type; }
|
||||
void set_type(u8 b) { m_type = b; }
|
||||
|
|
|
@ -352,7 +352,7 @@ KResultOr<size_t> IPv4Socket::receive_packet_buffered(FileDescription& descripti
|
|||
}
|
||||
|
||||
if (type() == SOCK_RAW) {
|
||||
size_t bytes_written = min((size_t) ipv4_packet.payload_size(), buffer_length);
|
||||
size_t bytes_written = min((size_t)ipv4_packet.payload_size(), buffer_length);
|
||||
if (!buffer.write(ipv4_packet.payload(), bytes_written))
|
||||
return KResult(-EFAULT);
|
||||
return bytes_written;
|
||||
|
|
|
@ -44,8 +44,8 @@ struct TCPFlags {
|
|||
class [[gnu::packed]] TCPPacket
|
||||
{
|
||||
public:
|
||||
TCPPacket() {}
|
||||
~TCPPacket() {}
|
||||
TCPPacket() { }
|
||||
~TCPPacket() { }
|
||||
|
||||
size_t header_size() const { return data_offset() * sizeof(u32); }
|
||||
|
||||
|
|
|
@ -33,8 +33,8 @@ namespace Kernel {
|
|||
class [[gnu::packed]] UDPPacket
|
||||
{
|
||||
public:
|
||||
UDPPacket() {}
|
||||
~UDPPacket() {}
|
||||
UDPPacket() { }
|
||||
~UDPPacket() { }
|
||||
|
||||
u16 source_port() const { return m_source_port; }
|
||||
void set_source_port(u16 port) { m_source_port = port; }
|
||||
|
|
|
@ -24,8 +24,8 @@
|
|||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <Kernel/PCI/IOAccess.h>
|
||||
#include <Kernel/IO.h>
|
||||
#include <Kernel/PCI/IOAccess.h>
|
||||
|
||||
namespace Kernel {
|
||||
namespace PCI {
|
||||
|
|
|
@ -26,12 +26,12 @@
|
|||
|
||||
#include <Kernel/ACPI/Parser.h>
|
||||
#include <Kernel/CommandLine.h>
|
||||
#include <Kernel/IO.h>
|
||||
#include <Kernel/Net/E1000NetworkAdapter.h>
|
||||
#include <Kernel/Net/RTL8139NetworkAdapter.h>
|
||||
#include <Kernel/PCI/IOAccess.h>
|
||||
#include <Kernel/PCI/Initializer.h>
|
||||
#include <Kernel/PCI/MMIOAccess.h>
|
||||
#include <Kernel/IO.h>
|
||||
|
||||
namespace Kernel {
|
||||
namespace PCI {
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
|
||||
class PhysicalAddress {
|
||||
public:
|
||||
PhysicalAddress() {}
|
||||
PhysicalAddress() { }
|
||||
explicit PhysicalAddress(FlatPtr address)
|
||||
: m_address(address)
|
||||
{
|
||||
|
|
|
@ -26,9 +26,9 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <Kernel/API/Syscall.h>
|
||||
#include <Kernel/KResult.h>
|
||||
#include <Kernel/Process.h>
|
||||
#include <Kernel/API/Syscall.h>
|
||||
#include <LibC/sys/arch/i386/regs.h>
|
||||
|
||||
namespace Ptrace {
|
||||
|
|
|
@ -24,10 +24,10 @@
|
|||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <Kernel/API/Syscall.h>
|
||||
#include <Kernel/Arch/i386/CPU.h>
|
||||
#include <Kernel/Process.h>
|
||||
#include <Kernel/Random.h>
|
||||
#include <Kernel/API/Syscall.h>
|
||||
#include <Kernel/ThreadTracer.h>
|
||||
#include <Kernel/VM/MemoryManager.h>
|
||||
|
||||
|
@ -36,6 +36,7 @@ namespace Kernel {
|
|||
extern "C" void syscall_handler(TrapFrame*);
|
||||
extern "C" void syscall_asm_entry();
|
||||
|
||||
// clang-format off
|
||||
asm(
|
||||
".globl syscall_asm_entry\n"
|
||||
"syscall_asm_entry:\n"
|
||||
|
@ -63,6 +64,7 @@ asm(
|
|||
" call syscall_handler \n"
|
||||
" movl %ebx, 0(%esp) \n" // push pointer to TrapFrame
|
||||
" jmp common_trap_exit \n");
|
||||
// clang-format on
|
||||
|
||||
namespace Syscall {
|
||||
|
||||
|
|
|
@ -91,8 +91,7 @@ KResult Process::poke_user_data(Userspace<u32*> address, u32 data)
|
|||
region->set_shared(false);
|
||||
}
|
||||
const bool was_writable = region->is_writable();
|
||||
if (!was_writable)
|
||||
{
|
||||
if (!was_writable) {
|
||||
region->set_writable(true);
|
||||
region->remap();
|
||||
}
|
||||
|
|
|
@ -510,7 +510,6 @@ ShouldUnblockThread Thread::dispatch_signal(u8 signal)
|
|||
klog() << "signal: dispatch signal " << signal << " to " << *this;
|
||||
#endif
|
||||
|
||||
|
||||
if (m_state == Invalid || !is_initialized()) {
|
||||
// Thread has barely been created, we need to wait until it is
|
||||
// at least in Runnable state and is_initialized() returns true,
|
||||
|
|
|
@ -25,12 +25,12 @@
|
|||
*/
|
||||
|
||||
#include <Kernel/Arch/i386/CPU.h>
|
||||
#include <Kernel/IO.h>
|
||||
#include <Kernel/Interrupts/PIC.h>
|
||||
#include <Kernel/Scheduler.h>
|
||||
#include <Kernel/Thread.h>
|
||||
#include <Kernel/Time/PIT.h>
|
||||
#include <Kernel/Time/TimeManagement.h>
|
||||
#include <Kernel/IO.h>
|
||||
|
||||
#define IRQ_TIMER 0
|
||||
namespace Kernel {
|
||||
|
|
|
@ -26,9 +26,9 @@
|
|||
|
||||
#include <Kernel/Arch/i386/CPU.h>
|
||||
#include <Kernel/CMOS.h>
|
||||
#include <Kernel/IO.h>
|
||||
#include <Kernel/Time/RTC.h>
|
||||
#include <Kernel/Time/TimeManagement.h>
|
||||
#include <Kernel/IO.h>
|
||||
|
||||
namespace Kernel {
|
||||
#define IRQ_TIMER 8
|
||||
|
|
|
@ -40,8 +40,8 @@ public:
|
|||
|
||||
virtual bool is_periodic() const override { return true; }
|
||||
virtual bool is_periodic_capable() const override { return true; }
|
||||
virtual void set_periodic() override {}
|
||||
virtual void set_non_periodic() override {}
|
||||
virtual void set_periodic() override { }
|
||||
virtual void set_non_periodic() override { }
|
||||
|
||||
virtual void reset_to_default_ticks_per_second() override;
|
||||
virtual bool try_to_set_frequency(size_t frequency) override;
|
||||
|
|
|
@ -73,7 +73,6 @@ void TimeManagement::initialize()
|
|||
{
|
||||
ASSERT(!s_the.is_initialized());
|
||||
s_the.ensure_instance();
|
||||
|
||||
}
|
||||
time_t TimeManagement::seconds_since_boot() const
|
||||
{
|
||||
|
|
|
@ -26,8 +26,8 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <Kernel/VM/VMObject.h>
|
||||
#include <Kernel/PhysicalAddress.h>
|
||||
#include <Kernel/VM/VMObject.h>
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#include <Kernel/Heap/kmalloc.h>
|
||||
#include <Kernel/Multiboot.h>
|
||||
#include <Kernel/Process.h>
|
||||
#include <Kernel/StdLib.h>
|
||||
#include <Kernel/VM/AnonymousVMObject.h>
|
||||
#include <Kernel/VM/ContiguousVMObject.h>
|
||||
#include <Kernel/VM/MemoryManager.h>
|
||||
|
@ -40,7 +41,6 @@
|
|||
#include <Kernel/VM/PhysicalRegion.h>
|
||||
#include <Kernel/VM/PurgeableVMObject.h>
|
||||
#include <Kernel/VM/SharedInodeVMObject.h>
|
||||
#include <Kernel/StdLib.h>
|
||||
|
||||
//#define MM_DEBUG
|
||||
//#define PAGE_FAULT_DEBUG
|
||||
|
@ -235,6 +235,7 @@ PageTableEntry* MemoryManager::ensure_pte(PageDirectory& page_directory, Virtual
|
|||
// we're writing to the correct underlying physical page
|
||||
pd = quickmap_pd(page_directory, page_directory_table_index);
|
||||
ASSERT(&pde == &pd[page_directory_index]); // Sanity check
|
||||
|
||||
ASSERT(!pde.is_present()); // Should have not changed
|
||||
}
|
||||
#ifdef MM_DEBUG
|
||||
|
|
|
@ -67,7 +67,7 @@ public:
|
|||
|
||||
private:
|
||||
PhysicalPage(PhysicalAddress paddr, bool supervisor, bool may_return_to_freelist = true);
|
||||
~PhysicalPage() {}
|
||||
~PhysicalPage() { }
|
||||
|
||||
void return_to_freelist() const;
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ class PhysicalRegion : public RefCounted<PhysicalRegion> {
|
|||
|
||||
public:
|
||||
static NonnullRefPtr<PhysicalRegion> create(PhysicalAddress lower, PhysicalAddress upper);
|
||||
~PhysicalRegion() {}
|
||||
~PhysicalRegion() { }
|
||||
|
||||
void expand(PhysicalAddress lower, PhysicalAddress upper);
|
||||
unsigned finalize_capacity();
|
||||
|
|
|
@ -37,7 +37,7 @@ class Range {
|
|||
friend class RangeAllocator;
|
||||
|
||||
public:
|
||||
Range() {}
|
||||
Range() { }
|
||||
Range(VirtualAddress base, size_t size)
|
||||
: m_base(base)
|
||||
, m_size(size)
|
||||
|
|
|
@ -238,5 +238,4 @@ inline unsigned prot_to_region_access_flags(int prot)
|
|||
return access;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
|
||||
class VirtualAddress {
|
||||
public:
|
||||
VirtualAddress() {}
|
||||
VirtualAddress() { }
|
||||
explicit VirtualAddress(FlatPtr address)
|
||||
: m_address(address)
|
||||
{
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
|
||||
namespace Kernel {
|
||||
|
||||
|
||||
WaitQueue::WaitQueue()
|
||||
{
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue