mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 05:07:45 +00:00
Kernel/aarch64: Stub enough functions to build Process.cpp
ProcessProcFSTraits.cpp is also added the CMakeLists.
This commit is contained in:
parent
84158a18d5
commit
179cb7b2d0
2 changed files with 248 additions and 12 deletions
|
@ -7,13 +7,16 @@
|
||||||
#include <AK/Singleton.h>
|
#include <AK/Singleton.h>
|
||||||
#include <AK/Types.h>
|
#include <AK/Types.h>
|
||||||
|
|
||||||
|
#include <Kernel/Coredump.h>
|
||||||
#include <Kernel/FileSystem/Inode.h>
|
#include <Kernel/FileSystem/Inode.h>
|
||||||
|
#include <Kernel/FileSystem/ProcFS.h>
|
||||||
#include <Kernel/KString.h>
|
#include <Kernel/KString.h>
|
||||||
#include <Kernel/Locking/SpinlockProtected.h>
|
#include <Kernel/Locking/SpinlockProtected.h>
|
||||||
#include <Kernel/Memory/SharedInodeVMObject.h>
|
#include <Kernel/Memory/SharedInodeVMObject.h>
|
||||||
#include <Kernel/Panic.h>
|
#include <Kernel/Panic.h>
|
||||||
#include <Kernel/PhysicalAddress.h>
|
#include <Kernel/PhysicalAddress.h>
|
||||||
#include <Kernel/Process.h>
|
#include <Kernel/Process.h>
|
||||||
|
#include <Kernel/ProcessExposed.h>
|
||||||
#include <Kernel/Random.h>
|
#include <Kernel/Random.h>
|
||||||
#include <Kernel/Scheduler.h>
|
#include <Kernel/Scheduler.h>
|
||||||
#include <Kernel/Sections.h>
|
#include <Kernel/Sections.h>
|
||||||
|
@ -33,64 +36,234 @@ void get_fast_random_bytes(Bytes)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Process
|
// Process
|
||||||
|
char const* asm_signal_trampoline = nullptr;
|
||||||
|
char const* asm_signal_trampoline_end = nullptr;
|
||||||
|
|
||||||
namespace Kernel {
|
namespace Kernel {
|
||||||
|
|
||||||
SpinlockProtected<Process::List>& Process::all_instances()
|
ProcessID g_init_pid { 0 };
|
||||||
|
|
||||||
|
bool Process::has_tracee_thread(ProcessID)
|
||||||
{
|
{
|
||||||
TODO_AARCH64();
|
TODO_AARCH64();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Process::remove_thread(Kernel::Thread&)
|
ErrorOr<void> Process::exec(NonnullOwnPtr<KString>, NonnullOwnPtrVector<KString>, NonnullOwnPtrVector<KString>, Thread*&, u32&, int)
|
||||||
{
|
{
|
||||||
TODO_AARCH64();
|
TODO_AARCH64();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Process::finalize()
|
}
|
||||||
|
|
||||||
|
// OpenFileDescription
|
||||||
|
namespace Kernel {
|
||||||
|
|
||||||
|
OpenFileDescription::~OpenFileDescription()
|
||||||
{
|
{
|
||||||
TODO_AARCH64();
|
TODO_AARCH64();
|
||||||
}
|
}
|
||||||
|
|
||||||
LockRefPtr<Process> Process::from_pid(Kernel::ProcessID)
|
ErrorOr<size_t> OpenFileDescription::write(UserOrKernelBuffer const&, size_t)
|
||||||
{
|
{
|
||||||
TODO_AARCH64();
|
TODO_AARCH64();
|
||||||
}
|
}
|
||||||
|
|
||||||
LockRefPtr<Thread> Process::create_kernel_thread(void (*)(void*), void*, u32, NonnullOwnPtr<KString>, u32, bool)
|
}
|
||||||
|
|
||||||
|
// Custody
|
||||||
|
namespace Kernel {
|
||||||
|
|
||||||
|
SpinlockProtected<Custody::AllCustodiesList>& Custody::all_instances()
|
||||||
{
|
{
|
||||||
TODO_AARCH64();
|
TODO_AARCH64();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Process::add_thread(Thread&)
|
Custody::~Custody()
|
||||||
{
|
{
|
||||||
TODO_AARCH64();
|
TODO_AARCH64();
|
||||||
}
|
}
|
||||||
|
|
||||||
Process::~Process()
|
}
|
||||||
|
|
||||||
|
// VirtualFileSystem
|
||||||
|
namespace Kernel {
|
||||||
|
|
||||||
|
VirtualFileSystem& VirtualFileSystem::the()
|
||||||
{
|
{
|
||||||
TODO_AARCH64();
|
TODO_AARCH64();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Process::unblock_waiters(Thread::WaitBlocker::UnblockFlags, u8)
|
NonnullRefPtr<Custody> VirtualFileSystem::root_custody()
|
||||||
{
|
{
|
||||||
TODO_AARCH64();
|
TODO_AARCH64();
|
||||||
}
|
}
|
||||||
|
|
||||||
ErrorOr<void> Process::send_signal(u8, Process*)
|
ErrorOr<NonnullLockRefPtr<OpenFileDescription>> VirtualFileSystem::open(Credentials const&, StringView, int, mode_t, Custody&, Optional<UidAndGid>)
|
||||||
{
|
{
|
||||||
TODO_AARCH64();
|
TODO_AARCH64();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Process::terminate_due_to_signal(u8)
|
}
|
||||||
|
|
||||||
|
// ProcFS
|
||||||
|
namespace Kernel {
|
||||||
|
|
||||||
|
ProcFSInode::~ProcFSInode()
|
||||||
{
|
{
|
||||||
TODO_AARCH64();
|
TODO_AARCH64();
|
||||||
}
|
}
|
||||||
|
|
||||||
ProcessID Process::allocate_pid()
|
ErrorOr<NonnullLockRefPtr<ProcFSProcessDirectoryInode>> ProcFSProcessDirectoryInode::try_create(ProcFS const&, ProcessID)
|
||||||
{
|
{
|
||||||
TODO_AARCH64();
|
TODO_AARCH64();
|
||||||
}
|
}
|
||||||
|
|
||||||
NonnullRefPtr<Credentials> Process::credentials() const
|
ProcFSComponentRegistry& ProcFSComponentRegistry::the()
|
||||||
|
{
|
||||||
|
TODO_AARCH64();
|
||||||
|
}
|
||||||
|
|
||||||
|
ErrorOr<NonnullLockRefPtr<Inode>> ProcFSInode::create_child(StringView, mode_t, dev_t, UserID, GroupID)
|
||||||
|
{
|
||||||
|
TODO_AARCH64();
|
||||||
|
}
|
||||||
|
|
||||||
|
ErrorOr<void> ProcFSInode::add_child(Inode&, StringView, mode_t)
|
||||||
|
{
|
||||||
|
TODO_AARCH64();
|
||||||
|
}
|
||||||
|
|
||||||
|
ErrorOr<void> ProcFSInode::remove_child(StringView)
|
||||||
|
{
|
||||||
|
TODO_AARCH64();
|
||||||
|
}
|
||||||
|
|
||||||
|
ErrorOr<void> ProcFSInode::chmod(mode_t)
|
||||||
|
{
|
||||||
|
TODO_AARCH64();
|
||||||
|
}
|
||||||
|
|
||||||
|
ErrorOr<void> ProcFSInode::chown(UserID, GroupID)
|
||||||
|
{
|
||||||
|
TODO_AARCH64();
|
||||||
|
}
|
||||||
|
|
||||||
|
ErrorOr<void> ProcFSInode::flush_metadata()
|
||||||
|
{
|
||||||
|
TODO_AARCH64();
|
||||||
|
}
|
||||||
|
|
||||||
|
ErrorOr<void> ProcFSGlobalInode::attach(OpenFileDescription&)
|
||||||
|
{
|
||||||
|
TODO_AARCH64();
|
||||||
|
}
|
||||||
|
|
||||||
|
ErrorOr<size_t> ProcFSGlobalInode::read_bytes_locked(off_t, size_t, UserOrKernelBuffer&, OpenFileDescription*) const
|
||||||
|
{
|
||||||
|
TODO_AARCH64();
|
||||||
|
}
|
||||||
|
|
||||||
|
StringView ProcFSGlobalInode::name() const
|
||||||
|
{
|
||||||
|
TODO_AARCH64();
|
||||||
|
}
|
||||||
|
|
||||||
|
ErrorOr<void> ProcFSGlobalInode::traverse_as_directory(Function<ErrorOr<void>(FileSystem::DirectoryEntryView const&)>) const
|
||||||
|
{
|
||||||
|
TODO_AARCH64();
|
||||||
|
}
|
||||||
|
|
||||||
|
ErrorOr<NonnullLockRefPtr<Inode>> ProcFSGlobalInode::lookup(StringView)
|
||||||
|
{
|
||||||
|
TODO_AARCH64();
|
||||||
|
}
|
||||||
|
|
||||||
|
ErrorOr<void> ProcFSGlobalInode::truncate(u64)
|
||||||
|
{
|
||||||
|
TODO_AARCH64();
|
||||||
|
}
|
||||||
|
|
||||||
|
ErrorOr<void> ProcFSGlobalInode::update_timestamps(Optional<time_t>, Optional<time_t>, Optional<time_t>)
|
||||||
|
{
|
||||||
|
TODO_AARCH64();
|
||||||
|
}
|
||||||
|
|
||||||
|
InodeMetadata ProcFSGlobalInode::metadata() const
|
||||||
|
{
|
||||||
|
TODO_AARCH64();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ProcFSGlobalInode::did_seek(OpenFileDescription&, off_t)
|
||||||
|
{
|
||||||
|
TODO_AARCH64();
|
||||||
|
}
|
||||||
|
|
||||||
|
ErrorOr<size_t> ProcFSGlobalInode::write_bytes_locked(off_t, size_t, UserOrKernelBuffer const&, OpenFileDescription*)
|
||||||
|
{
|
||||||
|
TODO_AARCH64();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// ProcessGroup
|
||||||
|
namespace Kernel {
|
||||||
|
|
||||||
|
ProcessGroup::~ProcessGroup()
|
||||||
|
{
|
||||||
|
TODO_AARCH64();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// ProcessExposed
|
||||||
|
namespace Kernel {
|
||||||
|
|
||||||
|
ErrorOr<NonnullLockRefPtr<Inode>> ProcFSExposedComponent::to_inode(ProcFS const&) const
|
||||||
|
{
|
||||||
|
TODO_AARCH64();
|
||||||
|
}
|
||||||
|
|
||||||
|
InodeIndex SegmentedProcFSIndex::build_segmented_index_for_main_property_in_pid_directory(ProcessID, SegmentedProcFSIndex::MainProcessProperty)
|
||||||
|
{
|
||||||
|
TODO_AARCH64();
|
||||||
|
}
|
||||||
|
|
||||||
|
InodeIndex SegmentedProcFSIndex::build_segmented_index_for_pid_directory(ProcessID)
|
||||||
|
{
|
||||||
|
TODO_AARCH64();
|
||||||
|
}
|
||||||
|
|
||||||
|
InodeIndex SegmentedProcFSIndex::build_segmented_index_for_sub_directory(ProcessID, ProcessSubDirectory)
|
||||||
|
{
|
||||||
|
TODO_AARCH64();
|
||||||
|
}
|
||||||
|
|
||||||
|
ProcFSExposedComponent::ProcFSExposedComponent()
|
||||||
|
{
|
||||||
|
TODO_AARCH64();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// FileSystem
|
||||||
|
namespace Kernel {
|
||||||
|
|
||||||
|
FileSystem::DirectoryEntryView::DirectoryEntryView(StringView, InodeIdentifier, u8)
|
||||||
|
{
|
||||||
|
TODO_AARCH64();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Coredump
|
||||||
|
namespace Kernel {
|
||||||
|
|
||||||
|
ErrorOr<NonnullOwnPtr<Coredump>> Coredump::try_create(NonnullLockRefPtr<Process>, StringView)
|
||||||
|
{
|
||||||
|
TODO_AARCH64();
|
||||||
|
}
|
||||||
|
|
||||||
|
ErrorOr<void> Coredump::write()
|
||||||
{
|
{
|
||||||
TODO_AARCH64();
|
TODO_AARCH64();
|
||||||
}
|
}
|
||||||
|
@ -164,6 +337,31 @@ bool Thread::WaitQueueBlocker::unblock()
|
||||||
TODO_AARCH64();
|
TODO_AARCH64();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Thread::WaitBlockerSet::finalize()
|
||||||
|
{
|
||||||
|
TODO_AARCH64();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Thread::WaitBlockerSet::unblock(Process&, WaitBlocker::UnblockFlags, u8)
|
||||||
|
{
|
||||||
|
TODO_AARCH64();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Thread::WaitBlockerSet::disowned_by_waiter(Process&)
|
||||||
|
{
|
||||||
|
TODO_AARCH64();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Thread::WaitBlockerSet::should_add_blocker(Blocker&, void*)
|
||||||
|
{
|
||||||
|
TODO_AARCH64();
|
||||||
|
}
|
||||||
|
|
||||||
|
Thread::WaitBlockerSet::ProcessBlockInfo::~ProcessBlockInfo()
|
||||||
|
{
|
||||||
|
TODO_AARCH64();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// PerformanceEventBuffer
|
// PerformanceEventBuffer
|
||||||
|
@ -177,6 +375,27 @@ ErrorOr<void> PerformanceEventBuffer::append(int, unsigned long, unsigned long,
|
||||||
TODO_AARCH64();
|
TODO_AARCH64();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
OwnPtr<PerformanceEventBuffer> PerformanceEventBuffer::try_create_with_size(size_t)
|
||||||
|
{
|
||||||
|
TODO_AARCH64();
|
||||||
|
}
|
||||||
|
|
||||||
|
ErrorOr<void> PerformanceEventBuffer::add_process(Process const&, ProcessEventType)
|
||||||
|
{
|
||||||
|
TODO_AARCH64();
|
||||||
|
}
|
||||||
|
|
||||||
|
ErrorOr<void> PerformanceEventBuffer::to_json(KBufferBuilder&) const
|
||||||
|
{
|
||||||
|
TODO_AARCH64();
|
||||||
|
}
|
||||||
|
|
||||||
|
ErrorOr<void> PerformanceEventBuffer::append_with_ip_and_bp(ProcessID, ThreadID,
|
||||||
|
FlatPtr, FlatPtr, int, u32, FlatPtr, FlatPtr, StringView, FlatPtr, u64, ErrorOr<FlatPtr>)
|
||||||
|
{
|
||||||
|
TODO_AARCH64();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// LockRank
|
// LockRank
|
||||||
|
@ -227,6 +446,21 @@ ErrorOr<size_t> Inode::write_bytes(off_t, size_t, UserOrKernelBuffer const&, Ope
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ErrorOr<void> Inode::update_timestamps([[maybe_unused]] Optional<time_t> atime, [[maybe_unused]] Optional<time_t> ctime, [[maybe_unused]] Optional<time_t> mtime)
|
||||||
|
{
|
||||||
|
TODO_AARCH64();
|
||||||
|
}
|
||||||
|
|
||||||
|
ErrorOr<void> Inode::increment_link_count()
|
||||||
|
{
|
||||||
|
TODO_AARCH64();
|
||||||
|
}
|
||||||
|
|
||||||
|
ErrorOr<void> Inode::decrement_link_count()
|
||||||
|
{
|
||||||
|
TODO_AARCH64();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// x86 init
|
// x86 init
|
||||||
|
|
|
@ -504,6 +504,8 @@ else()
|
||||||
KString.cpp
|
KString.cpp
|
||||||
KSyms.cpp
|
KSyms.cpp
|
||||||
MiniStdLib.cpp
|
MiniStdLib.cpp
|
||||||
|
Process.cpp
|
||||||
|
ProcessProcFSTraits.cpp
|
||||||
Scheduler.cpp
|
Scheduler.cpp
|
||||||
StdLib.cpp
|
StdLib.cpp
|
||||||
Time/TimeManagement.cpp
|
Time/TimeManagement.cpp
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue