zack fertig
This commit is contained in:
@@ -74,14 +74,12 @@ extern Ticketlock koutlock;
|
|||||||
void handle_keyboard() {
|
void handle_keyboard() {
|
||||||
Key key = Key();
|
Key key = Key();
|
||||||
if (PS2Controller::fetch(key)) {
|
if (PS2Controller::fetch(key)) {
|
||||||
|
|
||||||
if (key.ctrl() && key.alt() && key.scancode == Key::KEY_DEL)
|
|
||||||
System::reboot();
|
|
||||||
|
|
||||||
koutlock.lock();
|
koutlock.lock();
|
||||||
kout << key.ascii() << flush ;
|
kout << key.ascii() << endl << flush ;
|
||||||
koutlock.unlock();
|
koutlock.unlock();
|
||||||
}
|
}
|
||||||
|
else if (key.ctrl() && key.alt() && key.scancode == Key::KEY_DEL)
|
||||||
|
System::reboot();
|
||||||
|
|
||||||
LAPIC::endOfInterrupt();
|
LAPIC::endOfInterrupt();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
#include "sync/ticketlock.h"
|
#include "sync/ticketlock.h"
|
||||||
|
|
||||||
void Ticketlock::lock() {
|
void Ticketlock::lock() {
|
||||||
uint64_t ticket = __atomic_fetch_add(&ticket_count, 1, __ATOMIC_SEQ_CST);
|
uint64_t ticket = __atomic_fetch_add(&ticket_count, 1, __ATOMIC_RELAXED);
|
||||||
while (ticket != ticket_current) {
|
while (ticket != __atomic_fetch_add(&ticket_current, 0, __ATOMIC_ACQUIRE))) {
|
||||||
Core::pause();
|
Core::pause();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Ticketlock::unlock() {
|
void Ticketlock::unlock() {
|
||||||
__atomic_fetch_add(&ticket_current, 1, __ATOMIC_SEQ_CST);
|
__atomic_fetch_add(&ticket_current, 1, __ATOMIC_RELEASE);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user