diff --git a/lib/mammoth/CMakeLists.txt b/lib/mammoth/CMakeLists.txt index b33c991..0b4b002 100644 --- a/lib/mammoth/CMakeLists.txt +++ b/lib/mammoth/CMakeLists.txt @@ -1,22 +1,24 @@ add_library(mammoth STATIC - src/channel.cpp + ipc/channel.cpp + ipc/endpoint_client.cpp + ipc/endpoint_server.cpp + ipc/port_client.cpp + ipc/port_server.cpp src/debug.cpp - src/endpoint_client.cpp - src/endpoint_server.cpp src/init.cpp src/memory_region.cpp src/mutex.cpp src/new.cpp src/process.cpp - src/port_client.cpp - src/port_server.cpp src/semaphore.cpp src/thread.cpp ) target_include_directories(mammoth PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include) + PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include + "${CMAKE_CURRENT_SOURCE_DIR}/.." + ) target_link_libraries(mammoth glacier diff --git a/lib/mammoth/include/mammoth/process.h b/lib/mammoth/include/mammoth/process.h index e46047e..b2acb7a 100644 --- a/lib/mammoth/include/mammoth/process.h +++ b/lib/mammoth/include/mammoth/process.h @@ -2,8 +2,7 @@ #include #include - -#include "mammoth/endpoint_client.h" +#include glcr::ErrorCode SpawnProcessFromElfRegion(uint64_t program, z_cap_t yellowstone_client); diff --git a/lib/mammoth/src/channel.cpp b/lib/mammoth/ipc/channel.cpp similarity index 97% rename from lib/mammoth/src/channel.cpp rename to lib/mammoth/ipc/channel.cpp index e272965..a56b0ff 100644 --- a/lib/mammoth/src/channel.cpp +++ b/lib/mammoth/ipc/channel.cpp @@ -1,4 +1,4 @@ -#include "mammoth/channel.h" +#include "ipc/channel.h" #include diff --git a/lib/mammoth/include/mammoth/channel.h b/lib/mammoth/ipc/channel.h similarity index 100% rename from lib/mammoth/include/mammoth/channel.h rename to lib/mammoth/ipc/channel.h diff --git a/lib/mammoth/src/endpoint_client.cpp b/lib/mammoth/ipc/endpoint_client.cpp similarity index 79% rename from lib/mammoth/src/endpoint_client.cpp rename to lib/mammoth/ipc/endpoint_client.cpp index 270bff5..2b20b46 100644 --- a/lib/mammoth/src/endpoint_client.cpp +++ b/lib/mammoth/ipc/endpoint_client.cpp @@ -1,4 +1,4 @@ -#include "mammoth/endpoint_server.h" +#include "ipc/endpoint_server.h" glcr::UniquePtr EndpointClient::AdoptEndpoint(z_cap_t cap) { return glcr::UniquePtr(new EndpointClient(cap)); diff --git a/lib/mammoth/include/mammoth/endpoint_client.h b/lib/mammoth/ipc/endpoint_client.h similarity index 100% rename from lib/mammoth/include/mammoth/endpoint_client.h rename to lib/mammoth/ipc/endpoint_client.h diff --git a/lib/mammoth/src/endpoint_server.cpp b/lib/mammoth/ipc/endpoint_server.cpp similarity index 97% rename from lib/mammoth/src/endpoint_server.cpp rename to lib/mammoth/ipc/endpoint_server.cpp index 17c46d7..f108af5 100644 --- a/lib/mammoth/src/endpoint_server.cpp +++ b/lib/mammoth/ipc/endpoint_server.cpp @@ -1,4 +1,4 @@ -#include "mammoth/endpoint_server.h" +#include "ipc/endpoint_server.h" #include "mammoth/debug.h" diff --git a/lib/mammoth/include/mammoth/endpoint_server.h b/lib/mammoth/ipc/endpoint_server.h similarity index 95% rename from lib/mammoth/include/mammoth/endpoint_server.h rename to lib/mammoth/ipc/endpoint_server.h index 79260e3..cb18949 100644 --- a/lib/mammoth/include/mammoth/endpoint_server.h +++ b/lib/mammoth/ipc/endpoint_server.h @@ -4,7 +4,7 @@ #include #include -#include "mammoth/endpoint_client.h" +#include "mammoth/ipc/endpoint_client.h" #include "mammoth/request_context.h" #include "mammoth/response_context.h" #include "mammoth/thread.h" diff --git a/lib/mammoth/src/port_client.cpp b/lib/mammoth/ipc/port_client.cpp similarity index 92% rename from lib/mammoth/src/port_client.cpp rename to lib/mammoth/ipc/port_client.cpp index 61ef1ef..a54a736 100644 --- a/lib/mammoth/src/port_client.cpp +++ b/lib/mammoth/ipc/port_client.cpp @@ -1,4 +1,4 @@ -#include "mammoth/port_client.h" +#include "ipc/port_client.h" #include #include diff --git a/lib/mammoth/include/mammoth/port_client.h b/lib/mammoth/ipc/port_client.h similarity index 100% rename from lib/mammoth/include/mammoth/port_client.h rename to lib/mammoth/ipc/port_client.h diff --git a/lib/mammoth/src/port_server.cpp b/lib/mammoth/ipc/port_server.cpp similarity index 97% rename from lib/mammoth/src/port_server.cpp rename to lib/mammoth/ipc/port_server.cpp index 3cc99e9..490a146 100644 --- a/lib/mammoth/src/port_server.cpp +++ b/lib/mammoth/ipc/port_server.cpp @@ -1,4 +1,4 @@ -#include "mammoth/port_server.h" +#include "ipc/port_server.h" #include diff --git a/lib/mammoth/include/mammoth/port_server.h b/lib/mammoth/ipc/port_server.h similarity index 92% rename from lib/mammoth/include/mammoth/port_server.h rename to lib/mammoth/ipc/port_server.h index e8939e4..ccb9c46 100644 --- a/lib/mammoth/include/mammoth/port_server.h +++ b/lib/mammoth/ipc/port_server.h @@ -3,7 +3,7 @@ #include #include -#include "mammoth/port_client.h" +#include "mammoth/ipc/port_client.h" class PortServer { public: diff --git a/lib/mammoth/src/init.cpp b/lib/mammoth/src/init.cpp index 352df2d..6644f15 100644 --- a/lib/mammoth/src/init.cpp +++ b/lib/mammoth/src/init.cpp @@ -4,7 +4,7 @@ #include #include "mammoth/debug.h" -#include "mammoth/port_server.h" +#include "mammoth/ipc/port_server.h" uint64_t gSelfProcCap = 0; uint64_t gSelfVmasCap = 0; diff --git a/lib/mammoth/src/process.cpp b/lib/mammoth/src/process.cpp index 2d9fe30..8f61ad4 100644 --- a/lib/mammoth/src/process.cpp +++ b/lib/mammoth/src/process.cpp @@ -4,10 +4,10 @@ #include #include "mammoth/debug.h" -#include "mammoth/endpoint_server.h" #include "mammoth/init.h" -#include "mammoth/port_client.h" -#include "mammoth/port_server.h" +#include "mammoth/ipc/endpoint_server.h" +#include "mammoth/ipc/port_client.h" +#include "mammoth/ipc/port_server.h" #define MAM_PROC_DEBUG 0 diff --git a/sys/denali/denali.cpp b/sys/denali/denali.cpp index a099803..907425a 100644 --- a/sys/denali/denali.cpp +++ b/sys/denali/denali.cpp @@ -1,8 +1,6 @@ #include -#include #include -#include #include #include @@ -11,8 +9,6 @@ uint64_t main(uint64_t init_port_cap) { check(ParseInitPort(init_port_cap)); - glcr::UniquePtr yellowstone = - EndpointClient::AdoptEndpoint(gInitEndpointCap); YellowstoneClient stub(gInitEndpointCap); Empty empty; diff --git a/sys/denali/denali_server.h b/sys/denali/denali_server.h index 5ccf4cb..26f63b7 100644 --- a/sys/denali/denali_server.h +++ b/sys/denali/denali_server.h @@ -1,7 +1,6 @@ #pragma once #include -#include #include "ahci/ahci_driver.h" #include "lib/denali/denali.yunq.server.h" diff --git a/sys/yellowstone/yellowstone.cpp b/sys/yellowstone/yellowstone.cpp index 7100572..43d5a75 100644 --- a/sys/yellowstone/yellowstone.cpp +++ b/sys/yellowstone/yellowstone.cpp @@ -1,7 +1,6 @@ #include #include #include -#include #include #include #include diff --git a/sys/yellowstone/yellowstone_server.cpp b/sys/yellowstone/yellowstone_server.cpp index e1ca72f..58e4d0a 100644 --- a/sys/yellowstone/yellowstone_server.cpp +++ b/sys/yellowstone/yellowstone_server.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include "hw/gpt.h" #include "hw/pcie.h" diff --git a/sys/yellowstone/yellowstone_server.h b/sys/yellowstone/yellowstone_server.h index b301984..5c36369 100644 --- a/sys/yellowstone/yellowstone_server.h +++ b/sys/yellowstone/yellowstone_server.h @@ -4,8 +4,6 @@ #include #include #include -#include -#include #include #include #include