MOS Source Code
Loading...
Searching...
No Matches
task_types.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-3.0-or-later
2
3#pragma once
4
7#include "mos/tasks/wait.hpp"
8
9#include <abi-bits/signal.h>
10#include <mos/allocator.hpp>
13#include <mos/list.hpp>
14#include <mos/shared_ptr.hpp>
15#include <mos/string.hpp>
17#include <mos/type_utils.hpp>
18
23
29
30struct Thread;
31
37
43
44#define nullfd ((fd_type) { .io = NULL, .flags = (fd_flags_t) 0 })
45
46#define PROCESS_MAGIC_PROC MOS_FOURCC('P', 'R', 'O', 'C')
47#define THREAD_MAGIC_THRD MOS_FOURCC('T', 'H', 'R', 'D')
48
85
92
114
#define MOS_PROCESS_MAX_OPEN_FILES
Definition autoconf.h:26
fd_flags_t
Definition fs_types.h:47
list_node_t list_head
A linked list head.
Definition list.hpp:23
thread_mode
#define PROCESS_MAGIC_PROC
@ THREAD_MODE_KERNEL
@ THREAD_MODE_USER
basic_string_view< char > string_view
mos::basic_string< char, mos::default_allocator > string
Definition string.hpp:336
T * create(Args &&...args)
Definition allocator.hpp:10
thread_state_t
Definition platform.hpp:66
#define SIGNAL_MAX_N
Thread * main_thread
mos::string name
as_linked_list
node in the parent's children list
static Process * New(Process *parent, mos::string_view name)
bool exited
true if the process has exited
platform_process_options_t platform_options
platform per-process flags
process_signal_info_t signal_info
signal handling info
dentry_t * working_directory
mos::list< Thread * > thread_list
const u32 magic
Process * parent
Process(Private, Process *parent, mos::string_view name)
Definition process.cpp:67
list_head children
list of children processes
MMContext * mm
fd_type files[MOS_PROCESS_MAX_OPEN_FILES]
pid_t pid
u32 exit_status
exit status
platform_thread_options_t platform_options
platform-specific thread options
u32 magic
thread_mode mode
user-mode thread or kernel-mode
mos::string name
Process * owner
as_linked_list
node in the process's thread list
downwards_stack_t u_stack
user-mode stack
waitlist_t waiters
list of threads waiting for this thread to exit
downwards_stack_t k_stack
kernel-mode stack
~Thread()
Definition thread.cpp:32
spinlock_t state_lock
protects the thread state
tid_t tid
thread_state_t state
thread state
thread_signal_info_t signal_info
fd_flags_t flags
io_t * io
Definition io.hpp:48
sigaction_t handlers[SIGNAL_MAX_N]
signal handlers
waitlist_t sigchild_waitlist
the parent is waiting for a child to exit, if not empty
list_head pending
list of pending signals
sigset_t mask
pending signals mask
unsigned int u32
Definition types.h:17
s32 tid_t
Definition types.h:75
s32 pid_t
Definition types.h:74