Files
FEX-Emu--FEX/Source/Tests/LinuxSyscalls/EmulatedFiles/EmulatedFiles.h
T
Ryan Houdek a3ba1ae199 Deduplicates some configuration data
Configuration mapping was duplicated between three different tables.
Additionally default configuration values were strewn about. Making it confusing as to what the default value would end up being

Adds a new ConfigValues.inl header that defines a few things right next to each other.
Defines the enum name as usual.
Defines the JSON config option name.
Defines the Environment config option name
Defines the default value that the configuration should be
2021-03-08 22:53:41 -08:00

35 lines
1005 B
C++

#pragma once
#include <FEXCore/Config/Config.h>
#include <cstdint>
#include <functional>
#include <unordered_map>
#include <unordered_set>
#include <string>
namespace FEXCore {
class FD;
}
namespace FEXCore::Context {
struct Context;
}
namespace FEX::EmulatedFile {
class EmulatedFDManager {
public:
EmulatedFDManager(FEXCore::Context::Context *ctx);
~EmulatedFDManager();
int32_t OpenAt(int dirfs, const char *pathname, int flags, uint32_t mode);
private:
FEXCore::Context::Context *CTX;
std::string cpus_online{};
std::string cpu_info{};
using FDReadStringFunc = std::function<int32_t(FEXCore::Context::Context *ctx, int32_t fd, const char *pathname, int32_t flags, mode_t mode)>;
std::unordered_map<std::string, FDReadStringFunc> FDReadCreators;
static int32_t ProcAuxv(FEXCore::Context::Context* ctx, int32_t fd, const char* pathname, int32_t flags, mode_t mode);
FEX_CONFIG_OPT(ThreadsConfig, EMULATED_CPU_CORES);
};
}