diff --git a/lib/librosetta/CMakeLists.txt b/lib/librosetta/CMakeLists.txt new file mode 100644 index 0000000..6990fa8 --- /dev/null +++ b/lib/librosetta/CMakeLists.txt @@ -0,0 +1,15 @@ +file(GLOB sources *.c) +file(GLOB headers include/rosetta/*.h) + +rosetta_add_library( + NAME librosetta STATIC + PUBLIC_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include + SOURCES ${sources} + HEADERS ${headers}) + +sysroot_add_library( + NAME librosetta + HEADER_DIR /usr/include + LIB_DIR /usr/lib) + +target_link_libraries(librosetta libmango) diff --git a/lib/librosetta/bootstrap.c b/lib/librosetta/bootstrap.c new file mode 100644 index 0000000..ba7089d --- /dev/null +++ b/lib/librosetta/bootstrap.c @@ -0,0 +1,6 @@ +#include + +const struct rosetta_bootstrap_channel *rosetta_bootstrap_get_channel(void) +{ + return NULL; +} diff --git a/lib/librosetta/include/rosetta/bootstrap.h b/lib/librosetta/include/rosetta/bootstrap.h new file mode 100644 index 0000000..6b81c37 --- /dev/null +++ b/lib/librosetta/include/rosetta/bootstrap.h @@ -0,0 +1,45 @@ +#ifndef ROSETTA_BOOTSTRAP_H_ +#define ROSETTA_BOOTSTRAP_H_ + +#include + +enum rosetta_bootstrap_handle_type { + RSBS_HANDLE_NONE = 0, + RSBS_HANDLE_TASK, + RSBS_HANDLE_ADDRESS_SPACE, +}; + +enum rosetta_bootstrap_channel_type { + RSBS_CHANNEL_NONE, + RSBS_CHANNEL_SYSTEM, +}; + +struct rosetta_bootstrap_handle { + enum rosetta_bootstrap_handle_type h_type; + kern_handle_t h_value; +}; + +struct rosetta_bootstrap_channel { + enum rosetta_bootstrap_channel_type c_type; + tid_t c_tid; + unsigned int c_cid; +}; + +struct rosetta_bootstrap { + int bs_argc; + const char **bs_argv; + + int bs_envc; + const char **bs_envp; + + const struct rosetta_bootstrap_handle *bs_handles; + size_t bs_handles_count; + + const struct rosetta_bootstrap_channel *bs_channels; + size_t bs_channels_count; +}; + +extern const struct rosetta_bootstrap_channel *rosetta_bootstrap_get_channel( + void); + +#endif