Exemple #1
0
/*
 * The background async daemon.
 * Started as a kernel thread from the init process.
 */
int asyncd(void *unused)
{
	current->session = 1;
	current->pgrp = 1;
	sprintf(current->comm, "asyncd");
	
	sigfillset(&current->blocked); /* block all signals */
	recalc_sigpending(current);
  
	/* Give asyncd a realtime priority. */
	current->policy = SCHED_FIFO;
	current->priority = 32;  /* Fixme --- we need to standardise our
				    namings for POSIX.4 realtime scheduling
				    priorities.  */
  
	printk("Started asyncd\n");

#if CONFIG_AP1000
	bif_add_debug_key('a',asyncd_info,"stats on asyncd");
#endif

	while (1) {
		unsigned flags;

		save_flags(flags); cli();

		while (!async_queue) {
			spin_lock_irq(&current->sigmask_lock);
			flush_signals(current);
			spin_unlock_irq(&current->sigmask_lock);
			interruptible_sleep_on(&asyncd_wait);
		}

		restore_flags(flags);

		run_async_queue();
	}
}
Exemple #2
0
void mpp_hw_init(void)
{
	extern void show_state(void);
	extern void breakpoint(void);
	extern void ctrl_alt_del(void);
	extern void mac_print_state(void);
	extern void show_debug_keys(void);
	
	bif_add_debug_key('c',check_alive,"check if a cell is alive");
	bif_add_debug_key('k',show_debug_keys,"show the kernel debug keys");
	bif_add_debug_key('p',show_registers,"show register info");
	bif_add_debug_key('p',show_registers,"show register info");
	bif_add_debug_key('m',show_mem,"detailed memory stats");
	bif_add_debug_key('s',show_state,"detailed process stats");
	bif_add_debug_key('D',ap_start_debugger,"launch the kernel debugger");
	bif_add_debug_key('i',breakpoint,"send a breakpoint");
	bif_add_debug_key('r',ctrl_alt_del,"run shutdown (doesn't work)");  
	bif_add_debug_key('P',show_ptasks,"show running parallel tasks");  
	bif_add_debug_key('U',show_utasks,"show all user tasks");  
	bif_add_debug_key('O',show_otasks,"show own user tasks");  
	bif_add_debug_key('^',do_panic,"panic :-)");  
	
	
	cap_cid0 = BIF_IN(BIF_CIDR1);
	cap_ncel0 = cap_init.numcells;
	
	_cid = cap_cid0;
	_ncel = cap_ncel0;
	_ncelx = _ncel<8?_ncel:8;
	_ncely = ((_ncel-1) / _ncelx) + 1;
	_cidx = _cid % _ncelx;
	_cidy = _cid / _ncelx;
	
	ap_bif_init();
	ap_msc_init();
	ap_tnet_init();
	ap_profile_init();
	ap_other_irqs();
	ap_ringbuf_init();
#if APLOG
	ap_log(NULL,-1);
#endif
}