lib: add libmsg* ipc protocol libraries
This commit is contained in:
21
lib/libmsg-fs/CMakeLists.txt
Normal file
21
lib/libmsg-fs/CMakeLists.txt
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
file(GLOB sources
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/*.c)
|
||||||
|
file(GLOB headers
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/include/rosetta/msg/fs.h
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/*.h)
|
||||||
|
|
||||||
|
set(public_include_dirs
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/include)
|
||||||
|
|
||||||
|
rosetta_add_library(
|
||||||
|
NAME libmsg-fs STATIC
|
||||||
|
PUBLIC_INCLUDE_DIRS ${public_include_dirs}
|
||||||
|
SOURCES ${sources}
|
||||||
|
HEADERS ${headers})
|
||||||
|
|
||||||
|
sysroot_add_library(
|
||||||
|
NAME libmsg-fs
|
||||||
|
HEADER_DIR /usr/include
|
||||||
|
LIB_DIR /usr/lib)
|
||||||
|
|
||||||
|
target_link_libraries(libmsg-fs libmsg libmango)
|
||||||
3
lib/libmsg-fs/fs.c
Normal file
3
lib/libmsg-fs/fs.c
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
void msg_fs_tmp(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
27
lib/libmsg-fs/include/rosetta/msg/fs.h
Normal file
27
lib/libmsg-fs/include/rosetta/msg/fs.h
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
#ifndef ROSETTA_MSG_FS_H_
|
||||||
|
#define ROSETTA_MSG_FS_H_
|
||||||
|
|
||||||
|
#include <rosetta/msg.h>
|
||||||
|
|
||||||
|
/* rosetta.msg.fs protocol ID */
|
||||||
|
#define ROSETTA_MSG_FS 0x01409DD2U
|
||||||
|
|
||||||
|
/* rosetta.msg.fs.open message ID */
|
||||||
|
#define ROSETTA_MSG_FS_OPEN 0x7D837778U
|
||||||
|
|
||||||
|
struct rosetta_msg_fs_open {
|
||||||
|
struct rosetta_msg msg_base;
|
||||||
|
union {
|
||||||
|
struct {
|
||||||
|
uint16_t o_path;
|
||||||
|
uint16_t o_flags;
|
||||||
|
} msg_request;
|
||||||
|
|
||||||
|
struct {
|
||||||
|
int o_err;
|
||||||
|
uint16_t o_fd_index;
|
||||||
|
} msg_response;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
21
lib/libmsg-ld/CMakeLists.txt
Normal file
21
lib/libmsg-ld/CMakeLists.txt
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
file(GLOB sources
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/*.c)
|
||||||
|
file(GLOB headers
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/include/rosetta/msg/ld.h
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/*.h)
|
||||||
|
|
||||||
|
set(public_include_dirs
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/include)
|
||||||
|
|
||||||
|
rosetta_add_library(
|
||||||
|
NAME libmsg-ld STATIC
|
||||||
|
PUBLIC_INCLUDE_DIRS ${public_include_dirs}
|
||||||
|
SOURCES ${sources}
|
||||||
|
HEADERS ${headers})
|
||||||
|
|
||||||
|
sysroot_add_library(
|
||||||
|
NAME libmsg-ld
|
||||||
|
HEADER_DIR /usr/include
|
||||||
|
LIB_DIR /usr/lib)
|
||||||
|
|
||||||
|
target_link_libraries(libmsg-ld libmsg libmango)
|
||||||
26
lib/libmsg-ld/include/rosetta/msg/ld.h
Normal file
26
lib/libmsg-ld/include/rosetta/msg/ld.h
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
#ifndef ROSETTA_MSG_LD_H_
|
||||||
|
#define ROSETTA_MSG_LD_H_
|
||||||
|
|
||||||
|
#include <rosetta/msg.h>
|
||||||
|
|
||||||
|
/* rosetta.msg.ld protocol ID */
|
||||||
|
#define ROSETTA_MSG_LD 0x5563D896U
|
||||||
|
|
||||||
|
/* rosetta.msg.ld.get-object message ID */
|
||||||
|
#define ROSETTA_MSG_LD_GET_OBJECT 1
|
||||||
|
|
||||||
|
struct rosetta_msg_ld_get_object {
|
||||||
|
struct rosetta_msg msg_base;
|
||||||
|
union {
|
||||||
|
struct {
|
||||||
|
uint16_t go_object_name;
|
||||||
|
} msg_request;
|
||||||
|
|
||||||
|
struct {
|
||||||
|
int go_err;
|
||||||
|
uint16_t go_object_index;
|
||||||
|
} msg_response;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
3
lib/libmsg-ld/ld.c
Normal file
3
lib/libmsg-ld/ld.c
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
void msg_ld_tmp(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
21
lib/libmsg/CMakeLists.txt
Normal file
21
lib/libmsg/CMakeLists.txt
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
file(GLOB sources
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/*.c)
|
||||||
|
file(GLOB headers
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/include/rosetta/msg.h
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/*.h)
|
||||||
|
|
||||||
|
set(public_include_dirs
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/include)
|
||||||
|
|
||||||
|
rosetta_add_library(
|
||||||
|
NAME libmsg STATIC
|
||||||
|
PUBLIC_INCLUDE_DIRS ${public_include_dirs}
|
||||||
|
SOURCES ${sources}
|
||||||
|
HEADERS ${headers})
|
||||||
|
|
||||||
|
sysroot_add_library(
|
||||||
|
NAME libmsg
|
||||||
|
HEADER_DIR /usr/include
|
||||||
|
LIB_DIR /usr/lib)
|
||||||
|
|
||||||
|
target_link_libraries(libmsg libmango)
|
||||||
15
lib/libmsg/include/rosetta/msg.h
Normal file
15
lib/libmsg/include/rosetta/msg.h
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
#ifndef ROSETTA_MSG_H_
|
||||||
|
#define ROSETTA_MSG_H_
|
||||||
|
|
||||||
|
#define ROSETTA_MSG_MAGIC 0x9AB07D10U
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
struct rosetta_msg {
|
||||||
|
uint32_t msg_magic;
|
||||||
|
uint32_t msg_protocol;
|
||||||
|
uint16_t msg_id;
|
||||||
|
uint16_t msg_reserved;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
3
lib/libmsg/msg.c
Normal file
3
lib/libmsg/msg.c
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
void msg_tmp(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user