/* Initialise xenbus. */ void init_xenbus(void) { portBASE_TYPE ret; DEBUG("init_xenbus called.\n"); init_waitqueue_head(&xb_waitq); init_waitqueue_head(&req_wq); init_waitqueue_head(&xenbus_watch_queue); watches = NULL; xb_write_sem = xSemaphoreCreateMutex(); arch_init_xenbus(&xenstore_buf, &store_evtchn); DEBUG("init_xenbus: buf = 0x%x, evtchn = %d\n", xenstore_buf, store_evtchn); ret = xTaskCreate(xenbus_thread_func, ( signed portCHAR * ) "xenbusTask", 4096, NULL, configXENBUS_TASK_PRIORITY, NULL); if (ret != pdPASS) { printk("Error creating xenbus task, status was %d\n", ret); BUG(); } bind_evtchn(store_evtchn, xenbus_evtchn_handler, NULL); unmask_evtchn(store_evtchn); gic_register_handler(EVENT_IRQ, handle_event); gic_enable_interrupt(EVENT_IRQ /* interrupt number */, 0x1 /*cpu_set*/, 1 /*level_sensitive*/, 0 /* ppi */); gic_set_priority(EVENT_IRQ, configEVENT_IRQ_PRIORITY << portPRIORITY_SHIFT); printk("Xen event IRQ enabled at priority %d\n", configEVENT_IRQ_PRIORITY); printk("xenbus initialised on event channel %d\n", store_evtchn); }
void vConfigureTickInterrupt( void ) { setup_timer(); gic_register_handler(VIRTUAL_TIMER_IRQ, handle_timer_interrupt); gic_enable_interrupt(VIRTUAL_TIMER_IRQ /* interrupt number */, 0x1 /*cpu_set*/, 1 /*level_sensitive*/, 1 /* ppi */); gic_set_priority(VIRTUAL_TIMER_IRQ, configTICK_PRIORITY << portPRIORITY_SHIFT); printk("Timer event IRQ enabled at priority %d\n", configTICK_PRIORITY); }
/* UART Init Function */ void UART_init(void) { unsigned mis_status = 0; /* Set Interrupt mask Register */ uart->MSC = (UARTMSC_RX | UARTMSC_RT); /* Enable UART for Transmit and Receive */ uart->LCR_H = UARTLCR_H_FIFOENABLE; uart->Ctrl = UARTCR_ENABLE | UARTCR_TXENABLE | UARTCR_RXENABLE; gic_register_handler(32, &UartInterruptHandler); gic_set_target_2_interrupt(32, 0); }