LF OS
Hobby operating system for amd64 with high ambitions
Loading...
Searching...
No Matches
message_passing.h
Go to the documentation of this file.
1#ifndef _MESSAGE_PASSING_H_INCLUDED
2#define _MESSAGE_PASSING_H_INCLUDED
3
4// XXX: I'm very much not happy with this file, the definitions in here and the
5// names in the global namespace this uses.
6// Sadly, this is a very core part of the system ..
7// Still, expect random changes to those definitions, their names and co -
8// the overall logic of message passing in LF OS feels sensible though, so
9// far at least.
10//
11// -- Fox, 2023-10-25
13#include <stdint.h>
14#include <stdbool.h>
15#include <uuid.h>
16
17#ifndef __kernel
18# include <sys/types.h>
19#endif
20
33struct Message {
35 size_t size;
36
38 size_t user_size;
39
42
45
73}__attribute__((packed));
74
75#endif
unsigned short uint16_t
Definition arch.h:8
unsigned long uint64_t
Definition arch.h:14
int64_t pid_t
Definition arch.h:21
struct Message::UserData::SignalUserData Signal
char data[0]
$user_size - sizeof(IO) bytes of data
struct Message::UserData::HardwareInterruptUserData HardwareInterrupt
size_t size
Size of the message, including metadata.
struct Message::UserData::ServiceDiscoveryData ServiceDiscovery
pid_t sender
Sender of the message.
union Message::UserData user_data
int fd
File descriptor this data is for.
MessageType
@ MT_Signal
@ MT_UserDefined
@ MT_ServiceDiscovery
@ MT_HardwareInterrupt
@ MT_Invalid
Invalid message, only size is valid.
@ MT_IO
struct Message::UserData::IOUserData IO
size_t user_size
Size of the user data.
uint16_t signal
Signal identifier.
enum MessageType type
Type of the message.
Definition uuid.h:6