forked from Bananymous/banan-os
All: Fix a lot of compiler warnings from header files
While reworking build system, header files started to report warnings.
This commit is contained in:
@@ -132,7 +132,7 @@ acpi_release_global_lock:
|
||||
if (!access_type.has_value())
|
||||
return {};
|
||||
|
||||
auto op_region = MUST(BAN::RefPtr<AML::OpRegion>::create(""sv, address_space_id, (uint64_t)address, 0xFFFFFFFF));
|
||||
auto op_region = MUST(BAN::RefPtr<AML::OpRegion>::create(""_sv, address_space_id, (uint64_t)address, 0xFFFFFFFF));
|
||||
|
||||
auto field_rules = AML::FieldRules {
|
||||
.access_type = access_type.value(),
|
||||
@@ -141,7 +141,7 @@ acpi_release_global_lock:
|
||||
.access_attrib = AML::FieldRules::AccessAttrib::Normal,
|
||||
.access_length = 0
|
||||
};
|
||||
auto field_element = MUST(BAN::RefPtr<AML::FieldElement>::create(""sv, register_bit_offset, register_bit_width, field_rules));
|
||||
auto field_element = MUST(BAN::RefPtr<AML::FieldElement>::create(""_sv, register_bit_offset, register_bit_width, field_rules));
|
||||
field_element->op_region = op_region;
|
||||
|
||||
auto result = field_element->as_integer();
|
||||
@@ -156,7 +156,7 @@ acpi_release_global_lock:
|
||||
if (!access_type.has_value())
|
||||
return {};
|
||||
|
||||
auto op_region = MUST(BAN::RefPtr<AML::OpRegion>::create(""sv, address_space_id, (uint64_t)address, 0xFFFFFFFF));
|
||||
auto op_region = MUST(BAN::RefPtr<AML::OpRegion>::create(""_sv, address_space_id, (uint64_t)address, 0xFFFFFFFF));
|
||||
|
||||
auto field_rules = AML::FieldRules {
|
||||
.access_type = access_type.value(),
|
||||
@@ -165,7 +165,7 @@ acpi_release_global_lock:
|
||||
.access_attrib = AML::FieldRules::AccessAttrib::Normal,
|
||||
.access_length = 0
|
||||
};
|
||||
auto field_element = MUST(BAN::RefPtr<AML::FieldElement>::create(""sv, register_bit_offset, register_bit_width, field_rules));
|
||||
auto field_element = MUST(BAN::RefPtr<AML::FieldElement>::create(""_sv, register_bit_offset, register_bit_width, field_rules));
|
||||
field_element->op_region = op_region;
|
||||
|
||||
return field_element->store(MUST(BAN::RefPtr<AML::Integer>::create(value)));
|
||||
@@ -214,7 +214,7 @@ acpi_release_global_lock:
|
||||
|
||||
{
|
||||
ASSERT(!s_global_lock);
|
||||
const auto* fadt = static_cast<const FADT*>(ACPI::get().get_header("FACP"sv, 0));
|
||||
const auto* fadt = static_cast<const FADT*>(ACPI::get().get_header("FACP"_sv, 0));
|
||||
ASSERT(fadt);
|
||||
|
||||
uintptr_t facs_addr = fadt->firmware_ctrl;
|
||||
@@ -679,7 +679,7 @@ acpi_release_global_lock:
|
||||
return;
|
||||
|
||||
auto name = path.sv().substring(path.size() - 4);
|
||||
if (name.substring(0, 2) != "_L"sv && name.substring(0, 2) != "_E"sv)
|
||||
if (name.substring(0, 2) != "_L"_sv && name.substring(0, 2) != "_E"_sv)
|
||||
return;
|
||||
|
||||
auto index = hex_sv_to_int(name.substring(2));
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace Kernel::ACPI
|
||||
LockGuard _(m_object_mutex);
|
||||
|
||||
// Base must be non-empty absolute path
|
||||
ASSERT(relative_base.prefix == "\\"sv || relative_base.path.empty());
|
||||
ASSERT(relative_base.prefix == "\\"_sv || relative_base.path.empty());
|
||||
|
||||
// Do absolute path lookup
|
||||
if (!relative_path.prefix.empty() || relative_path.path.size() != 1 || mode == FindMode::ForceAbsolute)
|
||||
@@ -50,7 +50,7 @@ namespace Kernel::ACPI
|
||||
MUST(absolute_path.push_back('\\'));
|
||||
|
||||
// Resolve root and parent references
|
||||
if (relative_path.prefix == "\\"sv)
|
||||
if (relative_path.prefix == "\\"_sv)
|
||||
;
|
||||
else
|
||||
{
|
||||
@@ -76,7 +76,7 @@ namespace Kernel::ACPI
|
||||
if (absolute_path.back() == '.')
|
||||
absolute_path.pop_back();
|
||||
|
||||
if (!check_existence || absolute_path == "\\"sv || m_objects.contains(absolute_path))
|
||||
if (!check_existence || absolute_path == "\\"_sv || m_objects.contains(absolute_path))
|
||||
return absolute_path;
|
||||
return {};
|
||||
}
|
||||
@@ -125,7 +125,7 @@ namespace Kernel::ACPI
|
||||
if (!canonical_path.has_value())
|
||||
return nullptr;
|
||||
|
||||
if (canonical_path->sv() == "\\"sv)
|
||||
if (canonical_path->sv() == "\\"_sv)
|
||||
return this;
|
||||
|
||||
auto it = m_objects.find(canonical_path.value());
|
||||
@@ -191,28 +191,28 @@ namespace Kernel::ACPI
|
||||
BAN::RefPtr<AML::Namespace> AML::Namespace::create_root_namespace()
|
||||
{
|
||||
ASSERT(!s_root_namespace);
|
||||
s_root_namespace = MUST(BAN::RefPtr<Namespace>::create(NameSeg("\\"sv)));
|
||||
s_root_namespace->scope = AML::NameString("\\"sv);
|
||||
s_root_namespace = MUST(BAN::RefPtr<Namespace>::create(NameSeg("\\"_sv)));
|
||||
s_root_namespace->scope = AML::NameString("\\"_sv);
|
||||
|
||||
Integer::Constants::Zero = MUST(BAN::RefPtr<Integer>::create(0, true));
|
||||
Integer::Constants::One = MUST(BAN::RefPtr<Integer>::create(1, true));
|
||||
Integer::Constants::Ones = MUST(BAN::RefPtr<Integer>::create(0xFFFFFFFFFFFFFFFF, true));
|
||||
|
||||
AML::ParseContext context;
|
||||
context.scope = AML::NameString("\\"sv);
|
||||
context.scope = AML::NameString("\\"_sv);
|
||||
|
||||
// Add predefined namespaces
|
||||
#define ADD_PREDEFIED_NAMESPACE(NAME) \
|
||||
ASSERT(s_root_namespace->add_named_object(context, AML::NameString("\\" NAME), MUST(BAN::RefPtr<AML::Device>::create(NameSeg(NAME)))));
|
||||
ADD_PREDEFIED_NAMESPACE("_GPE"sv);
|
||||
ADD_PREDEFIED_NAMESPACE("_PR"sv);
|
||||
ADD_PREDEFIED_NAMESPACE("_SB"sv);
|
||||
ADD_PREDEFIED_NAMESPACE("_SI"sv);
|
||||
ADD_PREDEFIED_NAMESPACE("_TZ"sv);
|
||||
ADD_PREDEFIED_NAMESPACE("_GPE"_sv);
|
||||
ADD_PREDEFIED_NAMESPACE("_PR"_sv);
|
||||
ADD_PREDEFIED_NAMESPACE("_SB"_sv);
|
||||
ADD_PREDEFIED_NAMESPACE("_SI"_sv);
|
||||
ADD_PREDEFIED_NAMESPACE("_TZ"_sv);
|
||||
#undef ADD_PREDEFIED_NAMESPACE
|
||||
|
||||
// Add \_OSI that returns true for Linux compatibility
|
||||
auto osi = MUST(BAN::RefPtr<AML::Method>::create(NameSeg("_OSI"sv), 1, false, 0));
|
||||
auto osi = MUST(BAN::RefPtr<AML::Method>::create(NameSeg("_OSI"_sv), 1, false, 0));
|
||||
osi->override_function = [](AML::ParseContext& context) -> BAN::RefPtr<AML::Node> {
|
||||
ASSERT(context.method_args[0]);
|
||||
auto arg = context.method_args[0]->evaluate();
|
||||
@@ -234,7 +234,7 @@ namespace Kernel::ACPI
|
||||
ASSERT(this == s_root_namespace.ptr());
|
||||
|
||||
AML::ParseContext context;
|
||||
context.scope = AML::NameString("\\"sv);
|
||||
context.scope = AML::NameString("\\"_sv);
|
||||
context.aml_data = BAN::ConstByteSpan(reinterpret_cast<const uint8_t*>(&header), header.length).slice(sizeof(header));
|
||||
|
||||
while (context.aml_data.size() > 0)
|
||||
|
||||
@@ -94,7 +94,7 @@ namespace Kernel::ACPI
|
||||
AML_DEBUG_PRINTLN("Initializing {}", scope->scope);
|
||||
#endif
|
||||
|
||||
if (auto reg = Namespace::root_namespace()->find_object(scope->scope, AML::NameString("_REG"sv), Namespace::FindMode::ForceAbsolute))
|
||||
if (auto reg = Namespace::root_namespace()->find_object(scope->scope, AML::NameString("_REG"_sv), Namespace::FindMode::ForceAbsolute))
|
||||
{
|
||||
bool embedded_controller = false;
|
||||
Namespace::for_each_child(scope->scope,
|
||||
@@ -135,7 +135,7 @@ namespace Kernel::ACPI
|
||||
bool run_ini = true;
|
||||
bool init_children = true;
|
||||
|
||||
if (auto sta = Namespace::root_namespace()->find_object(scope->scope, AML::NameString("_STA"sv), Namespace::FindMode::ForceAbsolute))
|
||||
if (auto sta = Namespace::root_namespace()->find_object(scope->scope, AML::NameString("_STA"_sv), Namespace::FindMode::ForceAbsolute))
|
||||
{
|
||||
auto result = evaluate_or_invoke(sta);
|
||||
if (!result.has_value())
|
||||
@@ -150,7 +150,7 @@ namespace Kernel::ACPI
|
||||
|
||||
if (run_ini)
|
||||
{
|
||||
auto ini = Namespace::root_namespace()->find_object(scope->scope, AML::NameString("_INI"sv), Namespace::FindMode::ForceAbsolute);
|
||||
auto ini = Namespace::root_namespace()->find_object(scope->scope, AML::NameString("_INI"_sv), Namespace::FindMode::ForceAbsolute);
|
||||
if (ini)
|
||||
{
|
||||
if (ini->type != AML::Node::Type::Method)
|
||||
|
||||
@@ -132,7 +132,7 @@ namespace Kernel
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const MADT* madt = (const MADT*)ACPI::ACPI::get().get_header("APIC"sv, 0);
|
||||
const MADT* madt = (const MADT*)ACPI::ACPI::get().get_header("APIC"_sv, 0);
|
||||
if (madt == nullptr)
|
||||
{
|
||||
dprintln("Could not find MADT header");
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace Kernel
|
||||
|
||||
BAN::ErrorOr<BAN::String> Credentials::find_username() const
|
||||
{
|
||||
auto inode = TRY(VirtualFileSystem::get().file_from_absolute_path(*this, "/etc/passwd"sv, O_RDONLY)).inode;
|
||||
auto inode = TRY(VirtualFileSystem::get().file_from_absolute_path(*this, "/etc/passwd"_sv, O_RDONLY)).inode;
|
||||
|
||||
BAN::String line;
|
||||
off_t offset = 0;
|
||||
|
||||
@@ -436,8 +436,8 @@ done:
|
||||
auto inode = inode_or_error.release_value();
|
||||
BAN::ScopeGuard cleanup([&] { inode->cleanup_from_fs(); });
|
||||
|
||||
TRY(inode->link_inode_to_directory(*inode, "."sv));
|
||||
TRY(inode->link_inode_to_directory(*this, ".."sv));
|
||||
TRY(inode->link_inode_to_directory(*inode, "."_sv));
|
||||
TRY(inode->link_inode_to_directory(*this, ".."_sv));
|
||||
|
||||
TRY(link_inode_to_directory(*inode, name));
|
||||
|
||||
@@ -569,7 +569,7 @@ needs_new_block:
|
||||
if (entry.inode)
|
||||
{
|
||||
BAN::StringView entry_name(entry.name, entry.name_len);
|
||||
if (entry_name != "."sv && entry_name != ".."sv)
|
||||
if (entry_name != "."_sv && entry_name != ".."_sv)
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -608,12 +608,12 @@ needs_new_block:
|
||||
{
|
||||
BAN::StringView entry_name(entry.name, entry.name_len);
|
||||
|
||||
if (entry_name == "."sv)
|
||||
if (entry_name == "."_sv)
|
||||
{
|
||||
m_inode.links_count--;
|
||||
sync();
|
||||
}
|
||||
else if (entry_name == ".."sv)
|
||||
else if (entry_name == ".."_sv)
|
||||
{
|
||||
auto parent = TRY(Ext2Inode::create(m_fs, entry.inode));
|
||||
parent->m_inode.links_count--;
|
||||
|
||||
@@ -212,9 +212,10 @@ namespace Kernel
|
||||
return valid_entry_count;
|
||||
}
|
||||
|
||||
BAN::ErrorOr<size_t> FATInode::read_impl(off_t offset, BAN::ByteSpan buffer)
|
||||
BAN::ErrorOr<size_t> FATInode::read_impl(off_t s_offset, BAN::ByteSpan buffer)
|
||||
{
|
||||
ASSERT(offset >= 0);
|
||||
ASSERT(s_offset >= 0);
|
||||
uint32_t offset = s_offset;
|
||||
|
||||
if (offset >= m_entry.file_size)
|
||||
return 0;
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace Kernel
|
||||
LockGuard _(m_mutex);
|
||||
if (!mode().ifdir())
|
||||
return BAN::Error::from_errno(ENOTDIR);
|
||||
if (name == "."sv || name == ".."sv)
|
||||
if (name == "."_sv || name == ".."_sv)
|
||||
return BAN::Error::from_errno(EINVAL);
|
||||
return unlink_impl(name);
|
||||
}
|
||||
|
||||
@@ -12,9 +12,9 @@ namespace Kernel
|
||||
return BAN::Error::from_errno(ENOMEM);
|
||||
auto inode = BAN::RefPtr<ProcPidInode>::adopt(inode_ptr);
|
||||
|
||||
TRY(inode->link_inode(*MUST(ProcROInode::create_new(process, &Process::proc_meminfo, fs, 0400, uid, gid)), "meminfo"sv));
|
||||
TRY(inode->link_inode(*MUST(ProcROInode::create_new(process, &Process::proc_cmdline, fs, 0400, uid, gid)), "cmdline"sv));
|
||||
TRY(inode->link_inode(*MUST(ProcROInode::create_new(process, &Process::proc_environ, fs, 0400, uid, gid)), "environ"sv));
|
||||
TRY(inode->link_inode(*MUST(ProcROInode::create_new(process, &Process::proc_meminfo, fs, 0400, uid, gid)), "meminfo"_sv));
|
||||
TRY(inode->link_inode(*MUST(ProcROInode::create_new(process, &Process::proc_cmdline, fs, 0400, uid, gid)), "cmdline"_sv));
|
||||
TRY(inode->link_inode(*MUST(ProcROInode::create_new(process, &Process::proc_environ, fs, 0400, uid, gid)), "environ"_sv));
|
||||
|
||||
return inode;
|
||||
}
|
||||
@@ -27,9 +27,9 @@ namespace Kernel
|
||||
|
||||
void ProcPidInode::cleanup()
|
||||
{
|
||||
(void)TmpDirectoryInode::unlink_impl("meminfo"sv);
|
||||
(void)TmpDirectoryInode::unlink_impl("cmdline"sv);
|
||||
(void)TmpDirectoryInode::unlink_impl("environ"sv);
|
||||
(void)TmpDirectoryInode::unlink_impl("meminfo"_sv);
|
||||
(void)TmpDirectoryInode::unlink_impl("cmdline"_sv);
|
||||
(void)TmpDirectoryInode::unlink_impl("environ"_sv);
|
||||
}
|
||||
|
||||
BAN::ErrorOr<BAN::RefPtr<ProcROInode>> ProcROInode::create_new(Process& process, size_t (Process::*callback)(off_t, BAN::ByteSpan) const, TmpFileSystem& fs, mode_t mode, uid_t uid, gid_t gid)
|
||||
|
||||
@@ -342,8 +342,8 @@ namespace Kernel
|
||||
return BAN::Error::from_errno(ENOMEM);
|
||||
|
||||
auto inode = BAN::RefPtr<TmpDirectoryInode>::adopt(inode_ptr);
|
||||
TRY(inode->link_inode(*inode, "."sv));
|
||||
TRY(inode->link_inode(*inode, ".."sv));
|
||||
TRY(inode->link_inode(*inode, "."_sv));
|
||||
TRY(inode->link_inode(*inode, ".."_sv));
|
||||
|
||||
return inode;
|
||||
}
|
||||
@@ -358,8 +358,8 @@ namespace Kernel
|
||||
return BAN::Error::from_errno(ENOMEM);
|
||||
|
||||
auto inode = BAN::RefPtr<TmpDirectoryInode>::adopt(inode_ptr);
|
||||
TRY(inode->link_inode(*inode, "."sv));
|
||||
TRY(inode->link_inode(parent, ".."sv));
|
||||
TRY(inode->link_inode(*inode, "."_sv));
|
||||
TRY(inode->link_inode(parent, ".."_sv));
|
||||
|
||||
return inode;
|
||||
}
|
||||
@@ -381,9 +381,9 @@ namespace Kernel
|
||||
|
||||
bool is_empty = true;
|
||||
for_each_valid_entry([&](TmpDirectoryEntry& entry) {
|
||||
if (entry.name_sv() == "."sv)
|
||||
if (entry.name_sv() == "."_sv)
|
||||
dot_ino = entry.ino;
|
||||
else if (entry.name_sv() == ".."sv)
|
||||
else if (entry.name_sv() == ".."_sv)
|
||||
dotdot_ino = entry.ino;
|
||||
else
|
||||
{
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace Kernel
|
||||
ASSERT(!s_instance);
|
||||
s_instance = MUST(BAN::RefPtr<VirtualFileSystem>::create());
|
||||
|
||||
ASSERT(root_path.size() >= 5 && root_path.substring(0, 5) == "/dev/"sv);;
|
||||
ASSERT(root_path.size() >= 5 && root_path.substring(0, 5) == "/dev/"_sv);;
|
||||
root_path = root_path.substring(5);
|
||||
|
||||
auto root_inode = MUST(DevFileSystem::get().root_inode()->find_inode(root_path));
|
||||
@@ -26,12 +26,12 @@ namespace Kernel
|
||||
s_instance->m_root_fs = MUST(FileSystem::from_block_device(static_cast<BlockDevice*>(root_inode.ptr())));
|
||||
|
||||
Credentials root_creds { 0, 0, 0, 0 };
|
||||
MUST(s_instance->mount(root_creds, &DevFileSystem::get(), "/dev"sv));
|
||||
MUST(s_instance->mount(root_creds, &DevFileSystem::get(), "/dev"_sv));
|
||||
|
||||
MUST(s_instance->mount(root_creds, &ProcFileSystem::get(), "/proc"sv));
|
||||
MUST(s_instance->mount(root_creds, &ProcFileSystem::get(), "/proc"_sv));
|
||||
|
||||
auto tmpfs = MUST(TmpFileSystem::create(1024, 0777, 0, 0));
|
||||
MUST(s_instance->mount(root_creds, tmpfs, "/tmp"sv));
|
||||
MUST(s_instance->mount(root_creds, tmpfs, "/tmp"_sv));
|
||||
}
|
||||
|
||||
VirtualFileSystem& VirtualFileSystem::get()
|
||||
@@ -109,16 +109,16 @@ namespace Kernel
|
||||
const auto& path_part = path_parts.back();
|
||||
auto orig = inode;
|
||||
|
||||
if (path_part.empty() || path_part == "."sv)
|
||||
if (path_part.empty() || path_part == "."_sv)
|
||||
{
|
||||
|
||||
}
|
||||
else if (path_part == ".."sv)
|
||||
else if (path_part == ".."_sv)
|
||||
{
|
||||
if (auto* mount_point = mount_from_root_inode(inode))
|
||||
inode = TRY(mount_point->host.inode->find_inode(".."sv));
|
||||
inode = TRY(mount_point->host.inode->find_inode(".."_sv));
|
||||
else
|
||||
inode = TRY(inode->find_inode(".."sv));
|
||||
inode = TRY(inode->find_inode(".."_sv));
|
||||
|
||||
if (!canonical_path.empty())
|
||||
{
|
||||
|
||||
@@ -244,7 +244,7 @@ namespace Kernel::Input
|
||||
// FIXME: Initialise USB Controllers
|
||||
|
||||
// Determine if the PS/2 Controller Exists
|
||||
auto* fadt = static_cast<const ACPI::FADT*>(ACPI::ACPI::get().get_header("FACP"sv, 0));
|
||||
auto* fadt = static_cast<const ACPI::FADT*>(ACPI::ACPI::get().get_header("FACP"_sv, 0));
|
||||
if (fadt && fadt->revision > 1 && !(fadt->iapc_boot_arch & (1 << 1)))
|
||||
{
|
||||
dwarnln_if(DEBUG_PS2, "No PS/2 available");
|
||||
|
||||
20
kernel/kernel/Networking/NetworkLayer.cpp
Normal file
20
kernel/kernel/Networking/NetworkLayer.cpp
Normal file
@@ -0,0 +1,20 @@
|
||||
#include <kernel/Networking/NetworkLayer.h>
|
||||
|
||||
namespace Kernel
|
||||
{
|
||||
|
||||
uint16_t calculate_internet_checksum(BAN::ConstByteSpan packet, const PseudoHeader& pseudo_header)
|
||||
{
|
||||
uint32_t checksum = 0;
|
||||
for (size_t i = 0; i < sizeof(pseudo_header) / sizeof(uint16_t); i++)
|
||||
checksum += BAN::host_to_network_endian(reinterpret_cast<const uint16_t*>(&pseudo_header)[i]);
|
||||
for (size_t i = 0; i < packet.size() / sizeof(uint16_t); i++)
|
||||
checksum += BAN::host_to_network_endian(reinterpret_cast<const uint16_t*>(packet.data())[i]);
|
||||
if (packet.size() % 2)
|
||||
checksum += (uint16_t)packet[packet.size() - 1] << 8;
|
||||
while (checksum >> 16)
|
||||
checksum = (checksum >> 16) + (checksum & 0xFFFF);
|
||||
return ~(uint16_t)checksum;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -65,7 +65,7 @@ namespace Kernel
|
||||
|
||||
int fd = TRY(get_free_fd());
|
||||
// FIXME: path?
|
||||
m_open_files[fd] = TRY(BAN::RefPtr<OpenFileDescription>::create(inode, ""sv, 0, flags));
|
||||
m_open_files[fd] = TRY(BAN::RefPtr<OpenFileDescription>::create(inode, ""_sv, 0, flags));
|
||||
|
||||
return fd;
|
||||
}
|
||||
@@ -141,7 +141,7 @@ namespace Kernel
|
||||
auto socket = TRY(NetworkManager::get().create_socket(sock_domain, sock_type, 0777, m_credentials.euid(), m_credentials.egid()));
|
||||
|
||||
int fd = TRY(get_free_fd());
|
||||
m_open_files[fd] = TRY(BAN::RefPtr<OpenFileDescription>::create(socket, "no-path"sv, 0, O_RDWR));
|
||||
m_open_files[fd] = TRY(BAN::RefPtr<OpenFileDescription>::create(socket, "no-path"_sv, 0, O_RDWR));
|
||||
return fd;
|
||||
}
|
||||
|
||||
@@ -150,8 +150,8 @@ namespace Kernel
|
||||
TRY(get_free_fd_pair(fds));
|
||||
|
||||
auto pipe = TRY(Pipe::create(m_credentials));
|
||||
m_open_files[fds[0]] = TRY(BAN::RefPtr<OpenFileDescription>::create(pipe, ""sv, 0, O_RDONLY));
|
||||
m_open_files[fds[1]] = TRY(BAN::RefPtr<OpenFileDescription>::create(pipe, ""sv, 0, O_WRONLY));
|
||||
m_open_files[fds[0]] = TRY(BAN::RefPtr<OpenFileDescription>::create(pipe, ""_sv, 0, O_RDONLY));
|
||||
m_open_files[fds[1]] = TRY(BAN::RefPtr<OpenFileDescription>::create(pipe, ""_sv, 0, O_WRONLY));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ namespace Kernel
|
||||
TRY(process->m_cmdline.push_back({}));
|
||||
TRY(process->m_cmdline.back().append(path));
|
||||
|
||||
process->m_loadable_elf = TRY(load_elf_for_exec(credentials, path, "/"sv, process->page_table()));
|
||||
process->m_loadable_elf = TRY(load_elf_for_exec(credentials, path, "/"_sv, process->page_table()));
|
||||
if (!process->m_loadable_elf->is_address_space_free())
|
||||
{
|
||||
dprintln("Could not load ELF address space");
|
||||
@@ -1942,7 +1942,7 @@ namespace Kernel
|
||||
{
|
||||
LockGuard _(m_process_lock);
|
||||
|
||||
if (path.empty() || path == "."sv)
|
||||
if (path.empty() || path == "."_sv)
|
||||
return m_working_directory;
|
||||
|
||||
BAN::String absolute_path;
|
||||
|
||||
@@ -30,11 +30,11 @@ namespace Kernel
|
||||
s_tty = this;
|
||||
clear();
|
||||
|
||||
auto inode_or_error = DevFileSystem::get().root_inode()->find_inode("tty"sv);
|
||||
auto inode_or_error = DevFileSystem::get().root_inode()->find_inode("tty"_sv);
|
||||
if (inode_or_error.is_error())
|
||||
{
|
||||
if (inode_or_error.error().get_error_code() == ENOENT)
|
||||
DevFileSystem::get().add_inode("tty"sv, MUST(TmpSymlinkInode::create_new(DevFileSystem::get(), 0666, 0, 0, s_tty->name())));
|
||||
DevFileSystem::get().add_inode("tty"_sv, MUST(TmpSymlinkInode::create_new(DevFileSystem::get(), 0666, 0, 0, s_tty->name())));
|
||||
else
|
||||
dwarnln("{}", inode_or_error.error());
|
||||
return;
|
||||
@@ -82,7 +82,7 @@ namespace Kernel
|
||||
Process::create_kernel(
|
||||
[](void*)
|
||||
{
|
||||
auto file_or_error = VirtualFileSystem::get().file_from_absolute_path({ 0, 0, 0, 0 }, "/dev/input0"sv, O_RDONLY);
|
||||
auto file_or_error = VirtualFileSystem::get().file_from_absolute_path({ 0, 0, 0, 0 }, "/dev/input0"_sv, O_RDONLY);
|
||||
if (file_or_error.is_error())
|
||||
{
|
||||
dprintln("no input device found");
|
||||
|
||||
@@ -131,7 +131,7 @@ namespace Kernel
|
||||
|
||||
BAN::ErrorOr<void> HPET::initialize(bool force_pic)
|
||||
{
|
||||
auto* header = static_cast<const ACPI::HPET*>(ACPI::ACPI::get().get_header("HPET"sv, 0));
|
||||
auto* header = static_cast<const ACPI::HPET*>(ACPI::ACPI::get().get_header("HPET"_sv, 0));
|
||||
if (header == nullptr)
|
||||
return BAN::Error::from_errno(ENODEV);
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ struct ParsedCommandLine
|
||||
{
|
||||
bool force_pic = false;
|
||||
bool disable_serial = false;
|
||||
BAN::StringView console = "tty0"sv;
|
||||
BAN::StringView console = "tty0"_sv;
|
||||
BAN::StringView root;
|
||||
};
|
||||
|
||||
@@ -215,7 +215,7 @@ static void init2(void*)
|
||||
|
||||
TTY::initialize_devices();
|
||||
|
||||
MUST(Process::create_userspace({ 0, 0, 0, 0 }, "/usr/bin/init"sv));
|
||||
MUST(Process::create_userspace({ 0, 0, 0, 0 }, "/usr/bin/init"_sv));
|
||||
}
|
||||
|
||||
extern "C" void ap_main()
|
||||
|
||||
Reference in New Issue
Block a user