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

Handles an attempt to divide by 0. More...

#include <interrupts.h>

Inheritance diagram for MaxOS::hardwarecommunication::DivideByZeroHandler:
MaxOS::hardwarecommunication::ExceptionHandler MaxOS::hardwarecommunication::InterruptHandler

Public Member Functions

 DivideByZeroHandler ()
 Create a new DivideByZeroHandler.
 
string get_message (system::cpu_status_t *status) final
 Get an human readable error message explaining this exception.
 
- Public Member Functions inherited from MaxOS::hardwarecommunication::ExceptionHandler
 ExceptionHandler (uint8_t interrupt_number)
 Create a new base exception handler for an interrupt.
 
 ~ExceptionHandler ()
 
virtual system::cpu_status_t * handle_interrupt (system::cpu_status_t *status)
 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 an attempt to divide by 0.

Definition at line 76 of file interrupts.h.

Constructor & Destructor Documentation

◆ DivideByZeroHandler()

MaxOS::hardwarecommunication::DivideByZeroHandler::DivideByZeroHandler ( )
inline

Create a new DivideByZeroHandler.

Definition at line 80 of file interrupts.h.

80: ExceptionHandler(0x00) { }
ExceptionHandler(uint8_t interrupt_number)
Create a new base exception handler for an interrupt.

Member Function Documentation

◆ get_message()

string DivideByZeroHandler::get_message ( system::cpu_status_t *  status)
finalvirtual

Get an human readable error message explaining this exception.

Parameters
statusThe CPU state at time of exception
Returns
The error message

Reimplemented from MaxOS::hardwarecommunication::ExceptionHandler.

Definition at line 141 of file interrupts.cpp.

141 {
142
143 return StringBuilder() << "Division by 0 executed at 0x" << status->rip << "\n";
144
145}

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