add vorgabe04
This commit is contained in:
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user