Skip to content

Commit d1af7ae

Browse files
committed
chore: kernel API build
1 parent dc49657 commit d1af7ae

File tree

9 files changed

+30
-7
lines changed

9 files changed

+30
-7
lines changed

CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,11 @@ add_subdirectory(kernel)
7474
include(add_mos_library)
7575
add_subdirectory(libs)
7676

77-
add_subdirectory(userspace)
77+
if (__MOS_HAS_NO_COMPILER)
78+
message(WARNING "Skipping userspace build because __MOS_HAS_NO_COMPILER is set.")
79+
else()
80+
add_subdirectory(userspace)
81+
endif()
7882
add_subdirectory(tools)
7983

8084
# include custom configuration

kernel/arch/riscv64/include/public/mos/platform_syscall.hpp renamed to kernel/arch/riscv64/include/public/mos/platform_syscall.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#pragma once
44

55
#include <mos/mos_global.h>
6-
#include <mos/types.hpp>
6+
#include <mos/types.h>
77

88
enum
99
{

kernel/arch/x86_64/include/public/mos/platform_syscall.hpp renamed to kernel/arch/x86_64/include/public/mos/platform_syscall.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#pragma once
33

44
#include <mos/mos_global.h>
5-
#include <mos/types.hpp>
5+
#include <mos/types.h>
66

77
enum
88
{

kernel/arch/x86_64/x86_platform_api.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include <mos/mm/physical/pmm.hpp>
1111
#include <mos/mos_global.h>
1212
#include <mos/platform/platform.hpp>
13-
#include <mos/platform_syscall.hpp>
13+
#include <mos/platform_syscall.h>
1414
#include <mos/syslog/printk.hpp>
1515
#include <mos/tasks/process.hpp>
1616
#include <mos/tasks/task_types.hpp>

kernel/filesystem/userfs/userfs.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#include <librpc/rpc_client.h>
1818
#include <librpc/rpc_server.h>
1919
#include <mos/filesystem/fs_types.h>
20-
#include <mos/proto/fs_server.h>
2120
#include <mos_stdio.hpp>
2221
#include <mos_stdlib.hpp>
2322
#include <mos_string.hpp>

kernel/include/private/mos/types.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class PtrResult
7575

7676
T *get() const
7777
{
78-
return const_cast<T *>(value);
78+
return value;
7979
}
8080

8181
bool isErr() const
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// SPDX-License-Identifier: GPL-3.0-or-later
2+
3+
#pragma once
4+
5+
#define USERFS_SERVER_RPC_NAME "mos.userfs-manager"
6+
7+
#define USERFS_MANAGER_X(ARGS, PB, xarg) \
8+
/**/ \
9+
PB(xarg, 0, register_fs, REGISTER_FS, mos_rpc_fs_register_request, mos_rpc_fs_register_response)
10+
11+
#define USERFS_IMPL_X(ARGS, PB, xarg) \
12+
PB(xarg, 0, mount, MOUNT, mos_rpc_fs_mount_request, mos_rpc_fs_mount_response) \
13+
PB(xarg, 1, readdir, READDIR, mos_rpc_fs_readdir_request, mos_rpc_fs_readdir_response) \
14+
PB(xarg, 2, lookup, LOOKUP, mos_rpc_fs_lookup_request, mos_rpc_fs_lookup_response) \
15+
PB(xarg, 3, readlink, READLINK, mos_rpc_fs_readlink_request, mos_rpc_fs_readlink_response) \
16+
PB(xarg, 4, getpage, GETPAGE, mos_rpc_fs_getpage_request, mos_rpc_fs_getpage_response) \
17+
PB(xarg, 5, putpage, PUTPAGE, mos_rpc_fs_putpage_request, mos_rpc_fs_putpage_response) \
18+
PB(xarg, 6, create_file, CREATE_FILE, mos_rpc_fs_create_file_request, mos_rpc_fs_create_file_response) \
19+
PB(xarg, 7, sync_inode, SYNC_INODE, mos_rpc_fs_sync_inode_request, mos_rpc_fs_sync_inode_response) \
20+
PB(xarg, 8, unlink, UNLINK, mos_rpc_fs_unlink_request, mos_rpc_fs_unlink_response)\

userspace/drivers/fs/ext4/ext4fs.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#include <librpc/rpc_server++.hpp>
1818
#include <memory>
1919
#include <mos/filesystem/fs_types.h>
20-
#include <mos/proto/fs_server.h>
2120
#include <pb_decode.h>
2221

2322
using namespace std::string_literals;

userspace/drivers/fs/ext4/main.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
#include "blockdev.h"
44
#include "ext4fs.hpp"
5+
#include "mos/proto/fs_server.h"
56
#include "proto/blockdev.services.h"
67
#include "proto/userfs-manager.services.h"
78

0 commit comments

Comments
 (0)