Get the second process elf from a MemoryObject instead of hardcoding.

Allows us to delete the CopyIntoNonResidentProcess function and simply
rely on the MemoryObject copy functions.
This commit is contained in:
Drew Galbraith 2023-06-07 00:19:15 -07:00
parent eb454300e6
commit e246f28d9c
7 changed files with 24 additions and 45 deletions

View file

@ -99,3 +99,8 @@ uint64_t Process::AddCapability(const RefPtr<MemoryObject>& mo) {
new Capability(mo, Capability::MEMORY_OBJECT, cap_id, ZC_WRITE));
return cap_id;
}
void Process::AddCapability(uint64_t cap_id, const RefPtr<MemoryObject>& mo) {
caps_.PushBack(
new Capability(mo, Capability::MEMORY_OBJECT, cap_id, ZC_WRITE));
}

View file

@ -33,6 +33,8 @@ class Process : public KernelObject {
uint64_t AddCapability(const RefPtr<Process>& p);
uint64_t AddCapability(const RefPtr<AddressSpace>& as);
uint64_t AddCapability(const RefPtr<MemoryObject>& mo);
void AddCapability(uint64_t cap_id, const RefPtr<MemoryObject>& mo);
// Checks the state of all child threads and transitions to
// finished if all have finished.
void CheckState();