Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/pmckern.h
Show First 20 Lines • Show All 263 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
* Soft events functions. | * Soft events functions. | ||||
*/ | */ | ||||
void pmc_soft_ev_register(struct pmc_soft *ps); | void pmc_soft_ev_register(struct pmc_soft *ps); | ||||
void pmc_soft_ev_deregister(struct pmc_soft *ps); | void pmc_soft_ev_deregister(struct pmc_soft *ps); | ||||
struct pmc_soft *pmc_soft_ev_acquire(enum pmc_event ev); | struct pmc_soft *pmc_soft_ev_acquire(enum pmc_event ev); | ||||
void pmc_soft_ev_release(struct pmc_soft *ps); | void pmc_soft_ev_release(struct pmc_soft *ps); | ||||
#ifdef VM_H | |||||
mhorne: This is a bit ugly, but I wanted to avoid pulling in `vm/vm.h` unconditionally. | |||||
/* Page fault events */ | |||||
PMC_SOFT_DECLARE( , , page_fault, all); | |||||
PMC_SOFT_DECLARE( , , page_fault, read); | |||||
PMC_SOFT_DECLARE( , , page_fault, write); | |||||
/* | |||||
* Helper function for the page fault soft events. To be called from the MD | |||||
* trap handler. | |||||
*/ | |||||
static __inline void | |||||
pmc_soft_page_fault(vm_prot_t ftype, struct trapframe *tf) | |||||
{ | |||||
if (ftype != VM_PROT_READ && ftype != VM_PROT_WRITE) | |||||
jhbUnsubmitted Not Done Inline ActionsSeems like it would be ok to add another event for instruction fetch faults as well using VM_PROT_EXEC? jhb: Seems like it would be ok to add another event for instruction fetch faults as well using… | |||||
return; | |||||
PMC_SOFT_CALL_TF( , , page_fault, all, tf); | |||||
if (ftype == VM_PROT_READ) | |||||
PMC_SOFT_CALL_TF( , , page_fault, read, tf); | |||||
else | |||||
PMC_SOFT_CALL_TF( , , page_fault, write, tf); | |||||
} | |||||
#endif | |||||
#endif /* _SYS_PMCKERN_H_ */ | #endif /* _SYS_PMCKERN_H_ */ |
This is a bit ugly, but I wanted to avoid pulling in vm/vm.h unconditionally.