mirror of
				https://github.com/projectacrn/acrn-hypervisor.git
				synced 2025-11-04 11:48:50 +00:00 
			
		
		
		
	Instead of "#include <x86/foo.h>", use "#include <asm/foo.h>". In other words, we are adopting the same practice in Linux kernel. Tracked-On: #5920 Signed-off-by: Liang Yi <yi.liang@intel.com> Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
		
			
				
	
	
		
			56 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			56 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
/*
 | 
						|
 * Copyright (C) 2019 Intel Corporation. All rights reserved.
 | 
						|
 *
 | 
						|
 * SPDX-License-Identifier: BSD-3-Clause
 | 
						|
 */
 | 
						|
 | 
						|
#include <asm/per_cpu.h>
 | 
						|
#include <schedule.h>
 | 
						|
 | 
						|
static int32_t sched_noop_init(struct sched_control *ctl)
 | 
						|
{
 | 
						|
	struct sched_noop_control *noop_ctl = &per_cpu(sched_noop_ctl, ctl->pcpu_id);
 | 
						|
	ctl->priv = noop_ctl;
 | 
						|
 | 
						|
	return 0;
 | 
						|
}
 | 
						|
 | 
						|
static struct thread_object *sched_noop_pick_next(struct sched_control *ctl)
 | 
						|
{
 | 
						|
	struct sched_noop_control *noop_ctl = (struct sched_noop_control *)ctl->priv;
 | 
						|
	struct thread_object *next = NULL;
 | 
						|
 | 
						|
	if (noop_ctl->noop_thread_obj != NULL) {
 | 
						|
		next = noop_ctl->noop_thread_obj;
 | 
						|
	} else {
 | 
						|
		next = &get_cpu_var(idle);
 | 
						|
	}
 | 
						|
	return next;
 | 
						|
}
 | 
						|
 | 
						|
static void sched_noop_sleep(struct thread_object *obj)
 | 
						|
{
 | 
						|
	struct sched_noop_control *noop_ctl = (struct sched_noop_control *)obj->sched_ctl->priv;
 | 
						|
 | 
						|
	if (noop_ctl->noop_thread_obj == obj) {
 | 
						|
		noop_ctl->noop_thread_obj = NULL;
 | 
						|
	}
 | 
						|
}
 | 
						|
 | 
						|
static void sched_noop_wake(struct thread_object *obj)
 | 
						|
{
 | 
						|
	struct sched_noop_control *noop_ctl = (struct sched_noop_control *)obj->sched_ctl->priv;
 | 
						|
 | 
						|
	if (noop_ctl->noop_thread_obj == NULL) {
 | 
						|
		noop_ctl->noop_thread_obj = obj;
 | 
						|
	}
 | 
						|
}
 | 
						|
 | 
						|
struct acrn_scheduler sched_noop = {
 | 
						|
	.name		= "sched_noop",
 | 
						|
	.init		= sched_noop_init,
 | 
						|
	.pick_next	= sched_noop_pick_next,
 | 
						|
	.sleep		= sched_noop_sleep,
 | 
						|
	.wake		= sched_noop_wake,
 | 
						|
};
 |