8#include "pedigree/kernel/process/DeferredTimeAccounting.h"
9#include "pedigree/kernel/process/InterruptTimeAccounting.h"
10#include "pedigree/kernel/process/Thread.h"
11#include "pedigree/kernel/processor/Processor.h"
12#include "pedigree/kernel/processor/ProcessorInformation.h"
14InterruptTimeAccounting::InterruptTimeAccounting(
bool fromUserspace)
15 : m_pThread(
Processor::information().getCurrentThread()), m_bFromUserspace(fromUserspace) {
16 if (!m_pThread || !m_pThread->getParent()) {
21 m_pThread->transitionTime(KernelTimeTransition::interrupted(m_bFromUserspace),
22 KernelTimeTransition::handler());
25InterruptTimeAccounting::~InterruptTimeAccounting() {
33 if (!m_bFromUserspace) {
35 KernelTimeTransition::resumed(
false));
static void finishUserReturn(Thread *thread)
CpuTimeMode currentTimeAccountingMode() const
ALWAYS_INLINE void transitionTimeAtInterruptReturn(CpuTimeMode from, CpuTimeMode to)
void transitionTime(CpuTimeMode from, CpuTimeMode to, bool interruptsAlreadyDisabled=false)