• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ sched_init函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中sched_init函数的典型用法代码示例。如果您正苦于以下问题:C++ sched_init函数的具体用法?C++ sched_init怎么用?C++ sched_init使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了sched_init函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: kern_init

int __noreturn
kern_init(void) {
    extern char edata[], end[];
    memset(edata, 0, end - edata);

    cons_init();                // init the console

    const char *message = "(THU.CST) os is loading ...";
    cprintf("%s\n\n", message);

    print_kerninfo();

    pmm_init();                 // init physical memory management

    pic_init();                 // init interrupt controller
    idt_init();                 // init interrupt descriptor table

    vmm_init();                 // init virtual memory management
    sched_init();               // init scheduler
    proc_init();                // init process table
    sync_init();                // init sync struct

    ide_init();                 // init ide devices
    swap_init();                // init swap
    fs_init();                  // init fs

    clock_init();               // init clock interrupt
    intr_enable();              // enable irq interrupt

    cpu_idle();                 // run idle process
}
开发者ID:spinlock,项目名称:ucore,代码行数:31,代码来源:init.c


示例2: main

int main()
{
	unsigned long i = 0, cnt = 0;
	unsigned char c;

	GPBCON	 = GPB7_out|GPB8_out|GPB9_out|GPB10_out;
	
	init_uart( );	//波特率57600,8N1(8个数据位,无校验位,1个停止位)

	DPRINTK(KERNEL_DEBUG,"\n\rkernel:enter main\n\r");		

	sched_init( );

//	OS_ENTER_CRITICAL();	
	
	OSCreateProcess(15*1024,1024,NULL,NULL,5);

	DPRINTK(KERNEL_DEBUG,"\n\rkernel:first\n\r");	

	while(1){

//		schedule();
//		DPRINTK(KERNEL_DEBUG,"kernel:main\n\r");
/*		if(i&1){
			DPRINTK(KERNEL_DEBUG,"1\n\r");
		}
		
*/
//		GPBDAT = (~(++i))<<7;
		DPRINTK(KERNEL_DEBUG,"kernel:process 0\n\r");
		wait(1000000); 
	}

	return 0;
}
开发者ID:Hertz1239,项目名称:s3c2440,代码行数:35,代码来源:main.c


示例3: main

int main(void)
{
	sched_init(); /* initialize the scheduler */
	led_init(); /* initialize led */
	button_init(); /* initialize button */
	adc_init(); /* initialize ADC (battery voltage measurement) */
	serial_init(); /* initialize serial communication */
	wheel_init(); /* initialize encoders, PWM output, PID etc. */
	pid_interval = 50; /* default PID update interval 50ms */ 
	pid_rate = 1000/pid_interval; /* [Hz] always remember after setting pid_interval */
	pfbst_interval = 20; /* send $PFBST at 20 ms interval */
	nmea_wd_timeout = 1; /* set PFBCT watchdog timeout to 100ms */
	nmea_wd = NMEA_WD_TOUT+1; /* make sure we begin in watchdog timeout state */
	voltage_min = VOLTAGE_MIN_DEFAULT;
	battery_low_warning = false;
	state_update();
	sei(); /* enable interrupts */
	nmea_init(); /* initialize nmea protocol handler */

	for (;;) /* go into an endless loop */
	{
		/* motor_update(); */

		if (t1ms != 0) /* if the interrupt has timed out after 10ms */
		{
			t1ms --;
			sched_update(); /* run the scheduler */
		}
		else
		{
			nmea_rx_update();
		}
	}
	return 0; /* just for the principle as we never get here */
}
开发者ID:jelar11,项目名称:Frobit,代码行数:35,代码来源:main.c


示例4: threads_test_case

void threads_test_case(int nthreads, int nyields)
{
	test_thread_param_t* params = calloc(nthreads, sizeof(test_thread_param_t));
	int counter = 0;
	int i;

	printf("Started test case with %d threads, each yielding %d times.\n", nthreads, nyields);
	for (i=0;i<nthreads;++i)
	{
		params[i].global_counter = &counter;
		params[i].nthreads = nthreads;
		params[i].num_yields = nyields;
		params[i].thread_id = i;
	}
	thread_manager_init(sched_init(stFifo));

	for (i=0;i<nthreads;++i)
	{
		create_thread(&test_thread, &params[i]);
//		printf("Thread %d created.\n", i);
	}

//	printf("Starting threads.\n");
	threads_start();
//	printf("All threads finished.\n");
}
开发者ID:FreifeldRoyi,项目名称:user-level-threads,代码行数:26,代码来源:test_threads.c


示例5: resch_init

