pub fn add_current_core() {
	// Create an idle task for this core.
	let core_id = core_id();
	let tid = get_tid();
	let idle_task = Rc::new(RefCell::new(Task::new_idle(tid, core_id)));

	// Add the ID -> Task mapping.
	unsafe {
		TASKS
			.as_ref()
			.unwrap()
			.lock()
			.insert(tid, idle_task.clone());
	}

	// Initialize a scheduler for this core.
	debug!(
		"Initializing scheduler for core {} with idle task {}",
		core_id, tid
	);
	let boxed_scheduler = Box::new(PerCoreScheduler {
		core_id: core_id,
		current_task: idle_task.clone(),
		idle_task: idle_task.clone(),
		fpu_owner: idle_task,
		state: SpinlockIrqSave::new(SchedulerState {
			ready_queue: PriorityTaskQueue::new(),
			is_halted: false,
		}),
		finished_tasks: VecDeque::new(),
		blocked_tasks: SpinlockIrqSave::new(BlockedTaskQueue::new()),
		last_task_switch_tick: 0,
	});

	let scheduler = Box::into_raw(boxed_scheduler);
	set_core_scheduler(scheduler);

        unsafe { /* FIXME */
		SCHEDULERS.as_mut().unwrap().insert(core_id, &(*scheduler));
	}
}
/// Add a per-core scheduler for the current core.
Add a per-core scheduler for the current core.
Add a per - core scheduler for the current core .
pub fn add_current_core() {
	// Create an idle task for this core.
	let core_id = core_id();
	let tid = get_tid();
	let idle_task = Rc::new(RefCell::new(Task::new_idle(tid, core_id)));
	// Add the ID -> Task mapping.
	unsafe {
		TASKS
			.as_ref()
			.unwrap()
			.lock()
			.insert(tid, idle_task.clone());
	}
	// Initialize a scheduler for this core.
	debug!(
		"Initializing scheduler for core {} with idle task {}",
		core_id, tid
	);
	let boxed_scheduler = Box::new(PerCoreScheduler {
		core_id: core_id,
		current_task: idle_task.clone(),
		idle_task: idle_task.clone(),
		fpu_owner: idle_task,
		state: SpinlockIrqSave::new(SchedulerState {
			ready_queue: PriorityTaskQueue::new(),
			is_halted: false,
		}),
		finished_tasks: VecDeque::new(),
		blocked_tasks: SpinlockIrqSave::new(BlockedTaskQueue::new()),
		last_task_switch_tick: 0,
	});
	let scheduler = Box::into_raw(boxed_scheduler);
	set_core_scheduler(scheduler);
        unsafe { /* FIXME */
		SCHEDULERS.as_mut().unwrap().insert(core_id, &(*scheduler));
	}
}
pub fn add_current_core ( ) { // Create an idle task for this core. let core_id = core_id ( ) ; let tid = get_tid ( ) ; let idle_task = Rc :: new ( RefCell :: new ( Task :: new_idle ( tid , core_id ) ) ) ; // Add the ID -> Task mapping. unsafe { TASKS . as_ref ( ) . unwrap ( ) . lock ( ) . insert ( tid , idle_task . clone ( ) ) ; } // Initialize a scheduler for this core. debug ! ( " " core_id tid ) ; let boxed_scheduler = Box :: new ( PerCoreScheduler { core_id : core_id , current_task : idle_task . clone ( ) , idle_task : idle_task . clone ( ) , fpu_owner : idle_task , state : SpinlockIrqSave :: new ( SchedulerState { ready_queue : PriorityTaskQueue :: new ( ) , is_halted : false , } ) , finished_tasks : VecDeque :: new ( ) , blocked_tasks : SpinlockIrqSave :: new ( BlockedTaskQueue :: new ( ) ) , last_task_switch_tick : 0 , } ) ; let scheduler = Box :: into_raw ( boxed_scheduler ) ; set_core_scheduler ( scheduler ) ; unsafe { /* FIXME */ SCHEDULERS . as_mut ( ) . unwrap ( ) . insert ( core_id , & ( * scheduler ) ) ; } }
Add a per-core scheduler for the current core.
Add a per - core scheduler for the current core .