diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
index 3e722f9d..6c18ee41 100644
--- a/.idea/inspectionProfiles/Project_Default.xml
+++ b/.idea/inspectionProfiles/Project_Default.xml
@@ -129,6 +129,9 @@
+
+
+
diff --git a/app/src/main/cpp/skyline/kernel/types/KProcess.cpp b/app/src/main/cpp/skyline/kernel/types/KProcess.cpp
index 7da4cab0..c96c3e88 100644
--- a/app/src/main/cpp/skyline/kernel/types/KProcess.cpp
+++ b/app/src/main/cpp/skyline/kernel/types/KProcess.cpp
@@ -90,30 +90,30 @@ namespace skyline::kernel::type {
}
void KProcess::ReadMemory(void *destination, u64 offset, size_t size) const {
- struct iovec local[1];
- struct iovec remote[1];
+ struct iovec local {
+ .iov_base = destination,
+ .iov_len = size
+ };
+ struct iovec remote {
+ .iov_base = reinterpret_cast(offset),
+ .iov_len = size
+ };
- remote[0].iov_base = reinterpret_cast(offset);
- remote[0].iov_len = size;
-
- local[0].iov_base = destination;
- local[0].iov_len = size;
-
- if (process_vm_readv(pid, local, 1, remote, 1, 0) < 0)
+ if (process_vm_readv(pid, &local, 1, &remote, 1, 0) < 0)
pread64(memFd, destination, size, offset);
}
void KProcess::WriteMemory(void *source, u64 offset, size_t size) const {
- struct iovec local[1];
- struct iovec remote[1];
+ struct iovec local {
+ .iov_base = source,
+ .iov_len = size
+ };
+ struct iovec remote {
+ .iov_base = reinterpret_cast(offset),
+ .iov_len = size
+ };
- remote[0].iov_base = reinterpret_cast(offset);
- remote[0].iov_len = size;
-
- local[0].iov_base = source;
- local[0].iov_len = size;
-
- if (process_vm_writev(pid, local, 1, remote, 1, 0) < 0)
+ if (process_vm_writev(pid, &local, 1, &remote, 1, 0) < 0)
pwrite64(memFd, source, size, offset);
}
diff --git a/app/src/main/cpp/skyline/os.cpp b/app/src/main/cpp/skyline/os.cpp
index bc7fe38d..d3a1dd2b 100644
--- a/app/src/main/cpp/skyline/os.cpp
+++ b/app/src/main/cpp/skyline/os.cpp
@@ -18,9 +18,7 @@ namespace skyline::kernel {
}
std::shared_ptr OS::CreateProcess(u64 entry, u64 argument, size_t stackSize) {
- madvise(reinterpret_cast(constant::BaseAddr), constant::BaseEnd, MADV_DONTFORK);
auto *stack = static_cast(mmap(nullptr, stackSize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_NORESERVE | MAP_ANONYMOUS | MAP_STACK, -1, 0));
- madvise(stack, reinterpret_cast(stack) + stackSize, MADV_DOFORK);
if (stack == MAP_FAILED)
throw exception("Failed to allocate stack memory");
if (mprotect(stack, PAGE_SIZE, PROT_NONE)) {
@@ -29,7 +27,6 @@ namespace skyline::kernel {
}
auto tlsMem = std::make_shared(state, 0, (sizeof(ThreadContext) + (PAGE_SIZE - 1)) & ~(PAGE_SIZE - 1), memory::Permission(true, true, false), memory::Type::Reserved);
tlsMem->guest = tlsMem->kernel;
- madvise(reinterpret_cast(tlsMem->guest.address), tlsMem->guest.size, MADV_DOFORK);
pid_t pid = clone(reinterpret_cast(&guest::entry), stack + stackSize, CLONE_FILES | CLONE_FS | CLONE_SETTLS | SIGCHLD, reinterpret_cast(entry), nullptr, reinterpret_cast(tlsMem->guest.address));
if (pid == -1)
throw exception("Call to clone() has failed: {}", strerror(errno));
diff --git a/app/src/main/cpp/skyline/os.h b/app/src/main/cpp/skyline/os.h
index d318fdd1..b4c3a4c5 100644
--- a/app/src/main/cpp/skyline/os.h
+++ b/app/src/main/cpp/skyline/os.h
@@ -49,11 +49,5 @@ namespace skyline::kernel {
* @param pid The PID of the thread
*/
void KillThread(pid_t pid);
-
- /**
- * @brief Handles a particular SuperVisor Call
- * @param svc The ID of the SVC to be called
- */
- void SvcHandler(const u16 svc);
};
}