MOS Source Code
Loading...
Searching...
No Matches
x86_platform_api.c File Reference
#include "mos/mm/paging/pml_types.h"
#include "mos/platform/platform_defs.h"
#include "mos/tasks/signal.h"
#include "mos/x86/devices/rtc.h"
#include <mos/lib/sync/spinlock.h>
#include <mos/mm/paging/paging.h>
#include <mos/mm/physical/pmm.h>
#include <mos/mos_global.h>
#include <mos/platform/platform.h>
#include <mos/platform_syscall.h>
#include <mos/syslog/printk.h>
#include <mos/tasks/process.h>
#include <mos/tasks/task_types.h>
#include <mos/x86/cpu/cpu.h>
#include <mos/x86/delays.h>
#include <mos/x86/devices/port.h>
#include <mos/x86/interrupt/apic.h>
#include <mos/x86/mm/paging_impl.h>
#include <mos/x86/tasks/context.h>
#include <mos/x86/x86_interrupt.h>
#include <mos/x86/x86_platform.h>
#include <mos_stdio.h>
#include <mos_stdlib.h>
#include <mos_string.h>
+ Include dependency graph for x86_platform_api.c:

Go to the source code of this file.

Functions

void platform_shutdown (void)
 
void platform_halt_cpu (void)
 
void platform_invalidate_tlb (ptr_t vaddr)
 
u32 platform_current_cpu_id (void)
 
void platform_cpu_idle (void)
 
u64 platform_get_timestamp ()
 
datetime_str_tplatform_get_datetime_str (void)
 
void platform_interrupt_enable (void)
 
void platform_interrupt_disable (void)
 
void platform_switch_mm (const mm_context_t *mm)
 
platform_regs_tplatform_thread_regs (const thread_t *thread)
 
void platform_dump_thread_kernel_stack (const thread_t *thread)
 
void platform_return_to_userspace (platform_regs_t *regs)
 
u64 platform_arch_syscall (u64 syscall, u64 __maybe_unused arg1, u64 __maybe_unused arg2, u64 __maybe_unused arg3, u64 __maybe_unused arg4)
 
void platform_ipi_send (u8 target, ipi_type_t type)
 
void platform_jump_to_signal_handler (const platform_regs_t *regs, const sigreturn_data_t *sigreturn_data, const sigaction_t *sa)
 
void platform_restore_from_signal_handler (void *sp)
 
void platform_get_time (timeval_t *time)
 
void platform_dump_regs (platform_regs_t *frame)
 
void platform_syscall_setup_restart_context (platform_regs_t *regs, reg_t syscall_nr)
 
void platform_syscall_store_retval (platform_regs_t *regs, reg_t result)
 

Function Documentation

◆ platform_shutdown()

void platform_shutdown ( void )

Definition at line 29 of file x86_platform_api.c.

+ Here is the call graph for this function:

◆ platform_halt_cpu()

void platform_halt_cpu ( void )

Definition at line 38 of file x86_platform_api.c.

+ Here is the call graph for this function:

◆ platform_invalidate_tlb()

void platform_invalidate_tlb ( ptr_t vaddr)

Definition at line 43 of file x86_platform_api.c.

+ Here is the call graph for this function:

◆ platform_current_cpu_id()

u32 platform_current_cpu_id ( void )

Definition at line 51 of file x86_platform_api.c.

◆ platform_cpu_idle()

void platform_cpu_idle ( void )

Definition at line 56 of file x86_platform_api.c.

◆ platform_get_timestamp()

u64 platform_get_timestamp ( void )

Definition at line 61 of file x86_platform_api.c.

Referenced by do_syslog().

+ Here is the call graph for this function:

◆ platform_get_datetime_str()

datetime_str_t * platform_get_datetime_str ( void )

Definition at line 66 of file x86_platform_api.c.

Referenced by do_syslog().

+ Here is the call graph for this function:

◆ platform_interrupt_enable()

void platform_interrupt_enable ( void )

Definition at line 76 of file x86_platform_api.c.

◆ platform_interrupt_disable()

void platform_interrupt_disable ( void )

Definition at line 81 of file x86_platform_api.c.

Referenced by platform_shutdown().

◆ platform_switch_mm()

void platform_switch_mm ( const mm_context_t * mm)

Definition at line 86 of file x86_platform_api.c.

◆ platform_thread_regs()

platform_regs_t * platform_thread_regs ( const thread_t * thread)

Definition at line 91 of file x86_platform_api.c.

Referenced by platform_arch_syscall().

◆ platform_dump_thread_kernel_stack()

void platform_dump_thread_kernel_stack ( const thread_t * thread)

Definition at line 96 of file x86_platform_api.c.

+ Here is the call graph for this function:

◆ platform_return_to_userspace()

void platform_return_to_userspace ( platform_regs_t * regs)

Definition at line 115 of file x86_platform_api.c.

+ Here is the call graph for this function:

◆ platform_arch_syscall()

u64 platform_arch_syscall ( u64 syscall,
u64 __maybe_unused arg1,
u64 __maybe_unused arg2,
u64 __maybe_unused arg3,
u64 __maybe_unused arg4 )

Definition at line 120 of file x86_platform_api.c.

+ Here is the call graph for this function:

◆ platform_ipi_send()

void platform_ipi_send ( u8 target,
ipi_type_t type )

Definition at line 159 of file x86_platform_api.c.

+ Here is the call graph for this function:

◆ platform_jump_to_signal_handler()

void platform_jump_to_signal_handler ( const platform_regs_t * regs,
const sigreturn_data_t * sigreturn_data,
const sigaction_t * sa )

Definition at line 167 of file x86_platform_api.c.

+ Here is the call graph for this function:

◆ platform_restore_from_signal_handler()

void platform_restore_from_signal_handler ( void * sp)

Definition at line 185 of file x86_platform_api.c.

+ Here is the call graph for this function:

◆ platform_get_time()

void platform_get_time ( timeval_t * time)

Definition at line 197 of file x86_platform_api.c.

Referenced by clock_gettimeofday(), and platform_get_datetime_str().

+ Here is the call graph for this function:

◆ platform_dump_regs()

void platform_dump_regs ( platform_regs_t * frame)

Definition at line 202 of file x86_platform_api.c.

◆ platform_syscall_setup_restart_context()

void platform_syscall_setup_restart_context ( platform_regs_t * regs,
reg_t syscall_nr )

Definition at line 225 of file x86_platform_api.c.

◆ platform_syscall_store_retval()

void platform_syscall_store_retval ( platform_regs_t * regs,
reg_t result )

Definition at line 231 of file x86_platform_api.c.