Exemple #1
0
void init_vb()
{
	init_video_driver();
	init_timer_driver();
	/* init_sound_driver(); */
	curr_game_state = SETUP; /* Really inelegant, but it'll do for now. */
	initial_game_mode = FOCUS_SCREEN;
	INT_ENABLE;
	init_just_occurred = 1;	
}
Exemple #2
0
int kmain(int argc, char** argv, uint32_t table)
{
	app_startup(); /* bss is valid after this point */
	global_data = table;

	/* Add your code here */
	unsigned int *user_stack_ptr;
	
	/*
	 * set up the custom swi ad irq handler by hijacking the existing swi handling
	 * infrastructure
	 */
	if(install_handler((unsigned int *)SWI_VECTOR_ADDR, (void *)s_handler) < 0){
		printf("\n KERNEL MAIN: installation of custom SWI handler failed");
		return 0xbadc0de;
}
	
	if(install_handler((unsigned int *)IRQ_VECTOR_ADDR, (void *)i_handler) < 0){
		printf("\n KERNEL MAIN: installation of custom IRQ handler failed");
		return 0xbadc0de;
}

	/*
	 * init the IRQ related registers
	 */
	init_irq_regs();	
	
	/*
	 * setup IRQ stack
	 */
	setup_irq_stack(irq_stack + IRQ_STACK_SIZE - sizeof(long));

	/*
	 * init the timer driver
	 */
	init_timer_driver();

	/*
	 * setup the user stack with command line args
	 */
	user_stack_ptr = setup_user_stack(argc, argv);

	/*
	 * launch the user task
	 */
	launch_user_app(user_stack_ptr);

	/*
	 * this is the point we will return to during the exit syscall
	 * from here, we return to uboot
	 */
    return (get_kernel_r0()); 
	return 0;
}