MOS Source Code
Loading...
Searching...
No Matches
context.c File Reference
#include "mos/x86/tasks/context.h"
#include "mos/platform/platform_defs.h"
#include "mos/tasks/signal.h"
#include "mos/x86/descriptors/descriptors.h"
#include "mos/x86/tasks/fpu_context.h"
#include <mos/lib/structures/stack.h>
#include <mos/mos_global.h>
#include <mos/platform/platform.h>
#include <mos/syslog/printk.h>
#include <mos/tasks/schedule.h>
#include <mos/tasks/task_types.h>
#include <mos/types.h>
#include <mos/x86/cpu/cpu.h>
#include <mos/x86/mm/paging_impl.h>
#include <mos/x86/x86_interrupt.h>
#include <mos/x86/x86_platform.h>
#include <mos_stdlib.h>
#include <mos_string.h>
+ Include dependency graph for context.c:

Go to the source code of this file.

Typedefs

typedef void(* switch_func_t) ()
 

Functions

void x86_normal_switch_impl ()
 
void x86_context_switch_impl (ptr_t *old_stack, ptr_t new_kstack, switch_func_t switcher, bool *lock)
 
static void x86_start_kernel_thread ()
 
static void x86_start_user_thread ()
 
static platform_regs_tx86_setup_thread_common (thread_t *thread)
 
void platform_context_setup_main_thread (thread_t *thread, ptr_t entry, ptr_t sp, int argc, ptr_t argv, ptr_t envp)
 
void platform_context_cleanup (thread_t *thread)
 
void platform_context_setup_child_thread (thread_t *thread, thread_entry_t entry, void *arg)
 
void platform_context_clone (const thread_t *from, thread_t *to)
 
void platform_switch_to_thread (thread_t *current, thread_t *new_thread, switch_flags_t switch_flags)
 
void x86_set_fsbase (thread_t *thread)
 

Typedef Documentation

◆ switch_func_t

typedef void(* switch_func_t) ()

Definition at line 24 of file context.c.

Function Documentation

◆ x86_normal_switch_impl()

void x86_normal_switch_impl ( )
extern

◆ x86_context_switch_impl()

void x86_context_switch_impl ( ptr_t * old_stack,
ptr_t new_kstack,
switch_func_t switcher,
bool * lock )
extern

◆ x86_start_kernel_thread()

static void x86_start_kernel_thread ( )
static

Definition at line 29 of file context.c.

Referenced by platform_switch_to_thread().

+ Here is the call graph for this function:

◆ x86_start_user_thread()

static void x86_start_user_thread ( )
static

Definition at line 38 of file context.c.

Referenced by platform_switch_to_thread().

+ Here is the call graph for this function:

◆ x86_setup_thread_common()

static platform_regs_t * x86_setup_thread_common ( thread_t * thread)
static

Definition at line 45 of file context.c.

Referenced by platform_context_setup_child_thread(), and platform_context_setup_main_thread().

+ Here is the call graph for this function:

◆ platform_context_setup_main_thread()

void platform_context_setup_main_thread ( thread_t * thread,
ptr_t entry,
ptr_t sp,
int argc,
ptr_t argv,
ptr_t envp )

Definition at line 67 of file context.c.

+ Here is the call graph for this function:

◆ platform_context_cleanup()

void platform_context_cleanup ( thread_t * thread)

Definition at line 77 of file context.c.

◆ platform_context_setup_child_thread()

void platform_context_setup_child_thread ( thread_t * thread,
thread_entry_t entry,
void * arg )

Definition at line 84 of file context.c.

+ Here is the call graph for this function:

◆ platform_context_clone()

void platform_context_clone ( const thread_t * from,
thread_t * to )

Definition at line 100 of file context.c.

+ Here is the call graph for this function:

◆ platform_switch_to_thread()

void platform_switch_to_thread ( thread_t * current,
thread_t * new_thread,
switch_flags_t switch_flags )

Definition at line 119 of file context.c.

+ Here is the call graph for this function:

◆ x86_set_fsbase()

void x86_set_fsbase ( thread_t * thread)

Definition at line 149 of file context.c.

Referenced by platform_arch_syscall(), and platform_switch_to_thread().