static int __init resch_init(void)
{
	int ret;

	printk(KERN_INFO "RESCH: HELLO!\n");

	/* get the device number of a char device. */
	ret = alloc_chrdev_region(&dev_id, 0, 1, MODULE_NAME);
	if (ret < 0) {
		printk(KERN_WARNING "RESCH: failed to allocate device.\n");
		return ret;
	}

	/* initialize the char device. */
	cdev_init(&c_dev, &resch_fops);

	/* register the char device. */
	ret = cdev_add(&c_dev, dev_id, 1);
	if (ret < 0) {
		printk(KERN_WARNING "RESCH: failed to register device.\n");
		return ret;
	}

	sched_init();
	component_init();

	return 0;
}
开发者ID:neilaudsley,项目名称:linux-rtx,代码行数:28,代码来源:main.c


示例6: filesystem_init

void filesystem_init() {
	sched_init();
    int a;
    int b;
    int c;
    c = a+b;
printf("%s %d: %s()\n", __FILE__, __LINE__, __FUNCTION__);
}
开发者ID:vijkp,项目名称:Remodel,代码行数:8,代码来源:filesystem.c


示例7: network_init

void network_init() {
	sched_init();
    int a;
    int b;
    int c;
    c = a+b;
printf("%s %d: %s()\n", __FILE__, __LINE__, __FUNCTION__);
}
开发者ID:vijkp,项目名称:Remodel,代码行数:8,代码来源:network.c


示例8: start_sched

void start_sched()
{
    int rc = sched_init();
    if (rc)
        return;

    sched_start_idle();
}
开发者ID:JamesLinus,项目名称:levos6,代码行数:8,代码来源:main.c


示例9: main

void main(void)		/* This really IS void, no error here. */
{			/* The startup routine assumes (well, ...) this */
/*
 * Interrupts are still disabled. Do necessary setups, then
 * enable them
 */
 	ROOT_DEV = ORIG_ROOT_DEV;
 	drive_info = DRIVE_INFO;
	memory_end = (1<<20) + (EXT_MEM_K<<10);
	memory_end &= 0xfffff000;
	if (memory_end > 16*1024*1024)
		memory_end = 16*1024*1024;
	if (memory_end > 12*1024*1024) 
		buffer_memory_end = 4*1024*1024;
	else if (memory_end > 6*1024*1024)
		buffer_memory_end = 2*1024*1024;
	else
		buffer_memory_end = 1*1024*1024;
	main_memory_start = buffer_memory_end;
#ifdef RAMDISK
	main_memory_start += rd_init(main_memory_start, RAMDISK*1024);
#endif
	mem_init(main_memory_start,memory_end);
	trap_init();
	blk_dev_init();
	chr_dev_init();
	tty_init();
	time_init();
	sched_init();
	buffer_init(buffer_memory_end);
	hd_init();
	floppy_init();
	sti();
	move_to_user_mode();

	setup((void *) &drive_info);
	(void) open("/dev/tty0",O_RDWR,0);
	(void) dup(0);
	(void) dup(0);
	(void) open("/var/process.log",O_CREAT|O_TRUNC|O_WRONLY,0666);
#ifdef dis_func
	(void) open("/var/dis_func.log",O_CREAT|O_TRUNC|O_WRONLY,0666);
#endif

	if (!fork()) {		/* we count on this going ok */
		init();
	}
/*
 *   NOTE!!   For any other task 'pause()' would mean we have to get a
 * signal to awaken, but task0 is the sole exception (see 'schedule()')
 * as task 0 gets activated at every idle moment (when no other tasks
 * can run). For task0 'pause()' just means we go check if some other
 * task can run, and if not we return here.
 */
	for(;;) pause();
}
开发者ID:henryZe,项目名称:linux0.11,代码行数:56,代码来源:main.c


示例10: main

int main() {
        sched_init();
        mythread_start(thread_function1, NULL);
        mythread_start(thread_function2, NULL);
        mythread_start(thread_function3, NULL);
        timer_setup(sig_timer_handler, 25000);
        while(1) ;
        return 0;

}
开发者ID:mmhl,项目名称:threads,代码行数:10,代码来源:main.c


示例11: main

int main(int argc, char **argv) {
    struct sigaction sa;
    sa.sa_flags=0;
    sigemptyset(&sa.sa_mask);
    sa.sa_handler=abrt_handler;
    sigaction(SIGABRT,&sa,NULL);
    sched_init(test_fn);
    fprintf(stdout, "Should not ever get here.\n");
    return 0;
}
开发者ID:Shuyang1996,项目名称:LinuxOperatingSystem,代码行数:10,代码来源:schedTest.c


示例12: main

