comment out semaphore shit in teakra
This commit is contained in:
parent
9e449d902d
commit
936011964c
|
@ -14,7 +14,7 @@ public:
|
||||||
|
|
||||||
void Send(u16 data) {
|
void Send(u16 data) {
|
||||||
{
|
{
|
||||||
std::lock_guard lock(mutex);
|
//std::lock_guard lock(mutex);
|
||||||
ready = true;
|
ready = true;
|
||||||
this->data = data;
|
this->data = data;
|
||||||
if (disable_interrupt)
|
if (disable_interrupt)
|
||||||
|
@ -24,20 +24,20 @@ public:
|
||||||
handler();
|
handler();
|
||||||
}
|
}
|
||||||
u16 Recv() {
|
u16 Recv() {
|
||||||
std::lock_guard lock(mutex);
|
//std::lock_guard lock(mutex);
|
||||||
ready = false;
|
ready = false;
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
u16 Peek() const {
|
u16 Peek() const {
|
||||||
std::lock_guard lock(mutex);
|
//std::lock_guard lock(mutex);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
bool IsReady() const {
|
bool IsReady() const {
|
||||||
std::lock_guard lock(mutex);
|
//std::lock_guard lock(mutex);
|
||||||
return ready;
|
return ready;
|
||||||
}
|
}
|
||||||
u16 GetDisableInterrupt() const {
|
u16 GetDisableInterrupt() const {
|
||||||
std::lock_guard lock(mutex);
|
//std::lock_guard lock(mutex);
|
||||||
return disable_interrupt;
|
return disable_interrupt;
|
||||||
}
|
}
|
||||||
void SetDisableInterrupt(u16 v) {
|
void SetDisableInterrupt(u16 v) {
|
||||||
|
@ -107,7 +107,7 @@ void Apbp::SetDataHandler(unsigned channel, std::function<void()> handler) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Apbp::SetSemaphore(u16 bits) {
|
void Apbp::SetSemaphore(u16 bits) {
|
||||||
std::lock_guard lock(impl->semaphore_mutex);
|
//std::lock_guard lock(impl->semaphore_mutex);
|
||||||
impl->semaphore |= bits;
|
impl->semaphore |= bits;
|
||||||
bool new_signal = (impl->semaphore & ~impl->semaphore_mask) != 0;
|
bool new_signal = (impl->semaphore & ~impl->semaphore_mask) != 0;
|
||||||
if (new_signal && impl->semaphore_handler) {
|
if (new_signal && impl->semaphore_handler) {
|
||||||
|
@ -117,33 +117,33 @@ void Apbp::SetSemaphore(u16 bits) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Apbp::ClearSemaphore(u16 bits) {
|
void Apbp::ClearSemaphore(u16 bits) {
|
||||||
std::lock_guard lock(impl->semaphore_mutex);
|
//std::lock_guard lock(impl->semaphore_mutex);
|
||||||
impl->semaphore &= ~bits;
|
impl->semaphore &= ~bits;
|
||||||
impl->semaphore_master_signal = (impl->semaphore & ~impl->semaphore_mask) != 0;
|
impl->semaphore_master_signal = (impl->semaphore & ~impl->semaphore_mask) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
u16 Apbp::GetSemaphore() const {
|
u16 Apbp::GetSemaphore() const {
|
||||||
std::lock_guard lock(impl->semaphore_mutex);
|
//std::lock_guard lock(impl->semaphore_mutex);
|
||||||
return impl->semaphore;
|
return impl->semaphore;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Apbp::MaskSemaphore(u16 bits) {
|
void Apbp::MaskSemaphore(u16 bits) {
|
||||||
std::lock_guard lock(impl->semaphore_mutex);
|
//std::lock_guard lock(impl->semaphore_mutex);
|
||||||
impl->semaphore_mask = bits;
|
impl->semaphore_mask = bits;
|
||||||
}
|
}
|
||||||
|
|
||||||
u16 Apbp::GetSemaphoreMask() const {
|
u16 Apbp::GetSemaphoreMask() const {
|
||||||
std::lock_guard lock(impl->semaphore_mutex);
|
//std::lock_guard lock(impl->semaphore_mutex);
|
||||||
return impl->semaphore_mask;
|
return impl->semaphore_mask;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Apbp::SetSemaphoreHandler(std::function<void()> handler) {
|
void Apbp::SetSemaphoreHandler(std::function<void()> handler) {
|
||||||
std::lock_guard lock(impl->semaphore_mutex);
|
//std::lock_guard lock(impl->semaphore_mutex);
|
||||||
impl->semaphore_handler = std::move(handler);
|
impl->semaphore_handler = std::move(handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Apbp::IsSemaphoreSignaled() const {
|
bool Apbp::IsSemaphoreSignaled() const {
|
||||||
std::lock_guard lock(impl->semaphore_mutex);
|
//std::lock_guard lock(impl->semaphore_mutex);
|
||||||
return impl->semaphore_master_signal;
|
return impl->semaphore_master_signal;
|
||||||
}
|
}
|
||||||
} // namespace Teakra
|
} // namespace Teakra
|
||||||
|
|
Loading…
Reference in New Issue