kernel: remove support for sending kernel handles via port/channel

This commit is contained in:
2026-02-26 20:50:34 +00:00
parent b59d0d8948
commit e4de3af00d
17 changed files with 231 additions and 370 deletions

View File

@@ -82,15 +82,13 @@ SYSCALL_GATE kern_handle_close SYS_KERN_HANDLE_CLOSE 1
SYSCALL_GATE kern_config_get SYS_KERN_CONFIG_GET 3
SYSCALL_GATE kern_config_set SYS_KERN_CONFIG_SET 3
SYSCALL_GATE channel_create SYS_CHANNEL_CREATE 3
SYSCALL_GATE channel_create SYS_CHANNEL_CREATE 2
SYSCALL_GATE port_create SYS_PORT_CREATE 1
SYSCALL_GATE port_connect SYS_PORT_CONNECT 3
SYSCALL_GATE port_disconnect SYS_PORT_DISCONNECT 1
SYSCALL_GATE msg_send SYS_MSG_SEND 4
SYSCALL_GATE msg_send SYS_MSG_SEND 5
SYSCALL_GATE msg_recv SYS_MSG_RECV 4
SYSCALL_GATE msg_reply SYS_MSG_REPLY 4
SYSCALL_GATE msg_read SYS_MSG_READ 5
SYSCALL_GATE msg_read_handles SYS_MSG_READ_HANDLES 5
SYSCALL_GATE msg_write SYS_MSG_WRITE 5
SYSCALL_GATE msg_write_handles SYS_MSG_WRITE_HANDLES 5
SYSCALL_GATE msg_read SYS_MSG_READ 6
SYSCALL_GATE msg_write SYS_MSG_WRITE 6

View File

@@ -4,10 +4,7 @@
#include <mango/status.h>
#include <mango/types.h>
extern kern_status_t channel_create(
unsigned int id,
channel_flags_t flags,
kern_handle_t *out);
extern kern_status_t channel_create(unsigned int id, kern_handle_t *out);
extern kern_status_t port_create(kern_handle_t *out);
extern kern_status_t port_connect(
kern_handle_t port,
@@ -17,21 +14,22 @@ extern kern_status_t port_disconnect(kern_handle_t port);
extern kern_status_t msg_send(
kern_handle_t port,
msg_flags_t flags,
const struct msg *req,
struct msg *resp);
const struct iovec *req_data,
size_t req_data_count,
struct iovec *resp_data,
size_t resp_data_count);
extern kern_status_t msg_recv(
kern_handle_t channel,
msg_flags_t flags,
msgid_t *out_id,
struct msg *out_msg);
struct iovec *out_data,
size_t out_data_count);
extern kern_status_t msg_reply(
kern_handle_t channel,
msg_flags_t flags,
msgid_t id,
const struct msg *reply);
const struct iovec *reply_data,
size_t reply_data_count);
extern kern_status_t msg_read(
kern_handle_t channel,
@@ -40,24 +38,13 @@ extern kern_status_t msg_read(
struct iovec *out,
size_t out_count,
size_t *nr_read);
extern kern_status_t msg_read_handles(
kern_handle_t channel,
msgid_t id,
size_t offset,
struct handle_list *out,
size_t nr_out);
extern kern_status_t msg_write(
kern_handle_t channel,
msgid_t id,
size_t offset,
const struct iovec *in,
size_t nr_in);
extern kern_status_t msg_write_handles(
kern_handle_t channel,
msgid_t id,
size_t offset,
const struct handle_list *in,
size_t nr_in);
size_t nr_in,
size_t *nr_written);
#endif

View File

@@ -27,9 +27,7 @@
#define SYS_MSG_RECV 19
#define SYS_MSG_REPLY 20
#define SYS_MSG_READ 21
#define SYS_MSG_READ_HANDLES 22
#define SYS_MSG_WRITE 23
#define SYS_MSG_WRITE_HANDLES 24
#define SYS_CHANNEL_CREATE 25
#define SYS_PORT_CREATE 26
#define SYS_PORT_CONNECT 27

View File

@@ -50,8 +50,6 @@ typedef unsigned int tid_t;
typedef uint32_t kern_handle_t;
typedef uint32_t kern_config_key_t;
typedef uint32_t vm_prot_t;
typedef uint32_t channel_flags_t;
typedef uint32_t msg_flags_t;
typedef unsigned int umode_t;
@@ -60,17 +58,4 @@ struct iovec {
size_t io_len;
};
struct handle_list {
kern_handle_t *l_handles;
size_t l_nr_handles;
};
struct msg {
struct iovec *msg_data;
size_t msg_data_count;
struct handle_list *msg_handles;
size_t msg_handles_count;
};
#endif