mirror of
https://github.com/RPCSX/rpcsx.git
synced 2025-12-06 07:12:14 +01:00
Compare commits
4 commits
f5326644fa
...
a1c4170048
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a1c4170048 | ||
|
|
5b3bc0e97a | ||
|
|
0ce879d966 | ||
|
|
0f11b4020d |
|
|
@ -2,13 +2,15 @@ FROM --platform=linux/amd64 ubuntu:rolling
|
|||
|
||||
ARG USER
|
||||
|
||||
RUN wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
|
||||
RUN echo "Types: deb \n\
|
||||
URIs: http://apt.llvm.org/questing/ \n\
|
||||
Suites: llvm-toolchain-questing \n\
|
||||
Components: main \n\
|
||||
Signed-By: /etc/apt/trusted.gpg.d/apt.llvm.org.asc\n" > /etc/apt/sources.list.d/llvm.sources
|
||||
RUN cat /etc/apt/sources.list.d/llvm.sources
|
||||
RUN apt update
|
||||
RUN apt install -y sudo wget git pkgconf
|
||||
RUN apt install -y build-essential cmake libunwind-dev libglfw3-dev libvulkan-dev libsox-dev git libasound2-dev nasm g++-14
|
||||
RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
|
||||
RUN echo "deb http://apt.llvm.org/oracular/ llvm-toolchain-oracular main" | tee -a /etc/apt/sources.list
|
||||
RUN apt update
|
||||
RUN apt install -y clangd
|
||||
RUN apt install -y sudo wget git pkgconf clangd build-essential cmake libunwind-dev libglfw3-dev libvulkan-dev libsox-dev git libasound2-dev nasm g++-14
|
||||
RUN deluser ubuntu || echo
|
||||
RUN useradd -m ${USER}
|
||||
RUN echo ${USER} ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/${USER} \
|
||||
|
|
|
|||
|
|
@ -9,7 +9,8 @@
|
|||
"--cap-add=SYS_PTRACE",
|
||||
"--security-opt",
|
||||
"seccomp=unconfined",
|
||||
"--platform", "linux/amd64"
|
||||
"--platform", "linux/amd64",
|
||||
// "--gpus", "all"
|
||||
],
|
||||
"updateRemoteUserUID": true,
|
||||
"remoteUser": "${localEnv:USER}",
|
||||
|
|
|
|||
|
|
@ -261,8 +261,10 @@ static void release(orbis::Process *process, decltype(g_vmInstance)::type *vmem,
|
|||
|
||||
auto blockRange = range.intersection(it.range());
|
||||
|
||||
auto gpuProt = orbis::vmem::toGpuProtection(it->prot);
|
||||
if (it->flags & orbis::vmem::BlockFlags::FlexibleMemory) {
|
||||
if (it->device == nullptr) {
|
||||
if (it->device == nullptr && gpuProt) {
|
||||
amdgpu::unmapMemory(process->pid, blockRange);
|
||||
orbis::fmem::deallocate(blockRange);
|
||||
}
|
||||
budget->release(orbis::BudgetResource::Fmem, blockRange.size());
|
||||
|
|
@ -281,9 +283,8 @@ static void release(orbis::Process *process, decltype(g_vmInstance)::type *vmem,
|
|||
}
|
||||
}
|
||||
|
||||
if (orbis::vmem::toGpuProtection(it->prot) &&
|
||||
(it->flags & orbis::vmem::BlockFlags::DirectMemory |
|
||||
orbis::vmem::BlockFlags::PooledMemory)) {
|
||||
if (gpuProt && (it->flags & orbis::vmem::BlockFlags::DirectMemory |
|
||||
orbis::vmem::BlockFlags::PooledMemory)) {
|
||||
amdgpu::unmapMemory(process->pid, blockRange);
|
||||
}
|
||||
}
|
||||
|
|
@ -566,7 +567,8 @@ std::pair<rx::AddressRange, orbis::ErrorCode> orbis::vmem::mapFile(
|
|||
blockpool::releaseControlBlock();
|
||||
}
|
||||
|
||||
rx::println(stderr, "map: device allocation failure, blockFlags {}", blockFlags);
|
||||
rx::println(stderr, "map: device allocation failure, blockFlags {}",
|
||||
blockFlags);
|
||||
return {{}, error};
|
||||
}
|
||||
|
||||
|
|
@ -823,7 +825,13 @@ std::pair<rx::AddressRange, orbis::ErrorCode> orbis::vmem::mapFlex(
|
|||
AllocationFlags::Fixed | (allocFlags & AllocationFlags::NoMerge),
|
||||
alignment);
|
||||
|
||||
// vmemDump(process, rx::format("mapFlex {:x}-{:x}", vmemRange.beginAddress(),
|
||||
if (prot) {
|
||||
amdgpu::mapMemory(process->pid, vmemRange, MemoryType::WbOnion, prot,
|
||||
allocationInfo.deviceOffset);
|
||||
}
|
||||
|
||||
// vmemDump(process, rx::format("mapFlex {:x}-{:x}",
|
||||
// vmemRange.beginAddress(),
|
||||
// vmemRange.endAddress()));
|
||||
fmemResource.commit();
|
||||
return {vmemRange, {}};
|
||||
|
|
@ -1139,6 +1147,9 @@ orbis::ErrorCode orbis::vmem::protect(Process *process, rx::AddressRange range,
|
|||
toCpuProtection(blockProt));
|
||||
|
||||
rx::dieIf(errc != ErrorCode{}, "failed to map flexible memory");
|
||||
|
||||
amdgpu::mapMemory(process->pid, range, MemoryType::WbOnion,
|
||||
prot, pmemRange.beginAddress());
|
||||
} else if (!blockProt && alloc.prot) {
|
||||
auto errc = fmem::deallocate(rx::AddressRange::fromBeginSize(
|
||||
alloc.deviceOffset, range.size()));
|
||||
|
|
|
|||
|
|
@ -874,7 +874,70 @@ void ipmi::createShellCoreObjects(orbis::Process *process) {
|
|||
createIpmiServer(process, "SceNpGameIntent");
|
||||
createIpmiServer(process, "SceBgft");
|
||||
createIpmiServer(process, "SceCntMgrService");
|
||||
createIpmiServer(process, "ScePlayGo");
|
||||
createIpmiServer(process, "ScePlayGo")
|
||||
// .addSyncMethod<std::uint32_t, void>(0x30000,
|
||||
// [](std::uint32_t &result) {
|
||||
// rx::println(stderr,
|
||||
// "PlayGo: 0x30000");
|
||||
// result = 1;
|
||||
// return 0;
|
||||
// })
|
||||
// .addSyncMethod<std::uint32_t>(0x30001,
|
||||
// [](std::uint32_t unk) {
|
||||
// rx::println(stderr,
|
||||
// "PlayGo: 0x30001 {:x}",
|
||||
// unk);
|
||||
// return 0;
|
||||
// })
|
||||
.addSyncMethod(0x30008,
|
||||
[](std::vector<std::vector<std::byte>> &out,
|
||||
const std::vector<std::span<std::byte>> &in) {
|
||||
// scePlayGoGetLocus
|
||||
rx::println(stderr, "PlayGo: 0x30008 out {}, in {}",
|
||||
out.size(), in.size());
|
||||
|
||||
std::memset(out[0].data(), 3, out[0].size());
|
||||
return orbis::ErrorCode{};
|
||||
})
|
||||
.addSyncMethod(0x3000a,
|
||||
[](std::vector<std::vector<std::byte>> &out,
|
||||
const std::vector<std::span<std::byte>> &in) {
|
||||
rx::println(stderr, "PlayGo: 0x3000a out {}, in {}",
|
||||
out.size(), in.size());
|
||||
// scePlayGoGetToDoList
|
||||
|
||||
if (out.size() != 2 || in.size() != 1) {
|
||||
return orbis::ErrorCode::INVAL;
|
||||
}
|
||||
|
||||
std::memset(out[0].data(), 0, out[0].size());
|
||||
out[1] = toBytes<std::uint32_t>(1000);
|
||||
return orbis::ErrorCode{};
|
||||
})
|
||||
.addSyncMethod(0x3000e,
|
||||
[](std::vector<std::vector<std::byte>> &out,
|
||||
const std::vector<std::span<std::byte>> &in) {
|
||||
rx::println(stderr, "PlayGo: 0x3000a out {}, in {}",
|
||||
out.size(), in.size());
|
||||
// scePlayGoGetChunkId
|
||||
|
||||
if (out.size() != 2 || in.size() != 1) {
|
||||
return orbis::ErrorCode::INVAL;
|
||||
}
|
||||
|
||||
std::memset(out[0].data(), 0, out[0].size());
|
||||
out[1] = toBytes<std::uint32_t>(1);
|
||||
return orbis::ErrorCode{};
|
||||
})
|
||||
|
||||
.addSyncMethod<std::uint32_t, std::uint32_t>(
|
||||
0x3000f, [](std::uint32_t &result, std::uint32_t unk) {
|
||||
rx::println(stderr, "PlayGo: 0x3000f {:x}", unk);
|
||||
result = 1000;
|
||||
std::this_thread::sleep_for(std::chrono::seconds(1));
|
||||
return 0;
|
||||
});
|
||||
|
||||
createIpmiServer(process, "SceCompAppProxyUtil");
|
||||
createIpmiServer(process, "SceShareSpIpcService");
|
||||
createIpmiServer(process, "SceRnpsAppMgr");
|
||||
|
|
|
|||
|
|
@ -129,11 +129,11 @@ struct IpmiServer {
|
|||
}
|
||||
|
||||
template <typename OutT, typename InT>
|
||||
requires(!std::is_same_v<InT, void>)
|
||||
IpmiServer &addSyncMethod(
|
||||
std::uint32_t methodId,
|
||||
std::function<std::int32_t(OutT &out, const InT ¶m)> handler) {
|
||||
syncMethods[methodId] = [=](orbis::IpmiSession &session,
|
||||
std::int32_t &errorCode,
|
||||
syncMethods[methodId] = [=](orbis::IpmiSession &, std::int32_t &errorCode,
|
||||
std::vector<std::vector<std::byte>> &outData,
|
||||
const std::vector<std::span<std::byte>> &inData)
|
||||
-> orbis::ErrorCode {
|
||||
|
|
@ -157,6 +157,31 @@ struct IpmiServer {
|
|||
return *this;
|
||||
}
|
||||
|
||||
template <typename OutT, typename InT>
|
||||
requires std::is_same_v<InT, void>
|
||||
IpmiServer &addSyncMethod(std::uint32_t methodId,
|
||||
std::function<std::int32_t(OutT &out)> handler) {
|
||||
syncMethods[methodId] = [=](orbis::IpmiSession &, std::int32_t &errorCode,
|
||||
std::vector<std::vector<std::byte>> &outData,
|
||||
const std::vector<std::span<std::byte>> &inData)
|
||||
-> orbis::ErrorCode {
|
||||
if (outData.size() != 1 || inData.size() != 0) {
|
||||
return orbis::ErrorCode::INVAL;
|
||||
}
|
||||
|
||||
if (outData[0].size() < sizeof(OutT)) {
|
||||
return orbis::ErrorCode::INVAL;
|
||||
}
|
||||
|
||||
OutT out;
|
||||
errorCode = handler(out);
|
||||
std::memcpy(outData[0].data(), &out, sizeof(out));
|
||||
outData[0].resize(sizeof(OutT));
|
||||
return {};
|
||||
};
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
IpmiServer &
|
||||
addSyncMethod(std::uint32_t methodId,
|
||||
|
|
|
|||
|
|
@ -357,7 +357,7 @@ orbis::SysResult dynlib_load_prx(orbis::Thread *thread,
|
|||
}
|
||||
|
||||
if (it->second == resultModule) {
|
||||
wasNeeded = true;
|
||||
// wasNeeded = true;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue