use kernel_arch::{Architecture, ArchitectureImpl, KernelTableManagerImpl};
use libk_mm::phys::GlobalPhysicalAllocator;

#[macro_use]
pub mod runtime;

pub mod binary;
pub mod debug;
pub mod futex;
pub mod mem;
pub mod process;
pub mod sched;
pub mod sync;
pub mod thread;
pub mod types;

pub type TaskContextImpl =
    kernel_arch::TaskContextImpl<KernelTableManagerImpl, GlobalPhysicalAllocator>;

use sched::CpuQueue;
pub use types::{AtomicThreadState, ThreadAffinity, ThreadId, ThreadState};

/// Returns local CPU index
#[inline]
pub fn cpu_index() -> u32 {
    ArchitectureImpl::cpu_index::<CpuQueue>()
}

pub fn cpu_count() -> usize {
    ArchitectureImpl::cpu_count()
}