/*
 * Initialization code.
 *
 * Called from kernel_start() routine that is
 * implemented in HAL.
 * We assume that the following machine state has
 * been already set before this routine.
 *	- Kernel BSS section is filled with 0.
 *	- Kernel stack is configured.
 *	- All interrupts are disabled.
 *	- Minimum page table is set. (MMU systems only)
 */
int
main(void)
{

	sched_lock();
	diag_init();
	DPRINTF((BANNER));

	/*
	 * Initialize memory managers.
	 */
	page_init();
	kmem_init();

	/*
	 * Do machine-dependent
	 * initialization.
	 */
	machine_startup();

	/*
	 * Initialize kernel core.
	 */
	vm_init();
	task_init();
	thread_init();
	sched_init();
	exception_init();
	timer_init();
	object_init();
	msg_init();

	/*
	 * Enable interrupt and
	 * initialize devices.
	 */
	irq_init();
	clock_init();
	device_init();

	/*
	 * Set up boot tasks.
	 */
	task_bootstrap();

	/*
	 * Start scheduler and
	 * enter idle loop.
	 */
	sched_unlock();
	thread_idle();

	/* NOTREACHED */
	return 0;
}
开发者ID:AdamRLukaitis,项目名称:prex,代码行数:67,代码来源:main.c


示例13: main

main()
{
	struct sigaction sa;
	sa.sa_flags=0;
	sa.sa_handler=wakeup_handler;
	sigemptyset(&sa.sa_mask);
	sigaction(SIGUSR1,&sa,NULL);
	sigaction(SIGUSR2,&sa,NULL);
	sched_init(init_fn);
	fprintf(stderr,"Whoops\n");
}
开发者ID:williamho,项目名称:os,代码行数:11,代码来源:schedtest_9fork.c


示例14: main

int main() {
  sched_init();
  mtx_yield_init(&m);

  thread_t *t1 = thread_create("t1", demo_thread_1);
  thread_t *t2 = thread_create("t2", demo_thread_2);

  sched_add(t1);
  sched_add(t2);

  sched_run(10);
}
开发者ID:Darge,项目名称:mimiker,代码行数:12,代码来源:mutex_yield.c


示例15: init_hw

/*! \details This function initializes the hardware
 *
 */
void init_hw(void){
	_hwpl_core_setclock(cpu_init_freq, microcomputer_osc_freq); //Set the main clock
	hwpl_fault_init();
	_hwpl_core_priv_enable_interrupts(NULL); //Enable the interrupts

	if ( sched_init() < 0 ){ //Initialize the hardware used for the scheduler
		_hwpl_core_priv_disable_interrupts(NULL);
		gled_priv_error(0);
	}

	check_reset_source();
}
开发者ID:GDXN,项目名称:CoActionOS-Public,代码行数:15,代码来源:caos_main.c


示例16: start_master

/**
 * 主核初始化
 */
asmlinkage void __init start_master(void)
{
	debug_printstr_mmu("xby_debug, start cpu 0\n");

	local_irq_disable();

	//tick_init();
	
	/* 为当前CPU设置其活动掩码 */
	boot_cpu_init();
	/* 体系结构特定的初始化过程 */
	start_arch();

	//初始化boot内存分配器
	InitBootMemory(0xc0000000 + 8 * 1024 * 1024, 0xc0000000 + 24 * 1024 * 1024);
	
	init_IRQ();
	//体系结构和驱动的一些初始化过程
	//run_initcall();

	//为VFS分配一些大的内存块,用于哈希表。此过程必须在boot阶段分配。
	//vfs_caches_init_early();

#ifdef FS
	blk_dev_init();
	inode_init();
	file_table_init();
	name_cache_init();
	buffer_init_early();
#endif
	memory_init();
#ifdef FS
	buffer_init_tail();
	tty_init();
#endif
	sched_init();
	time_init();
	setup_timer();
	serial_init();
	//mmc_init();
	//omap_gpio_init();
	//初始化文件系统
	//vfs_caches_init(num_physpages);
	local_irq_enable();

	//创建系统任务,以及用户任务入口
	TaskEntry();
	cpu_idle();

	//不可能运行到这里来
	BUG();
}
开发者ID:hominlinx,项目名称:hot-pot-lab,代码行数:55,代码来源:main.c


示例17: main

int main(void)
{
	trap_init();
	sched_init();
	sti();
	move_to_user_mode();

	myprint("In kernel");

	while(1){}

	return 0;
}
开发者ID:hushi55,项目名称:minios,代码行数:13,代码来源:main.c


示例18: main

