当前位置: 首页>>代码示例>>C++>>正文


C++ sched_init函数代码示例

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


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


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