Skip to content

Commit

Permalink
working pmu interrupts in bao hypervisor
Browse files Browse the repository at this point in the history
  • Loading branch information
maskedarray committed Aug 7, 2023
1 parent 76b5d0f commit 1884398
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bao-hypervisor/src/core/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
#include <fences.h>
#include <spinlock.h>

void pmu_v1_interrupt_handler(){
printk("PMU interrupt in hypervisor\n\r");
}

volatile bao_uart_t uart
__attribute__((section(".devices"), aligned(PAGE_SIZE)));
bool ready = false;
Expand Down
2 changes: 2 additions & 0 deletions bao-hypervisor/src/core/inc/console.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ typedef struct {
extern volatile pmu_v1_global_t pmu_v1_global
__attribute__((section(".devices")));

void pmu_v1_interrupt_handler();

void console_init();
void console_write(char const* const str);

Expand Down
3 changes: 3 additions & 0 deletions bao-hypervisor/src/core/interrupts.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <vm.h>
#include <bitmap.h>
#include <string.h>
#include <console.h>

BITMAP_ALLOC(hyp_interrupt_bitmap, MAX_INTERRUPTS);
BITMAP_ALLOC(global_interrupt_bitmap, MAX_INTERRUPTS);
Expand Down Expand Up @@ -52,6 +53,8 @@ inline void interrupts_init()

if (cpu.id == CPU_MASTER) {
interrupts_reserve(IPI_CPU_MSG, cpu_msg_handler);
interrupts_reserve(143, pmu_v1_interrupt_handler);
interrupts_cpu_enable(143, true);
}

interrupts_cpu_enable(IPI_CPU_MSG, true);
Expand Down

0 comments on commit 1884398

Please sign in to comment.