1

add vorgabe04

This commit is contained in:
churl
2022-05-14 16:54:22 +02:00
parent d1f68b234d
commit d804fff473
15 changed files with 378 additions and 51 deletions

View File

@ -4,6 +4,8 @@
* *
*---------------------------------------------------------------------------*
* Beschreibung: Implementierung einer Abstraktion fuer den Prozessor. *
* Derzeit wird nur angeboten, Interrupts zuzulassen, zu *
* verbieten oder den Prozessor anzuhalten. *
* *
* Autor: Michael Schoettner, 30.7.16 *
*****************************************************************************/
@ -18,6 +20,23 @@ private:
public:
CPU() {}
// Erlauben von (Hardware-)Interrupts
inline void enable_int () {
asm volatile ( "sti" );
}
// Interrupts werden ignoriert/verboten
inline void disable_int () {
asm volatile ( "cli" );
}
// Prozessor bis zum naechsten Interrupt anhalten
inline void idle () {
asm volatile ( "sti;"
"hlt"
);
}
// Prozessor anhalten
inline void halt () {
@ -25,6 +44,7 @@ public:
"hlt"
);
}
// Time-Stamp-Counter auslesen
inline unsigned long long int rdtsc() {
unsigned long long int ret;