lib: rosetta: add library to contain os-wide definitions

This commit is contained in:
2026-03-06 20:16:25 +00:00
parent faeefe28ab
commit a6a2526502
3 changed files with 66 additions and 0 deletions

View File

@@ -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)

View File

@@ -0,0 +1,6 @@
#include <rosetta/bootstrap.h>
const struct rosetta_bootstrap_channel *rosetta_bootstrap_get_channel(void)
{
return NULL;
}

View File

@@ -0,0 +1,45 @@
#ifndef ROSETTA_BOOTSTRAP_H_
#define ROSETTA_BOOTSTRAP_H_
#include <mango/types.h>
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