|
The Pedigree Project 0.1
|
#include <Processor.h>
Inheritance diagram for ProcessorBase:
Collaboration diagram for ProcessorBase:Static Public Member Functions | |
| static void | initialise1 (const BootstrapStruct_t &Info) INITIALISATION_ONLY |
| first stage in the initialisation of the processor-specific interface | |
| static void | initialise2 (const BootstrapStruct_t &Info) INITIALISATION_ONLY |
| second/last stage in the initialisation of the processor-specific interface | |
| static void | initialisationDone () |
| static void | deinitialise () |
| static size_t | isInitialised () |
| static uintptr_t | getBasePointer () |
| static uintptr_t | getStackPointer () |
| static uintptr_t | getInstructionPointer () |
| static void | switchAddressSpace (VirtualAddressSpace &AddressSpace) |
| static bool | saveState (SchedulerState &state) |
| static void | restoreState (SchedulerState &state, volatile uintptr_t *pLock=0) NORETURN |
| static void | restoreState (SyscallState &state, volatile uintptr_t *pLock=0) NORETURN |
| static void | contextSwitch (InterruptState *state) NORETURN |
| static void | switchState (bool bInterrupts, SchedulerState &a, SchedulerState &b, volatile uintptr_t *pLock=0) |
| static void | switchState (bool bInterrupts, SchedulerState &a, SyscallState &b, volatile uintptr_t *pLock=0) |
| static void | saveAndJumpKernel (bool bInterrupts, SchedulerState &s, volatile uintptr_t *pLock, uintptr_t address, uintptr_t stack, uintptr_t p1=0, uintptr_t p2=0, uintptr_t p3=0, uintptr_t p4=0) |
| static void | saveAndJumpUser (bool bInterrupts, SchedulerState &s, volatile uintptr_t *pLock, uintptr_t address, uintptr_t stack, uintptr_t p1=0, uintptr_t p2=0, uintptr_t p3=0, uintptr_t p4=0) |
| static void | jumpKernel (volatile uintptr_t *pLock, uintptr_t address, uintptr_t stack, uintptr_t p1=0, uintptr_t p2=0, uintptr_t p3=0, uintptr_t p4=0) NORETURN |
| static void | jumpUser (volatile uintptr_t *pLock, uintptr_t address, uintptr_t stack, uintptr_t p1=0, uintptr_t p2=0, uintptr_t p3=0, uintptr_t p4=0) NORETURN |
| static void | breakpoint () |
| static void | halt () |
| static void | reset () |
| static size_t | getDebugBreakpointCount () |
| static uintptr_t | getDebugBreakpoint (size_t nBpNumber, DebugFlags::FaultType &nFaultType, size_t &nLength, bool &bEnabled) |
| static void | enableDebugBreakpoint (size_t nBpNumber, uintptr_t nLinearAddress, DebugFlags::FaultType nFaultType, size_t nLength) |
| static void | disableDebugBreakpoint (size_t nBpNumber) |
| static uintptr_t | getDebugStatus () |
| static void | haltUntilInterrupt () |
| static void | pause () |
| static void | setInterrupts (bool bEnable) |
| static bool | getInterrupts () |
| static bool | inDeviceHardIrq () |
| static ExecutionContext | executionContext () |
| static bool | guardDeviceHardIrqOperation (DeviceHardIrqOperation operation) |
| static void | setSingleStep (bool bEnable, InterruptState &state) |
| static void | invalidate (void *pAddress) |
| static MUST_USE_RESULT TlbInvalidationResult | beginTlbInvalidation (TlbInvalidationGuard &guard) |
| static MUST_USE_RESULT TlbInvalidationResult | invalidateAll (void *pAddress) |
| static MUST_USE_RESULT TlbInvalidationResult | invalidateAll (void *pAddress, TlbInvalidationGuard &guard) |
| static bool | tlbInvalidationFailureActive () |
| static bool | tlbInvalidationTerminal () |
| static void | invalidateICache (uintptr_t nAddr) |
| static void | invalidateDCache (uintptr_t nAddr) |
| static void | flushDCache (uintptr_t nAddr) |
| static void | flushDCacheAndInvalidateICache (uintptr_t startAddr, uintptr_t endAddr) |
| static void | identify (HugeStaticString &str) |
| static ProcessorId | id () |
| static size_t | index () |
| static ProcessorInformation & | information () |
| static ProcessorInformation * | informationAt (size_t cpu) |
| static size_t | getCount () |
| static void | setTlsBase (uintptr_t newBase) |
| static uintptr_t | getUserGsBase () |
| static void | setUserGsBase (uintptr_t newBase) |
Static Public Attributes | |
| static size_t | m_Initialised = 0 |
Static Private Member Functions | |
| static NEVER_INLINE | __attribute__ ((cold)) bool rejectDeviceHardIrqOperation(DeviceHardIrqOperation operation) |
| static MUST_USE_RESULT bool | closeTlbInvalidationAdmissionForTerminalFailure (TlbInvalidationGuard &guard, TlbInvalidationResult result) |
| static void | endTlbInvalidation (TlbInvalidationGuard &guard) |
Static Private Attributes | |
| static ProcessorInformation::KernelGsAnchor | m_BootstrapKernelGsAnchor |
| static Vector< ProcessorInformation * > | m_ProcessorInformation |
| static ProcessorInformation | m_SafeBspProcessorInformation |
| static size_t | m_nProcessors = 1 |
Friends | |
| class | Multiprocessor |
| class | TlbInvalidationGuard |
| class | X86GdtManager |
| class | X64GdtManager |
| class | Scheduler |
Interface to the processor's capabilities
Architecture-specific implementations exist, and subclasses are used to add processor-specific methods (don't use the preprocessor for that anymore).
Cast a Processor object to the architecture-specific variant if you need to access architecturally unique features.
Definition at line 128 of file Processor.h.
|
static |
Admit a page-table mutation before its first PTE write.
The guard may cover more than one address and must remain alive through every corresponding invalidateAll call. This operation uses bounded polling and rejects hard-IRQ, scheduler-IRQ, synthetic-IRQ, and debugger contexts before the mapping can change. The guarded region must not sleep or wait for work which itself needs new mapping admission.
Definition at line 573 of file hosted/Processor.cc.
References executionContext().
Referenced by invalidateAll().
Here is the caller graph for this function:
|
static |
Trigger a breakpoint
Definition at line 663 of file hosted/Processor.cc.
Referenced by _assert(), and Log::addEntry().
Here is the caller graph for this function:
|
staticprivate |
Escalate an admitted mutation to terminal failure.
Definition at line 590 of file hosted/Processor.cc.
Referenced by TlbInvalidationGuard::closeAdmissionForTerminalFailure().
Here is the caller graph for this function:
|
static |
Restores a complete x64 interrupt frame through iretq.
The pointed-to state must remain valid and contain a fully validated return context. This is declared for future signal-return plumbing.
Referenced by X64SyscallManager::syscall().
Here is the caller graph for this function:
|
static |
Prepare the processor for reset by deinitialising things initialised in initialise2/initialise1.
Definition at line 154 of file hosted/Processor.cc.
|
static |
Disable a specific breakpoint
| [in] | nBpNumber | the breakpoint number [0 - (getDebugBreakpointCount()
|
Definition at line 454 of file hosted/Processor.cc.
Referenced by BreakpointCommand::execute().
Here is the caller graph for this function:
|
static |
Enable a specific breakpoint
| [in] | nBpNumber | the breakpoint number [0 - (getDebugBreakpointCount()
|
| [in] | nLinearAddress | the linear Adress that should trigger a breakpoint exception |
| [in] | nFaultType | the type of access that should trigger a breakpoint exception |
| [in] | nLength | the size/length of the breakpoint |
Definition at line 449 of file hosted/Processor.cc.
Referenced by BreakpointCommand::execute().
Here is the caller graph for this function:
|
staticprivate |
Release an active page-table mutation admission lease.
Definition at line 585 of file hosted/Processor.cc.
Referenced by TlbInvalidationGuard::retire().
Here is the caller graph for this function:
|
static |
Classifies the current execution boundary without relying on a per-processor IRQ marker that could survive a Thread context switch.
Definition at line 109 of file Processor.cc.
References Thread::executionContext(), getInterrupts(), and information().
Referenced by beginTlbInvalidation(), SchedulerTimer::canRemoveHandlerInCurrentContext(), ThreadedIrqDispatcher::canShutdown(), VFS::removeMountCallback(), VFS::removeProbeCallback(), PerProcessorScheduler::serviceProcessStopAtUserReturn(), and Pic::unregisterHandler().
Here is the caller graph for this function:
|
static |
Flush a line in the data cache.
| [in] | nAddr | The address of a memory location to flush from the Dcache. |
Definition at line 704 of file hosted/Processor.cc.
|
static |
Flush from the data cache and invalidate into the instruction cache. This must be used whenever code is written to memory and needs to be executed.
| startAddr | The first address to be flushed and invalidated. |
| endAddr | The last address to be flushed and invalidated. |
Definition at line 712 of file hosted/Processor.cc.
Referenced by Elf::load().
Here is the caller graph for this function:
|
static |
Get the base-pointer of the calling function
Definition at line 169 of file hosted/Processor.cc.
Referenced by Backtrace::performBpBacktrace().
Here is the caller graph for this function:
|
static |
Get the number of CPUs currently available
Definition at line 633 of file hosted/Processor.cc.
Referenced by Spinlock::acquireContended(), CpuInfoCommand::execute(), informationAt(), Scheduler::initialise(), and PerProcessorScheduler::initialise().
Here is the caller graph for this function:
|
static |
Get information for a specific breakpoint
| [in] | nBpNumber | the breakpoint number [0 - (getDebugBreakpointCount()
|
| [in,out] | nFaultType | the breakpoint type |
| [in,out] | nLength | the breakpoint size/length |
| [in,out] | bEnabled | is the breakpoint enabled? |
Definition at line 443 of file hosted/Processor.cc.
Referenced by BreakpointCommand::execute().
Here is the caller graph for this function:
|
static |
Return the (total) number of breakpoints
Definition at line 439 of file hosted/Processor.cc.
Referenced by BreakpointCommand::execute().
Here is the caller graph for this function:
|
static |
|
static |
Get the instruction-pointer of the calling function
Definition at line 161 of file hosted/Processor.cc.
Referenced by Backtrace::performBpBacktrace().
Here is the caller graph for this function:
|
static |
Get the IRQ state
Definition at line 506 of file hosted/Processor.cc.
Referenced by Spinlock::acquire(), PerProcessorScheduler::addThread(), PerProcessorScheduler::addThread(), RequestQueue::canWaitForCompletion(), PerProcessorScheduler::checkEventState(), MemoryPressureManager::compact(), VmwareGraphics::VmwareFramebuffer::copy(), IrqHandlerRegistry::dispatchThreaded(), X64VirtualAddressSpace::doAllocateStack(), AtaDisk::doRead(), Rtc::drainRemoteAlarmDispatch(), Bios::executeInterrupt(), executionContext(), PosixSubsystem::exit(), Thread::TemporarySignalMask::finish(), Rtc::getTickCountNano(), VmwareGraphics::VmwareFramebuffer::hwRedraw(), Rtc::initialiseProcessorClock(), Thread::popState(), Thread::pushState(), Process::releaseVforkAddressSpace(), Log::removeCallback(), MemoryPressureManager::removeHandler(), PosixSubsystem::resolveUserPageFault(), NMFaultHandler::restoreCurrentThreadFpuState(), Thread::retainTemporarySignalWaitInterruptionOrClear(), NMFaultHandler::saveCurrentThreadFpuState(), PerProcessorScheduler::schedule(), GraphicsService::serve(), PerProcessorScheduler::serviceDeferredSubsystemException(), PerProcessorScheduler::serviceProcessStopAtUserReturn(), VmwareGraphics::setScreenMode(), VmwareGraphics::setScreenMode(), SplitIrqHandler::shutdownSplitIrq(), HostedInterruptManager::signalShim(), Spinlock::unlock(), PageFaultHandler::unregisterHandler(), TimerHandlerRegistry::unregisterHandler(), IrqHandlerRegistry::unregisterHandler(), AtaDisk::writePageBuffer(), and Process::~Process().
Here is the caller graph for this function:
|
static |
Get the stack-pointer of the calling function
Definition at line 165 of file hosted/Processor.cc.
|
static |
Definition at line 215 of file x64/Processor.cc.
|
inlinestatic |
Enforces the device hard-IRQ execution boundary.
Returns true outside device hard-IRQ callbacks. A violation is fatal in production; hosted smoke tests may install a hook which converts the violation into a false return so the rejecting call site can be tested.
Definition at line 563 of file Processor.h.
References inDeviceHardIrq(), and LIKELY.
Referenced by Semaphore::acquireForCompletion(), SlamAllocator::allocate(), Semaphore::release(), PerProcessorScheduler::schedule(), and WaitQueue::wakeAllIfWaiting().
Here is the caller graph for this function:
|
static |
Halt this processor
Definition at line 667 of file hosted/Processor.cc.
Referenced by IoPortManager::allocate(), IoPortManager::free(), panic(), MemoryMappedIo::read16(), MemoryMappedIo::read32(), IoPort::read64(), MemoryMappedIo::read64(), MemoryMappedIo::read8(), Debugger::start(), MemoryMappedIo::write16(), MemoryMappedIo::write32(), IoPort::write64(), MemoryMappedIo::write64(), and MemoryMappedIo::write8().
Here is the caller graph for this function:
|
static |
Wait for an IRQ to fire. Possible HALT or low-power state.
Definition at line 684 of file hosted/Processor.cc.
|
static |
Get the ProcessorId of this processor
Definition at line 621 of file hosted/Processor.cc.
Referenced by PerProcessorScheduler::addThread(), PerProcessorScheduler::addThread(), PerProcessorScheduler::initialise(), X64InterruptManager::interrupt(), HostedSchedulerTimer::registerHandler(), HostedSchedulerTimer::removeHandler(), and PosixSubsystem::threadException().
Here is the caller graph for this function:
|
static |
Populate 'str' with a string describing the characteristics of this processor.
Definition at line 156 of file hosted/Processor.cc.
Referenced by CpuInfoCommand::execute().
Here is the caller graph for this function:
|
inlinestatic |
True only while an explicit device hard-IRQ callback is running.
Definition at line 559 of file Processor.h.
References information().
Referenced by PosixSubsystem::exit(), guardDeviceHardIrqOperation(), PerProcessorScheduler::serviceProcessStopAtUserReturn(), TimerFdService::timer(), and RingBuffer< T, preallocatedSize >::tryWrite().
Here is the caller graph for this function:
|
inlinestatic |
Get this processor's dense topology index for per-CPU storage. The bootstrap processor owns slot zero before discovery; each additional processor receives its permanent slot before it enters C++.
Definition at line 36 of file x64/Processor.h.
References index().
Referenced by Thread::accountTimerTick(), Spinlock::acquire(), Spinlock::acquireContended(), Scheduler::addThread(), LocksCommand::checkSchedule(), LocksCommand::checkState(), index(), Pic::initialise(), PerProcessorScheduler::initialise(), Pic::initialiseThreaded(), Pic::interrupt(), LocksCommand::lockReleased(), X86CommonProcessor::readMachineSpecificRegister(), Timer::sampleCpuTime(), Rtc::sampleCpuTime(), Pic::shutdownThreaded(), Debugger::start(), and X86CommonProcessor::writeMachineSpecificRegister().
Here is the caller graph for this function:
|
inlinestatic |
Get the ProcessorInformation structure of this processor
Definition at line 30 of file x64/Processor.h.
References information().
Referenced by PerProcessorScheduler::abandonCurrentThreadStack(), PosixSubsystem::acquire(), Spinlock::acquire(), Spinlock::acquireContended(), Semaphore::acquireForCompletion(), BusMasterIde::add(), HostedTimer::addAlarm(), Rtc::addAlarm(), RequestQueue::addRequest(), PerProcessorScheduler::addThread(), PerProcessorScheduler::addThread(), Ohci::addTransferToTransaction(), Uhci::addTransferToTransaction(), SlamAllocator::allocate(), Elf::allocate(), HostedPhysicalMemoryManager::allocateRegion(), X86CommonPhysicalMemoryManager::allocateRegion(), MemoryMapManager::allows(), Process::beginTermination(), UnixSocketSyscalls::bind(), SchedulerTimer::canRemoveHandlerInCurrentContext(), ThreadedIrqDispatcher::canShutdown(), RequestQueue::canWaitForCompletion(), PosixSubsystem::checkAddress(), PerProcessorScheduler::checkEventState(), HostedVirtualAddressSpace::clone(), MemoryMapManager::clone(), RandomFile::command(), X64PreparedPageRemap::commit(), PerProcessorScheduler::commitCurrentThreadExit(), PerProcessorScheduler::commitUserReturnTerminalState(), MemoryMapManager::compact(), MemoryPressureManager::compact(), MemoryMappedFile::compact(), Thread::completeAffinityAtSafePoint(), MemoryMapManager::contains(), Pipe::decreaseRefCount(), LinuxAmd64Signal::AsyncEvent::deliverAtUserReturn(), LinuxAmd64Signal::AsyncEvent::deliverAtUserReturn(), X64VirtualAddressSpace::detachEmptyTables(), HostedVirtualAddressSpace::detachMapping(), Thread::discardUserStackMetadataForExec(), TimerHandlerRegistry::dispatch(), IrqHandlerRegistry::dispatchThreaded(), RequestQueue::drain(), Rtc::drainRemoteAlarmDispatch(), PerProcessorScheduler::eventHandlerReturned(), Cache::evict(), MappingCommand::execute(), Bios::executeInterrupt(), executionContext(), PosixSubsystem::exit(), MemoryMapManager::faultInRange(), NetworkFilter::filter(), Elf::finaliseModule(), MemoryMapManager::findAttachment(), Cache::finishRetirement(), LockedFile::getFile(), File::getPhysicalPage(), Rtc::getTickCountNano(), inDeviceHardIrq(), information(), UserManager::initialise(), InputManager::initialise(), ThreadedIrqDispatcher::initialise(), CacheManager::initialise(), Scheduler::initialise(), X64GdtManager::initialise(), PerProcessorScheduler::initialise(), initialise1(), Rtc::initialise2(), Dm9601::initialiseDriver(), X64GdtManager::initialiseProcessor(), Rtc::initialiseProcessorClock(), DynamicLinker::initPlt(), HostedInterruptManager::interrupt(), X64InterruptManager::interrupt(), NMFaultHandler::interrupt(), PageFaultHandler::interrupt(), X64VirtualAddressSpace::invalidateMapping(), IrqHandlerRegistry::invalidateThreadedLine(), PosixSubsystem::invoke(), Ipc::IpcMessage::IpcMessage(), ThreadedIrqDispatcher::isCurrentWorker(), Thread::joinInternal(), Process::kill(), PosixSubsystem::kill(), PosixSubsystem::loadElf(), Elf::loadModule(), LockedFile::lock(), ConsoleManager::lockConsole(), User::login(), Cache::lookupStable(), InputManager::mainThread(), Cache::map(), VFS::mount(), Ne2k::Ne2k(), Backtrace::performBpBacktrace(), PosixSubsystem::prepareExecutable(), Process::prepareThreadExit(), File::publishEvent(), PosixSubsystem::queueSignalDelivery(), Process::quiesceTermination(), Process::releaseVforkAddressSpace(), Pipe::releaseVfsReference(), AnonymousMemoryMap::remove(), MemoryMappedFile::remove(), MemoryMapManager::removeAndRelease(), MemoryMapManager::removeAttachment(), Log::removeCallback(), NetworkFilter::removeCallback(), MemoryPressureManager::removeHandler(), VFS::removeMountCallback(), VFS::removeProbeCallback(), PerProcessorScheduler::requestCurrentThreadExitToIdle(), Scheduler::requestLoadAverageSample(), DynamicLinker::resolvePlt(), PosixSubsystem::resolveUserPageFault(), NMFaultHandler::restoreCurrentThreadFpuState(), DeviceHardIrqContext::restoreDepth(), Cache::retireWriteback(), X64InterruptManager::returnFromInterrupt(), pocketknife::runConcurrently(), pocketknife::runConcurrentlyAttached(), Rtc::sampleCpuTime(), Scheduler::sampleLoadAverage(), NMFaultHandler::saveCurrentThreadFpuState(), PerProcessorScheduler::schedule(), PosixSubsystem::sendSignal(), SignalEvent::serialize(), PerProcessorScheduler::serviceDeferredSubsystemException(), PerProcessorScheduler::serviceIrqWorkDoorbell(), PerProcessorScheduler::serviceProcessStopAtUserReturn(), PerProcessorScheduler::serviceUserReturnWork(), PerProcessorScheduler::serviceUserReturnWork(), setInterrupts(), Thread::setKernelStack(), AnonymousMemoryMap::setPermissions(), MemoryMappedFile::setPermissions(), VirtualTerminalManager::setTerminalMode(), Process::setTimeAccountingReportInterest(), Thread::setTlsBase(), ThreadedIrqDispatcher::shutdown(), SplitIrqHandler::shutdownSplitIrq(), HostedInterruptManager::signalShim(), Debugger::start(), Process::suspendInternal(), switchAddressSpace(), sys_thread_is_current(), HostedSyscallManager::syscall(), X64SyscallManager::syscall(), Thread::Thread(), Thread::Thread(), Thread::threadExited(), PerProcessorScheduler::timer(), DLTrapHandler::trap(), MemoryMappedFile::trap(), ConsoleManager::unlockConsole(), MemoryMapManager::unmap(), MemoryMapManager::unmapAllUnlocked(), PageFaultHandler::unregisterHandler(), TimerHandlerRegistry::unregisterHandler(), IrqHandlerRegistry::unregisterHandler(), ConditionVariable::wait(), Event::waitForDeliveries(), Process::waitUntilTerminationReapable(), Process::waitUntilTerminationReapableForTerminalCoordinator(), RequestQueue::work(), Cache::PreparedDiscard::writeback(), Cache::writebackPage(), Scheduler::yield(), NetworkFilter::~NetworkFilter(), PosixSubsystem::~PosixSubsystem(), and Process::~Process().
|
static |
Resolves a discovered logical slot, including before BSP identity is live.
Definition at line 39 of file Processor.cc.
References Vector< T >::count(), getCount(), m_ProcessorInformation, and m_SafeBspProcessorInformation.
Referenced by PerProcessorScheduler::initialise().
Here is the caller graph for this function:
|
static |
End of the kernel core initialisation reached, the initialisation functions and data may now get unmapped/freed.
Definition at line 117 of file hosted/Processor.cc.
References HostedPhysicalMemoryManager::initialisationDone(), and HostedPhysicalMemoryManager::instance().
|
static |
first stage in the initialisation of the processor-specific interface
Initialises the processor specific interface. After this function call the whole processor-specific interface is initialised. Note though, that only the bootstrap processor is started. Multiprocessor/-core facilities are available after initialiseProcessor2().
| [in] | Info | reference to the multiboot information structure |
todo move to a better place
Definition at line 121 of file hosted/Processor.cc.
References Dec, TargetInfo::getPageSize(), Hex, information(), PageFaultHandler::initialise(), HostedPhysicalMemoryManager::initialise(), HostedInterruptManager::initialiseProcessor(), HostedSyscallManager::initialiseProcessor(), PageFaultHandler::instance(), HostedPhysicalMemoryManager::instance(), m_Initialised, panic(), and setInterrupts().
|
static |
second/last stage in the initialisation of the processor-specific interface
Initialises the Multiprocessor/-core functionality of the processor-specific interface. This function may only be called after initialiseProcessor1 and after the whole machine specific interface has been initialised.
Definition at line 149 of file hosted/Processor.cc.
References m_Initialised.
|
static |
Invalidate the TLB entry containing a specific virtual address
| [in] | pAddress | the specific virtual address |
Definition at line 569 of file hosted/Processor.cc.
Referenced by invalidateAll().
Here is the caller graph for this function:
|
static |
Invalidate one virtual address on every online processor and do not return until each processor has acknowledged the request.
The caller must keep the online-processor set, page-table mutation, and its page-table storage stable until this returns Success. The implementation is allocation-free and uses bounded polling, so it is valid in ordinary thread and atomic thread context. Explicit device, scheduler, synthetic-IRQ, and debugger contexts are rejected: none may wait for another processor's progress. On any failure, the caller must not reclaim or reuse the old mapping's backing storage. Convenience invalidation for callers which have not changed a PTE. Page-table writers must acquire a guard before their mutation and use the overload below, so processor retirement cannot overtake publication.
Definition at line 604 of file hosted/Processor.cc.
References beginTlbInvalidation(), and invalidateAll().
Referenced by invalidateAll().
Here is the caller graph for this function:
|
static |
Invalidate under an admission lease acquired before the PTE mutation.
Definition at line 613 of file hosted/Processor.cc.
References invalidate().
|
static |
Invalidate a line in the data cache.
| [in] | nAddr | The address of a memory location to invalidate from the Dcache. |
Definition at line 696 of file hosted/Processor.cc.
|
static |
Invalidate a line in the instruction cache.
| [in] | nAddr | The address of a memory location to invalidate from the Icache. |
Definition at line 688 of file hosted/Processor.cc.
|
static |
Is the processor-specific interface initialised?
Definition at line 105 of file Processor.cc.
References m_Initialised.
Referenced by IoPortManager::allocate(), and IoPortManager::free().
Here is the caller graph for this function:
|
static |
Jumps to an address, in kernel mode, and sets up a calling frame with the given parameters.
| pLock | Optional lock to release. |
| address | Address to jump to. |
| stack | Stack to use (set to 0 for current stack). |
| param1 | First parameter. |
| param2 | Second parameter. |
| param3 | Third parameter. |
| param4 | Fourth parameter. |
Referenced by PerProcessorScheduler::addThread().
Here is the caller graph for this function:
|
static |
Jumps to an address, in user mode, and sets up a calling frame with the given parameters.
| pLock | Optional lock to release. |
| address | Address to jump to. |
| stack | Stack to use (set to 0 for current stack). |
| param1 | First parameter. |
| param2 | Second parameter. |
| param3 | Third parameter. |
| param4 | Fourth parameter. |
Referenced by PerProcessorScheduler::addThread(), PerProcessorScheduler::checkEventState(), and HostedSyscallManager::syscall().
Here is the caller graph for this function:
|
static |
Pause CPU during a tight polling loop.
Definition at line 672 of file hosted/Processor.cc.
Referenced by Spinlock::acquireContended(), X86CommonPhysicalMemoryManager::PageStack::allocate(), LocksCommand::checkState(), AtaDisk::doRead(), Rtc::drainRemoteAlarmDispatch(), Rtc::initialise2(), panic(), PciAtaController::PciAtaController(), DebuggerIO::readCli(), Ne2k::send(), Debugger::start(), TimerHandlerRegistry::unregisterHandler(), Rtc::waitForUpdateCompletion(), and AtaDisk::writePageBuffer().
Here is the caller graph for this function:
|
static |
Reset this processor
Definition at line 680 of file hosted/Processor.cc.
Referenced by Machine::finalShutdown(), Pc::finalShutdown(), and HostedInterruptManager::interrupt().
Here is the caller graph for this function:
|
static |
Restore a previous scheduler state.
| [in] | state | The state to restore. |
| [out] | pLock | Optional lock to release. |
Definition at line 178 of file hosted/Processor.cc.
Referenced by PerProcessorScheduler::addThread(), PerProcessorScheduler::eventHandlerReturned(), and X64SyscallManager::syscall().
Here is the caller graph for this function:
|
static |
Restore a previous syscall state.
| [out] | pLock | Optional lock to release (for none, set as 0) |
| [in] | state | Syscall state to restore. |
|
static |
Jumps to an address, in kernel mode, and sets up a calling frame with the given parameters. Saves the current state before doing so.
| bInterrupts | Interrupt state to restore in saved context. |
| pLock | Optional lock to release. |
| address | Address to jump to. |
| stack | Stack to use (set to 0 for current stack). |
| param1 | First parameter. |
| param2 | Second parameter. |
| param3 | Third parameter. |
| param4 | Fourth parameter. |
Referenced by PerProcessorScheduler::addThread().
Here is the caller graph for this function:
|
static |
Jumps to an address, in user mode, and sets up a calling frame with the given parameters. Saves the current state before doing so.
| bInterrupts | Interrupt state to restore in saved context. |
| pLock | Optional lock to release. |
| address | Address to jump to. |
| stack | Stack to use (set to 0 for current stack). |
| param1 | First parameter. |
| param2 | Second parameter. |
| param3 | Third parameter. |
| param4 | Fourth parameter. |
Referenced by PerProcessorScheduler::addThread(), and PerProcessorScheduler::checkEventState().
Here is the caller graph for this function:
|
static |
Save the current processor state.
| [out] | state | SchedulerState to save into. |
Definition at line 173 of file hosted/Processor.cc.
Referenced by PerProcessorScheduler::addThread(), PerProcessorScheduler::addThread(), and PerProcessorScheduler::checkEventState().
Here is the caller graph for this function:
|
static |
Enable/Disable IRQs
| [in] | bEnable | true to enable IRSs, false otherwise |
Definition at line 458 of file hosted/Processor.cc.
References information().
Referenced by Spinlock::acquire(), PerProcessorScheduler::addThread(), PerProcessorScheduler::addThread(), PerProcessorScheduler::checkEventState(), Thread::completeAffinityAtSafePoint(), IrqHandlerRegistry::dispatchThreaded(), AtaDisk::doRead(), PerProcessorScheduler::eventHandlerReturned(), Bios::executeInterrupt(), Thread::TemporarySignalMask::finish(), Rtc::getTickCountNano(), initialise1(), Rtc::initialiseProcessorClock(), PosixSubsystem::invoke(), PosixSubsystem::kill(), panic(), Thread::popState(), Thread::pushState(), Spinlock::release(), Process::releaseVforkAddressSpace(), NMFaultHandler::restoreCurrentThreadFpuState(), Thread::retainTemporarySignalWaitInterruptionOrClear(), X64InterruptManager::returnFromInterrupt(), NMFaultHandler::saveCurrentThreadFpuState(), PerProcessorScheduler::schedule(), HostedInterruptManager::signalShim(), NativeSyscallManager::syscall(), PedigreeCSyscallManager::syscall(), HostedSyscallManager::syscall(), X64SyscallManager::syscall(), AtaDisk::writePageBuffer(), and Process::~Process().
Here is the caller graph for this function:
|
static |
Enable/Disable single-stepping
| [in] | bEnable | true to enable single-stepping, false otherwise |
| [in] | state | the interrupt-state |
Definition at line 565 of file hosted/Processor.cc.
Referenced by StepCommand::execute(), TraceCommand::execute(), and Debugger::interrupt().
Here is the caller graph for this function:
|
static |
Set a new TLS area base address.
Definition at line 433 of file hosted/Processor.cc.
Referenced by PerProcessorScheduler::addThread(), PerProcessorScheduler::addThread(), PerProcessorScheduler::initialise(), Thread::resetTlsBase(), and Thread::setTlsBase().
Here is the caller graph for this function:
|
static |
Definition at line 221 of file x64/Processor.cc.
|
static |
Switch to a different virtual address space
| [in] | AddressSpace | the new address space |
Definition at line 425 of file hosted/Processor.cc.
References information(), and HostedVirtualAddressSpace::switchAddressSpace().
Referenced by PerProcessorScheduler::addThread(), PerProcessorScheduler::addThread(), MemoryMapManager::compact(), MappingCommand::execute(), Bios::executeInterrupt(), Process::releaseVforkAddressSpace(), pocketknife::VirtualAddressSpaceSwitch::restore(), PosixSubsystem::~PosixSubsystem(), and Process::~Process().
Here is the caller graph for this function:
|
static |
Switch between two states, safely.
Referenced by PerProcessorScheduler::addThread().
Here is the caller graph for this function:
|
static |
Switch between two states, safely.
|
static |
True after a failed invalidation has permanently closed admission.
Definition at line 596 of file hosted/Processor.cc.
|
static |
True while page-table mutation admission is permanently closed.
Definition at line 600 of file hosted/Processor.cc.
Referenced by panic().
Here is the caller graph for this function:
|
friend |
Definition at line 129 of file Processor.h.
|
friend |
Definition at line 133 of file Processor.h.
|
friend |
Definition at line 130 of file Processor.h.
|
friend |
Definition at line 132 of file Processor.h.
|
friend |
Definition at line 131 of file Processor.h.
|
staticprivate |
Definition at line 42 of file Processor.h.
|
static |
How far has the processor-specific interface been initialised
Definition at line 475 of file Processor.h.
Referenced by _assert(), SlamAllocator::allocate(), HostedPhysicalMemoryManager::allocatePage(), X86CommonPhysicalMemoryManager::allocatePage(), initialise1(), initialise2(), isInitialised(), X64VirtualAddressSpace::mapPageStructures(), X64VirtualAddressSpace::mapUnlocked(), and pocketknife::VirtualAddressSpaceSwitch::restore().
|
staticprivate |
Definition at line 510 of file Processor.h.
|
staticprivate |
If we have only one processor, we define the ProcessorInformation class here otherwise we use an array of ProcessorInformation structures
Definition at line 504 of file Processor.h.
Referenced by informationAt(), Scheduler::initialise(), and X64GdtManager::initialise().
|
staticprivate |
Used before multiprocessor stuff is turned on as a "safe" info structure. For stuff like early heap setup and all that.
Definition at line 508 of file Processor.h.
Referenced by informationAt().