#include <context.h>
#include <vdev.h>
#include <hvmm_trace.h>
#include <log/print.h>
Go to the source code of this file.
Define Documentation
Definition at line 7 of file vdev.c.
Function Documentation
Definition at line 49 of file vdev.c.
{
hvmm_status_t result = HVMM_STATUS_NOT_FOUND;
int i = 0;
uint32_t offset;
uint8_t isize = 4;
HVMM_TRACE_ENTER();
if ( regs->cpsr & 0x20 ) {
isize = 2;
}
for (i = 0; i < MAX_VDEV; i++){
if ( vdev_list[i].base == 0 ) break;
offset = fipa - vdev_list[i].base;
if ( fipa >= vdev_list[i].base && offset < vdev_list[i].size && vdev_list[i].handler != 0) {
printh("vdev: found %s for fipa %x srt:%x gpr[srt]:%x write:%d vmid:%d\n", vdev_list[i].name, fipa, srt, regs->gpr[srt], wnr, context_current_vmid() );
result = vdev_list[i].handler(wnr, offset, &(regs->gpr[srt]), access_size);
if ( wnr == 0 ) {
printh("vdev: result:%x\n", regs->gpr[srt] );
}
regs->pc += isize;
break;
} else {
printh("vdev: fipa %x base %x not matched\n", fipa, vdev_list[i].base );
}
}
HVMM_TRACE_EXIT();
return result;
}
Variable Documentation
Definition at line 9 of file vdev.c.