9#include "mos/platform/platform_defs.h"
18#if MOS_CONFIG(MOS_SMP)
19#define PER_CPU_DECLARE(type, name) struct name { type percpu_value[MOS_MAX_CPU_COUNT]; } name
20#define PER_CPU_VAR_INIT { .percpu_value = { 0 } }
21#define per_cpu(var) (&(var.percpu_value[platform_current_cpu_id()]))
23#define PER_CPU_DECLARE(type, name) struct name { type percpu_value[1]; } name
24#define PER_CPU_VAR_INIT { .percpu_value = { 0 } }
25#define per_cpu(var) (&(var.percpu_value[0]))
29#define current_cpu per_cpu(platform_info->cpu)
30#define current_thread (current_cpu->thread)
31#define current_process (current_thread->owner)
32#define current_mm (current_cpu->mm_context)
137#define MOS_KERNEL_PFN(vaddr) ((ALIGN_DOWN_TO_PAGE((vaddr) - (platform_info->k_basevaddr)) / MOS_PAGE_SIZE) + (platform_info->k_basepfn))
154#define platform_alias(name) __attribute__((alias("platform_default_" #name)))
200#if MOS_PLATFORM_PAGING_LEVELS >= 2
206#if MOS_CONFIG(PML2_HUGE_CAPABLE)
213#if MOS_PLATFORM_PAGING_LEVELS >= 3
219#if MOS_CONFIG(PML3_HUGE_CAPABLE)
226#if MOS_PLATFORM_PAGING_LEVELS >= 4
232#if MOS_CONFIG(PML4_HUGE_CAPABLE)
233bool platform_pml4e_is_huge(
const pml4e_t *pml4);
void platform_pml3e_set_pml2(pml3e_t *pml3, pml2_t pml2, pfn_t pml2_pfn)
void platform_pml2e_set_flags(pml2e_t *pml2, vm_flags flags)
void platform_pml4e_set_flags(pml4e_t *pml4, vm_flags flags)
bool platform_pml4e_get_present(const pml4e_t *pml4)
vm_flags platform_pml3e_get_flags(const pml3e_t *pml3e)
bool platform_pml3e_get_present(const pml3e_t *pml3)
vm_flags platform_pml4e_get_flags(const pml4e_t *pml4e)
pml1_t platform_pml2e_get_pml1(const pml2e_t *pml2)
bool platform_pml2e_get_present(const pml2e_t *pml2)
void platform_pml2e_set_pml1(pml2e_t *pml2, pml1_t pml1, pfn_t pml1_pfn)
void platform_pml3e_set_flags(pml3e_t *pml3, vm_flags flags)
vm_flags platform_pml2e_get_flags(const pml2e_t *pml2e)
void platform_pml4e_set_pml3(pml4e_t *pml4, pml3_t pml3, pfn_t pml3_pfn)
pml3_t platform_pml4e_get_pml3(const pml4e_t *pml4)
pml2_t platform_pml3e_get_pml2(const pml3e_t *pml3)
bool platform_pml3e_is_huge(const pml3e_t *pml3e)
pfn_t platform_pml2e_get_huge_pfn(const pml2e_t *pml2)
void platform_pml2e_set_huge(pml2e_t *pml2e, pfn_t pfn)
bool platform_pml2e_is_huge(const pml2e_t *pml2e)
void platform_pml3e_set_huge(pml3e_t *pml3e, pfn_t pfn)
pfn_t platform_pml3e_get_huge_pfn(const pml3e_t *pml3)
#define MOS_MAX_MEMREGIONS
#define MOS_MAX_CMDLINE_COUNT
MOSAPI void(1, 2) fatal_abort(const char *fmt
list_node_t list_head
A linked list head.
ipi_type_t
The type of IPI to send.
#define MOS_ENUM_OPERATORS(_enum)
platform_regs_t * interrupt_regs
the registers of whatever interrupted this CPU
mm_context_t * mm_context
thread_t * idle_thread
idle thread for this CPU
platform_cpuinfo_t cpuinfo
spinlock_t mm_lock
protects [pgd] and the [mmaps] list (the list itself, not the vmap_t objects)
void(* thread_entry_t)(void *arg)