early-access version 1658

This commit is contained in:
pineappleEA 2021-05-06 02:29:20 +02:00
parent 0a3af2c776
commit 590872e3be
6 changed files with 12 additions and 21 deletions

View File

@ -1,7 +1,7 @@
yuzu emulator early access yuzu emulator early access
============= =============
This is the source code for early-access 1656. This is the source code for early-access 1658.
## Legal Notice ## Legal Notice

View File

@ -127,6 +127,7 @@ ResultCode KProcess::Initialize(KProcess* process, Core::System& system, std::st
process->resource_limit = kernel.GetSystemResourceLimit(); process->resource_limit = kernel.GetSystemResourceLimit();
process->status = ProcessStatus::Created; process->status = ProcessStatus::Created;
process->program_id = 0; process->program_id = 0;
process->system = &system;
process->process_id = type == ProcessType::KernelInternal ? kernel.CreateNewKernelProcessID() process->process_id = type == ProcessType::KernelInternal ? kernel.CreateNewKernelProcessID()
: kernel.CreateNewUserProcessID(); : kernel.CreateNewUserProcessID();
process->capabilities.InitializeForMetadatalessProcess(); process->capabilities.InitializeForMetadatalessProcess();
@ -367,7 +368,7 @@ void KProcess::Run(s32 main_thread_priority, u64 stack_size) {
ChangeStatus(ProcessStatus::Running); ChangeStatus(ProcessStatus::Running);
SetupMainThread(kernel.System(), *this, main_thread_priority, main_thread_stack_top); SetupMainThread(*system, *this, main_thread_priority, main_thread_stack_top);
} }
void KProcess::PrepareForTermination() { void KProcess::PrepareForTermination() {
@ -389,7 +390,7 @@ void KProcess::PrepareForTermination() {
} }
}; };
stop_threads(kernel.System().GlobalSchedulerContext().GetThreadList()); stop_threads(system->GlobalSchedulerContext().GetThreadList());
FreeTLSRegion(tls_region_address); FreeTLSRegion(tls_region_address);
tls_region_address = 0; tls_region_address = 0;
@ -437,7 +438,7 @@ VAddr KProcess::CreateTLSRegion() {
const VAddr start{page_table->GetKernelMapRegionStart()}; const VAddr start{page_table->GetKernelMapRegionStart()};
const VAddr size{page_table->GetKernelMapRegionEnd() - start}; const VAddr size{page_table->GetKernelMapRegionEnd() - start};
const PAddr tls_map_addr{kernel.System().DeviceMemory().GetPhysicalAddr(tls_page_ptr)}; const PAddr tls_map_addr{system->DeviceMemory().GetPhysicalAddr(tls_page_ptr)};
const VAddr tls_page_addr{page_table const VAddr tls_page_addr{page_table
->AllocateAndMapMemory(1, PageSize, true, start, size / PageSize, ->AllocateAndMapMemory(1, PageSize, true, start, size / PageSize,
KMemoryState::ThreadLocal, KMemoryState::ThreadLocal,
@ -478,8 +479,7 @@ void KProcess::LoadModule(CodeSet code_set, VAddr base_addr) {
page_table->SetCodeMemoryPermission(segment.addr + base_addr, segment.size, permission); page_table->SetCodeMemoryPermission(segment.addr + base_addr, segment.size, permission);
}; };
kernel.System().Memory().WriteBlock(*this, base_addr, code_set.memory.data(), system->Memory().WriteBlock(*this, base_addr, code_set.memory.data(), code_set.memory.size());
code_set.memory.size());
ReprotectSegment(code_set.CodeSegment(), KMemoryPermission::ReadAndExecute); ReprotectSegment(code_set.CodeSegment(), KMemoryPermission::ReadAndExecute);
ReprotectSegment(code_set.RODataSegment(), KMemoryPermission::Read); ReprotectSegment(code_set.RODataSegment(), KMemoryPermission::Read);
@ -492,9 +492,9 @@ bool KProcess::IsSignaled() const {
} }
KProcess::KProcess(KernelCore& kernel) KProcess::KProcess(KernelCore& kernel)
: KAutoObjectWithSlabHeapAndContainer{kernel}, : KAutoObjectWithSlabHeapAndContainer{kernel}, page_table{std::make_unique<KPageTable>(
page_table{std::make_unique<KPageTable>(kernel.System())}, handle_table{kernel}, *system)},
address_arbiter{kernel.System()}, condition_var{kernel.System()}, state_lock{kernel} {} handle_table{kernel}, address_arbiter{*system}, condition_var{*system}, state_lock{kernel} {}
KProcess::~KProcess() = default; KProcess::~KProcess() = default;

View File

@ -477,6 +477,8 @@ private:
KThread* exception_thread{}; KThread* exception_thread{};
Core::System* system{};
KLightLock state_lock; KLightLock state_lock;
}; };

View File

@ -1013,12 +1013,4 @@ void KernelCore::SetIsPhantomModeForSingleCore(bool value) {
impl->SetIsPhantomModeForSingleCore(value); impl->SetIsPhantomModeForSingleCore(value);
} }
Core::System& KernelCore::System() {
return impl->system;
}
const Core::System& KernelCore::System() const {
return impl->system;
}
} // namespace Kernel } // namespace Kernel

View File

@ -265,9 +265,6 @@ public:
bool IsPhantomModeForSingleCore() const; bool IsPhantomModeForSingleCore() const;
void SetIsPhantomModeForSingleCore(bool value); void SetIsPhantomModeForSingleCore(bool value);
Core::System& System();
const Core::System& System() const;
/// Gets the slab heap for the specified kernel object type. /// Gets the slab heap for the specified kernel object type.
template <typename T> template <typename T>
KSlabHeap<T>& SlabHeap() { KSlabHeap<T>& SlabHeap() {

View File

@ -40,7 +40,7 @@ void NVDRV::Open(Kernel::HLERequestContext& ctx) {
rb.Push<DeviceFD>(0); rb.Push<DeviceFD>(0);
rb.PushEnum(NvResult::NotSupported); rb.PushEnum(NvResult::NotSupported);
LOG_WARNING(Service_NVDRV, "/dev/nvhost-prof-gpu cannot be openned on production"); LOG_WARNING(Service_NVDRV, "/dev/nvhost-prof-gpu cannot be opened in production");
return; return;
} }