Skip to content
Snippets Groups Projects
Commit 08b6cf77 authored by bunnei's avatar bunnei
Browse files

Merge pull request #265 from Subv/socu

SOC_U: Implemented some socket functions
parents 59bba046 97a7381d
No related branches found
No related tags found
No related merge requests found
...@@ -24,10 +24,10 @@ endif() ...@@ -24,10 +24,10 @@ endif()
if (APPLE) if (APPLE)
target_link_libraries(citra iconv ${COREFOUNDATION_LIBRARY}) target_link_libraries(citra iconv ${COREFOUNDATION_LIBRARY})
elseif (WIN32) elseif (WIN32)
target_link_libraries(citra winmm) target_link_libraries(citra winmm wsock32 ws2_32)
if (MINGW) # GCC does not support codecvt, so use iconv instead if (MINGW) # GCC does not support codecvt, so use iconv instead
target_link_libraries(citra iconv) target_link_libraries(citra iconv)
endif() endif()
else() # Unix else() # Unix
target_link_libraries(citra rt) target_link_libraries(citra rt)
endif() endif()
......
...@@ -68,7 +68,7 @@ endif() ...@@ -68,7 +68,7 @@ endif()
if (APPLE) if (APPLE)
target_link_libraries(citra-qt iconv ${COREFOUNDATION_LIBRARY}) target_link_libraries(citra-qt iconv ${COREFOUNDATION_LIBRARY})
elseif (WIN32) elseif (WIN32)
target_link_libraries(citra-qt winmm) target_link_libraries(citra-qt winmm wsock32 ws2_32)
else() # Unix else() # Unix
target_link_libraries(citra-qt rt) target_link_libraries(citra-qt rt)
endif() endif()
......
...@@ -39,6 +39,7 @@ static std::shared_ptr<Logger> global_logger; ...@@ -39,6 +39,7 @@ static std::shared_ptr<Logger> global_logger;
SUB(Service, CFG) \ SUB(Service, CFG) \
SUB(Service, DSP) \ SUB(Service, DSP) \
SUB(Service, HID) \ SUB(Service, HID) \
SUB(Service, SOC) \
CLS(HW) \ CLS(HW) \
SUB(HW, Memory) \ SUB(HW, Memory) \
SUB(HW, GPU) \ SUB(HW, GPU) \
......
...@@ -59,6 +59,7 @@ enum class Class : ClassType { ...@@ -59,6 +59,7 @@ enum class Class : ClassType {
Service_CFG, ///< The CFG (Configuration) service Service_CFG, ///< The CFG (Configuration) service
Service_DSP, ///< The DSP (DSP control) service Service_DSP, ///< The DSP (DSP control) service
Service_HID, ///< The HID (User input) service Service_HID, ///< The HID (User input) service
Service_SOC, ///< The SOC (Socket) service
HW, ///< Low-level hardware emulation HW, ///< Low-level hardware emulation
HW_Memory, ///< Memory-map and address translation HW_Memory, ///< Memory-map and address translation
HW_GPU, ///< GPU control emulation HW_GPU, ///< GPU control emulation
......
...@@ -128,6 +128,13 @@ template<s32 func(s32*, u32, s32)> void Wrap() { ...@@ -128,6 +128,13 @@ template<s32 func(s32*, u32, s32)> void Wrap() {
FuncReturn(retval); FuncReturn(retval);
} }
template<s32 func(u32*, u32, u32, u32, u32)> void Wrap() {
u32 param_1 = 0;
u32 retval = func(&param_1, PARAM(1), PARAM(2), PARAM(3), PARAM(4));
Core::g_app_core->SetReg(1, param_1);
FuncReturn(retval);
}
//////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////
// Function wrappers that return type u32 // Function wrappers that return type u32
......
This diff is collapsed.
...@@ -14,6 +14,7 @@ namespace SOC_U { ...@@ -14,6 +14,7 @@ namespace SOC_U {
class Interface : public Service::Interface { class Interface : public Service::Interface {
public: public:
Interface(); Interface();
~Interface();
std::string GetPortName() const override { std::string GetPortName() const override {
return "soc:U"; return "soc:U";
......
...@@ -352,6 +352,18 @@ static s64 GetSystemTick() { ...@@ -352,6 +352,18 @@ static s64 GetSystemTick() {
return (s64)Core::g_app_core->GetTicks(); return (s64)Core::g_app_core->GetTicks();
} }
/// Creates a memory block at the specified address with the specified permissions and size
static Result CreateMemoryBlock(Handle* memblock, u32 addr, u32 size, u32 my_permission,
u32 other_permission) {
// TODO(Subv): Implement this function
Handle shared_memory = Kernel::CreateSharedMemory();
*memblock = shared_memory;
LOG_WARNING(Kernel_SVC, "(STUBBED) called addr=0x%08X", addr);
return 0;
}
const HLE::FunctionDef SVC_Table[] = { const HLE::FunctionDef SVC_Table[] = {
{0x00, nullptr, "Unknown"}, {0x00, nullptr, "Unknown"},
{0x01, HLE::Wrap<ControlMemory>, "ControlMemory"}, {0x01, HLE::Wrap<ControlMemory>, "ControlMemory"},
...@@ -383,7 +395,7 @@ const HLE::FunctionDef SVC_Table[] = { ...@@ -383,7 +395,7 @@ const HLE::FunctionDef SVC_Table[] = {
{0x1B, nullptr, "SetTimer"}, {0x1B, nullptr, "SetTimer"},
{0x1C, nullptr, "CancelTimer"}, {0x1C, nullptr, "CancelTimer"},
{0x1D, nullptr, "ClearTimer"}, {0x1D, nullptr, "ClearTimer"},
{0x1E, nullptr, "CreateMemoryBlock"}, {0x1E, HLE::Wrap<CreateMemoryBlock>, "CreateMemoryBlock"},
{0x1F, HLE::Wrap<MapMemoryBlock>, "MapMemoryBlock"}, {0x1F, HLE::Wrap<MapMemoryBlock>, "MapMemoryBlock"},
{0x20, nullptr, "UnmapMemoryBlock"}, {0x20, nullptr, "UnmapMemoryBlock"},
{0x21, HLE::Wrap<CreateAddressArbiter>, "CreateAddressArbiter"}, {0x21, HLE::Wrap<CreateAddressArbiter>, "CreateAddressArbiter"},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment