khypervisor
v1
|
00001 #include "hvmm_types.h" 00002 #include "gic.h" 00003 #include "armv7_p15.h" 00004 #include "context.h" 00005 #include "hvmm_trace.h" 00006 #include "vgic.h" 00007 #include "virq.h" 00008 00009 #include <log/uart_print.h> 00010 00011 hvmm_status_t hvmm_interrupt_init(void) 00012 { 00013 hvmm_status_t ret = HVMM_STATUS_UNKNOWN_ERROR; 00014 00015 /* Route IRQ/IFQ to Hyp Exception Vector */ 00016 { 00017 uint32_t hcr; 00018 00019 hcr = read_hcr(); uart_print( "hcr:"); uart_print_hex32(hcr); uart_print("\n\r"); 00020 hcr |= HCR_IMO | HCR_FMO; 00021 write_hcr( hcr ); 00022 hcr = read_hcr(); uart_print( "hcr:"); uart_print_hex32(hcr); uart_print("\n\r"); 00023 } 00024 00025 /* Physical Interrupt: GIC Distributor & CPU Interface */ 00026 ret = gic_init(); 00027 00028 /* Virtual Interrupt: GIC Virtual Interface Control */ 00029 if ( ret == HVMM_STATUS_SUCCESS ) ret = vgic_init(); 00030 if ( ret == HVMM_STATUS_SUCCESS ) ret = vgic_enable(1); 00031 if ( ret == HVMM_STATUS_SUCCESS ) ret = virq_init(); 00032 00033 return ret; 00034 }