int main(void)
{
	irq_init();
	irq_disable();

#ifdef CONFIG_FPU
	*SCB_CPACR |= (SCB_CPACR_CP10_FULL | SCB_CPACR_CP11_FULL);
#endif

#ifdef CONFIG_DEBUG
	dbg_device_init();
	dbg_layer = DL_KDB;
#endif
	__l4_printf("%s", banner);
	run_init_hook(INIT_LEVEL_PLATFORM);

#ifdef CONFIG_SYMMAP
	ksym_init();
#endif
	sched_init();
	memory_init();
	syscall_init();
	thread_init_subsys();
	ktimer_event_init();

#ifdef CONFIG_KPROBES
	kprobe_init();
#endif /* CONFIG_KPROBES */

#ifdef CONFIG_KDB
	softirq_register(KDB_SOFTIRQ, debug_kdb_handler);
	dbg_puts("Press '?' to print KDB menu\n");
#endif
	run_init_hook(INIT_LEVEL_KERNEL);

	/* Not creating kernel thread here because it corrupts current stack
	 */
	create_idle_thread();
	create_root_thread();

	ktimer_event_create(64, ipc_deliver, NULL);

	mpu_enable(MPU_ENABLED);

	run_init_hook(INIT_LEVEL_LAST);

	switch_to_kernel();

	/* Not reached */
	return 0;
}
开发者ID:BaseZwe,项目名称:f9-kernel,代码行数:51,代码来源:start.c


示例19: start_hypervisor

void start_hypervisor()
{
    int i;
    uint8_t nr_vcpus = 1; // TODO: It will be read from configuration file.

    uint32_t pcpu = smp_processor_id();

    if (pcpu == 0) {
        timemanager_init();
        sched_init();

        vm_setup();

        for (i = 0; i < NUM_GUESTS_STATIC; i++) {
            vmid_t vmid;

            if ((vmid = vm_create(nr_vcpus)) == VM_CREATE_FAILED) {
                printf("vm_create(vm[%d]) is failed\n", i);
                goto error;
            }
            if (vm_init(vmid) != HALTED) {
                printf("vm_init(vm[%d]) is failed\n", i);
                goto error;
            }
            if (vm_start(vmid) != RUNNING) {
                printf("vm_start(vm[%d]) is failed\n", i);
                goto error;
            }
        }

        smp_pen = 1;
    } else {
        while (!smp_pen) ;
        printf("cpu[%d] is enabled\n", pcpu);
    }

    /*
     * TODO: Add a function - return vmid or vcpu_id to execute for the first time.
     * TODO: Rename guest_sched_start to do_schedule or something others.
     *       do_schedule(vmid) or do_schedule(vcpu_id)
     */
    printf("sched_start!!!\n");
    sched_start();

    /* The code flow must not reach here */
error:
    printf("-------- [%s] ERROR: K-Hypervisor must not reach here\n", __func__);
    abort();
}
开发者ID:casionwoo,项目名称:khypervisor-v2,代码行数:49,代码来源:main.c


示例20: STARTUP

/*
 * initialisation function
 * We start here as soon as we have a stack.
 * Here we initialize the various systems
 * and devices that need to be initialized.
 */
STARTUP(void kmain())
{
	// TODO: move these to the appropriate headers
	void vtinit();
	void grayinit();
	void loadavinit();
	void battinit();
	void usageinit();
	void bogomips();

	calloutinit();
	lcdinit();
	meminit();
	grayinit();
	vtinit();
	linkinit();
	audioinit();
	sched_init();
	procinit();
	bufinit();
	flashinit();
	inodeinit();
	loadavinit();
	battinit();
	usageinit();
	
#if 1
	kprintf("%s build %s\n", uname_sysname, uname_version);
#else
	kprintf("%s v%s\n", uname_sysname, uname_release);
	kputs(
	 "Copyright 2005-2011 Christopher Williams <[email protected]>\n"
	 "Some portions copyright 2003, 2005 PpHd\n"
	 "\n"
	 "This program comes with ABSOLUTELY NO WARRANTY.\n"
	 "You may redistribute copies of this program\n"
	 "under the terms of the GNU General Public License.\n"
	 "\n");
#endif
	if (realtime.tv_sec < 1000000000L) { /* before ~2001 */
		extern const unsigned long build_date;
		realtime.tv_sec = build_date;
		realtime.tv_nsec = 0;
	}
	G.seconds = realtime.tv_sec;
	uptime.tv_sec = uptime.tv_nsec = 0;
	spl0();
	bogomips();
}
开发者ID:abbrev,项目名称:punix,代码行数:55,代码来源:main.c



注:本文中的sched_init函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ sched_setaffinity函数代码示例发布时间:2022-05-30
下一篇:
C++ sched_gettcb函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap