|
Voxia OS v0.0.1
Hobby Project Operating System Targeting x86-64
|
#include "core.h"#include "autoconf.h"#include "hal/acpi/acpi.h"#include "hal/acpi/hpet.h"#include "hal/apic/apic.h"#include "hal/cpu/interrupt.h"#include "hal/cpu/msr.h"#include "hal/cpu/paging.h"#include "hal/timer/timer.h"#include "init/init.h"#include "libk/serial.h"#include "memory/phys_base_allocator.h"#include "memory/vm_manager.h"#include "procc/scheduler.h"#include "sys/syscall.h"#include <ioforge/ioforge.h>#include <str.h>#include <type.h>Go to the source code of this file.
Macros | |
| #define | INIT_CORE_MAGIC 0x00EEDDAB |
| #define | INIT_CORE_ENTRYPOINT 0x8000 |
Functions | |
| void | initGdt (init_context_t *_) |
| void | initSIMD (init_context_t *_) |
| void | initTimer (init_context_t *_) |
| void | update_core_gs (uint8_t id) |
| each_core_data * | get_current_core_data (void) |
| __attribute__ ((used, visibility("default"), section(".export"))) | |
| This function handles memory allocation for a new dentry using the slab allocator. | |
| each_core_data * | vxGetCoreDataByCoreID (uint8_t core_id) |
| void | vxInitializeAPICTimer () |
| void | init_simd () |
| void | setup_gdt (int core) |
| __attribute__ ((no_stack_protector, noreturn)) | |
| static uint32_t | get_bsp_apic_id (void) |
| static void | sipi_sequential (uint32_t apic_id, uint64_t entrypoint_addr) |
| INIT (Core) | |
| uint8_t | vxGetActiveCoreCount () |
Variables | |
| char | _binary_hal_cpu_core_ap_bin_start [] |
| char | _binary_hal_cpu_core_ap_bin_end [] |
| char | __cpu_trampoline_start [] |
| char | __cpu_trampoline_end [] |
| uint8_t | x2_apic_supported |
| each_core_data | core_data [VOXIA_MAX_CORE] = {0} |
| uint8_t | ap_stack_top [VOXIA_MAX_CORE][65536] |
| uintptr_t | __stack_chk_guard |
| static volatile uint8_t | active_core_count = 1 |
| boolean_t | multicore_start = 0 |
| __attribute__ | ( | (no_stack_protector, noreturn) | ) |
Definition at line 74 of file core.c.
References __stack_chk_guard, Active, active_core_count, apicInitialize(), get_current_core_cpuid(), get_current_core_data(), init_simd(), irq_setup(), serial2_printf(), serial_setup(), setup_gdt(), setup_timer_interrupt(), cpu_core::status, syscall_init(), update_core_gs(), vxGetCpuInfo(), vxInitializeAPICTimer(), and vxStartScheduler().
| __attribute__ | ( | (used, visibility("default"), section(".export")) | ) |
This function handles memory allocation for a new dentry using the slab allocator.
It also links the dentry to its corresponding VNode (if provided).
| name | The name of the file or directory. |
| vnode | Pointer to the associated VNode (inode data). Pass NULL if the VNode is not yet available. |
Definition at line 59 of file core.c.
References get_current_core_data(), and KERNEL_API.
|
static |
| each_core_data * get_current_core_data | ( | void | ) |
Definition at line 54 of file core.c.
References core, each_core_data, and msrReadGSBase().
Referenced by __attribute__(), __attribute__(), __attribute__(), char_read(), sch_restore_to_next_thread(), syscall_arch_prctl(), syscall_brk(), syscall_dispatch(), syscall_exit_group(), syscall_ioctl(), syscall_mmap(), syscall_mprotect(), syscall_read(), syscall_set_tid(), syscall_write(), syscall_writev(), usleep(), usleep_backend(), vxAPICTimerCalibrationUsingHPET(), vxSchedulerTick(), and workqueue_process().
| INIT | ( | Core | ) |
Definition at line 188 of file core.c.
References _binary_hal_cpu_core_ap_bin_end, _binary_hal_cpu_core_ap_bin_start, active_core_count, BLOCK_SIZE, get_bsp_apic_id(), get_kernel_vmm_page(), INIT_CORE_ENTRYPOINT, INIT_CORE_MAGIC, LOG_DEBUG, LOG_INFO, memcopy(), multicore_start, paging_get_highest_page_map(), paging_reload(), phys_base_alloc(), sipi_sequential(), size, stack, us2ns, vma_lookup_free_vaddr(), VMA_REGION_A, vma_register(), vxGetCpuInfo(), vxGetNumberOfCores(), vxHPETSleep(), vxMultipleMmap(), and vxStartScheduler().
|
extern |
Definition at line 11 of file simd.c.
References cpuid(), LOG2_INFO, LOG2_WARN, simd_has_avx, and simd_has_avx2.
Referenced by __attribute__().
|
extern |
|
extern |
|
extern |
References x2_apic_supported.
|
extern |
References __stack_chk_guard, and core.
Referenced by __attribute__(), and INIT().
Definition at line 115 of file core.c.
References APIC_ICR_HIGH, APIC_ICR_LOW, apic_read(), apic_write(), LOG_DEBUG, ms2ns, vector, vxHPETSleep(), vxWRSR(), and x2_apic_supported.
Referenced by INIT().
| void update_core_gs | ( | uint8_t | id | ) |
Definition at line 39 of file core.c.
References ap_stack_top, core_data, id, msrSetGSBase(), msrSetKernelGSBase(), and vxGetSchedulerCore().
Referenced by __attribute__(), apicInitialize(), and INIT().
| uint8_t vxGetActiveCoreCount | ( | ) |
Definition at line 265 of file core.c.
References active_core_count.
| each_core_data * vxGetCoreDataByCoreID | ( | uint8_t | core_id | ) |
Definition at line 62 of file core.c.
References core, core_data, and each_core_data.
Referenced by vxAddWorkqueueTask().
|
extern |
Definition at line 148 of file apic_timer.c.
Referenced by __attribute__().
|
extern |
|
extern |
|
extern |
Definition at line 6 of file sanitizer.c.
Referenced by __attribute__(), and setup_gdt().
|
extern |
Referenced by INIT().
|
extern |
Referenced by INIT().
|
static |
Definition at line 72 of file core.c.
Referenced by __attribute__(), INIT(), and vxGetActiveCoreCount().
|
extern |
Referenced by __attribute__(), __attribute__(), and update_core_gs().
| each_core_data core_data[VOXIA_MAX_CORE] = {0} |
Definition at line 35 of file core.c.
Referenced by update_core_gs(), and vxGetCoreDataByCoreID().
| boolean_t multicore_start = 0 |
Definition at line 105 of file core.c.
Referenced by __attribute__(), and INIT().
|
extern |
Definition at line 16 of file apic.c.
Referenced by apic_read(), apic_write(), apicInitialize(), enable_x2apic(), initTimer(), and sipi_sequential().