kernel: Fix build error

This commit is contained in:
raphaelthegreat 2024-06-10 21:24:43 +03:00
parent 6a686df402
commit 0f5920090a
4 changed files with 14 additions and 28 deletions

View file

@ -32,8 +32,7 @@ int PS4_SYSV_ABI sceKernelOpen(const char* path, int flags, u16 mode) {
bool directory = (flags & ORBIS_KERNEL_O_DIRECTORY) != 0;
if (directory) {
const std::string host_dir = mnt->GetHostFile(path);
std::filesystem::create_directories(host_dir);
LOG_ERROR(Kernel_Fs, "called on directory");
} else {
u32 handle = h->CreateHandle();
auto* file = h->GetFile(handle);

View file

@ -4,7 +4,7 @@
#pragma once
#include "common/types.h"
#include "thread_management.h"
#include "core/libraries/kernel/time_management.h"
namespace Core::Loader {
class SymbolsResolver;
@ -25,18 +25,18 @@ struct OrbisKernelStat {
u32 st_uid;
u32 st_gid;
u32 st_rdev;
SceKernelTimespec st_atim;
SceKernelTimespec st_mtim;
SceKernelTimespec st_ctim;
OrbisKernelTimespec st_atim;
OrbisKernelTimespec st_mtim;
OrbisKernelTimespec st_ctim;
s64 st_size;
s64 st_blocks;
u32 st_blksize;
u32 st_flags;
u32 st_gen;
s32 st_lspare;
SceKernelTimespec st_birthtim;
unsigned int : (8 / 2) * (16 - static_cast<int>(sizeof(SceKernelTimespec)));
unsigned int : (8 / 2) * (16 - static_cast<int>(sizeof(SceKernelTimespec)));
OrbisKernelTimespec st_birthtim;
unsigned int : (8 / 2) * (16 - static_cast<int>(sizeof(OrbisKernelTimespec)));
unsigned int : (8 / 2) * (16 - static_cast<int>(sizeof(OrbisKernelTimespec)));
};
// flags for Open

View file

@ -47,21 +47,6 @@ int PS4_SYSV_ABI sceKernelMunmap(void* addr, size_t len) {
return SCE_OK;
}
int PS4_SYSV_ABI sceKernelUsleep(u32 microseconds) {
std::this_thread::sleep_for(std::chrono::microseconds(microseconds));
return SCE_OK;
}
int PS4_SYSV_ABI posix_usleep(u32 microseconds) {
std::this_thread::sleep_for(std::chrono::microseconds(microseconds));
return SCE_OK;
}
int PS4_SYSV_ABI sceKernelSleep(u32 seconds) {
std::this_thread::sleep_for(std::chrono::seconds(seconds));
return SCE_OK;
}
struct iovec {
void* iov_base; /* Base address. */
size_t iov_len; /* Length. */
@ -278,9 +263,6 @@ void LibKernel_Register(Core::Loader::SymbolsResolver* sym) {
LIB_FUNCTION("Ou3iL1abvng", "libkernel", 1, "libkernel", 1, 1, stack_chk_fail);
LIB_FUNCTION("9BcDykPmo1I", "libkernel", 1, "libkernel", 1, 1, __Error);
LIB_FUNCTION("BPE9s9vQQXo", "libkernel", 1, "libkernel", 1, 1, posix_mmap);
LIB_FUNCTION("1jfXLRVzisc", "libkernel", 1, "libkernel", 1, 1, sceKernelUsleep);
LIB_FUNCTION("QcteRwbsnV0", "libScePosix", 1, "libkernel", 1, 1, posix_usleep);
LIB_FUNCTION("-ZR+hG7aDHw", "libkernel", 1, "libkernel", 1, 1, sceKernelSleep);
LIB_FUNCTION("YSHRBRLn2pI", "libkernel", 1, "libkernel", 1, 1, _writev);
LIB_FUNCTION("959qrazPIrg", "libkernel", 1, "libkernel", 1, 1, sceKernelGetProcParam);
LIB_FUNCTION("-o5uEDpN+oY", "libkernel", 1, "libkernel", 1, 1, sceKernelConvertUtcToLocaltime);

View file

@ -2,13 +2,18 @@
// SPDX-License-Identifier: GPL-2.0-or-later
#include <thread>
#include <pthread_time.h>
#include "common/assert.h"
#include "common/native_clock.h"
#include "core/libraries/error_codes.h"
#include "core/libraries/kernel/time_management.h"
#include "core/libraries/libs.h"
#ifdef _WIN64
#include <pthread_time.h>
#else
#include <time.h>
#endif
namespace Libraries::Kernel {
static u64 initial_ptc;