Max OS 0.3
Loading...
Searching...
No Matches
MaxOS::hardwarecommunication::CPUStopHandler Class Reference

Handles a interrupt that tells a CPU core to stop running. More...

#include <interrupts.h>

Inheritance diagram for MaxOS::hardwarecommunication::CPUStopHandler:
MaxOS::hardwarecommunication::InterruptHandler

Public Member Functions

 CPUStopHandler ()
 Create a new CPUStopHandler.
 
system::cpu_status_t * handle_interrupt (system::cpu_status_t *status) final
 Handle the interrupt relating to this exception.
 
- Public Member Functions inherited from MaxOS::hardwarecommunication::InterruptHandler
virtual void handle_interrupt ()
 Handles an interrupt.
 

Additional Inherited Members

- Protected Member Functions inherited from MaxOS::hardwarecommunication::InterruptHandler
 InterruptHandler (uint8_t interrupt_number, int64_t redirect=-1, uint64_t redirect_index=0)
 Creates a new interrupt handler and registers it with the interrupt manager.
 
virtual ~InterruptHandler ()
 Destroys the interrupt handler and unregisters it from the interrupt manager.
 
- Protected Attributes inherited from MaxOS::hardwarecommunication::InterruptHandler
uint8_t m_interrupt_number
 The interrupt number this handler handles.
 

Detailed Description

Handles a interrupt that tells a CPU core to stop running.

Definition at line 128 of file interrupts.h.

Constructor & Destructor Documentation

◆ CPUStopHandler()

MaxOS::hardwarecommunication::CPUStopHandler::CPUStopHandler ( )
inline

Create a new CPUStopHandler.

Definition at line 132 of file interrupts.h.

132: InterruptHandler(0x81) { }
InterruptHandler(uint8_t interrupt_number, int64_t redirect=-1, uint64_t redirect_index=0)
Creates a new interrupt handler and registers it with the interrupt manager.

Member Function Documentation

◆ handle_interrupt()

cpu_status_t * CPUStopHandler::handle_interrupt ( system::cpu_status_t *  status)
finalvirtual

Handle the interrupt relating to this exception.

Parameters
statusThe CPU state at time of exception
Returns
The new CPU state to move to or null if no recoverable state

Reimplemented from MaxOS::hardwarecommunication::InterruptHandler.

Definition at line 194 of file interrupts.cpp.

194 {
195
196 CPU::halt();
197
198 // Shouldn't return, fault if this happens
199 return nullptr;
200}
static void halt()
Halts the CPU indefinitely.
Definition cpu.cpp:275

References MaxOS::system::CPU::halt().


The documentation for this class was generated from the following files: