Skip to content

Commit

Permalink
pmu config working, no interrupts yet
Browse files Browse the repository at this point in the history
  • Loading branch information
maskedarray committed Aug 7, 2023
1 parent 18c2ff1 commit 76b5d0f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
9 changes: 1 addition & 8 deletions bao-hypervisor/configs/alsaqr-baremetal/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ struct config config = {
}
},

.dev_num = 3,
.dev_num = 2,
.devs = (struct dev_region[]) {
{
.pa = 0x40000000,
Expand All @@ -46,13 +46,6 @@ struct config config = {
.interrupt_num = 4,
.interrupts = (uint64_t[]) {4,5,6,7}
},
{
.pa = 0x10404000,
.va = 0x10404000,
.size = 0x00001000,
.interrupt_num = 4,
.interrupts = (uint64_t[]) {142,143,144,145}
},
},

.arch = {
Expand Down
1 change: 1 addition & 0 deletions bao-hypervisor/src/core/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ void init(uint64_t cpu_id, uint64_t load_addr, uint64_t config_addr)

interrupts_init();


vmm_init();

/* Should never reach here */
Expand Down
9 changes: 5 additions & 4 deletions bao-hypervisor/src/core/vmm.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ void vmm_init()
bool assigned = false;
size_t vm_id = 0;
vm_config_t *vm_config = NULL;

printk("Uart page size is: \n\r");
/**
* Assign cpus according to vm affinity.
*/
Expand Down Expand Up @@ -227,7 +227,7 @@ void vmm_init()
}

cpu_sync_barrier(&cpu_glb_sync);

printk("Uart page size is: \n\r");
if (assigned) {
vm_config = &vm_config_ptr->vmlist[vm_id];
if (master) {
Expand All @@ -248,15 +248,16 @@ void vmm_init()
}

cpu_sync_barrier(&cpu_glb_sync);

printk("Uart page size is: \n\r");
if (cpu.id == CPU_MASTER) {
mem_free_vpage(&cpu.as, (void*)vm_assign, vmass_npages, true);
}

ipc_init(vm_config, master);

printk("Uart page size is: final \n\r");
if (assigned) {
vm_init((void*)BAO_VM_BASE, vm_config, master, vm_id);
printk("Uart page size is: final2 \n\r");
unsigned long _stime = CSRR(CSR_TIME);
printk("The time is: %lu\r\n", _stime);
pmu_v1_run_localrun();
Expand Down

0 comments on commit 76b5d0f

Please sign in to comment.