1

reformat + static const ioports

This commit is contained in:
2022-07-24 16:54:51 +02:00
parent e1eac41853
commit 0d109727ac
11 changed files with 84 additions and 67 deletions

View File

@ -17,14 +17,13 @@
#define __IOport_include__
class IOport {
// Kopieren erlaubt!
private:
// 16-Bit Adresse im I/O-Adressraum
unsigned short address;
const unsigned short address;
public:
// Konstruktor, speichert Port-Adresse
IOport(unsigned short a) : address(a) {};
explicit IOport(unsigned short a) : address(a) {};
// Byteweise Ausgabe eines Wertes ueber einen I/O-Port.
void outb(unsigned char val) const {

View File

@ -18,8 +18,8 @@
#include "kernel/interrupts/PIC.h"
#include "kernel/IOport.h"
static IOport IMR1(0x21); // interrupt mask register von PIC 1
static IOport IMR2(0xa1); // interrupt mask register von PIC 2
IOport const PIC::IMR1(0x21); // interrupt mask register von PIC 1
IOport const PIC::IMR2(0xa1); // interrupt mask register von PIC 2
/*****************************************************************************
* Methode: PIC::allow *

View File

@ -17,13 +17,17 @@
#ifndef __PIC_include__
#define __PIC_include__
class PIC {
#include "kernel/IOport.h"
class PIC {
private:
PIC(const PIC& copy) = delete; // Verhindere Kopieren
static const IOport IMR1; // interrupt mask register von PIC 1
static const IOport IMR2; // interrupt mask register von PIC 2
public:
PIC() {}
PIC(const PIC& copy) = delete; // Verhindere Kopieren
PIC() = default;
// IRQ-Nummern von Geraeten
enum {
@ -33,13 +37,13 @@ public:
};
// Freischalten der Weiterleitung eines IRQs durch den PIC an die CPU
void allow(int irq);
static void allow(int irq);
// Unterdruecken der Weiterleitung eines IRQs durch den PIC an die CPU
void forbid(int irq);
static void forbid(int irq);
// Abfragen, ob die Weiterleitung fuer einen bestimmten IRQ unterdrueckt ist
bool status(int interrupt_device);
static bool status(int interrupt_device);
};
#endif