lf_csr can be altered from an other thread
This commit is contained in:
parent
6729d182a8
commit
ce1114a159
2 changed files with 11 additions and 1 deletions
8
bus.cpp
8
bus.cpp
|
@ -211,6 +211,8 @@ uint16_t bus::read(const uint16_t addr_in, const word_mode_t word_mode, const rm
|
||||||
}
|
}
|
||||||
|
|
||||||
if (a == ADDR_LFC) { // line frequency clock and status register
|
if (a == ADDR_LFC) { // line frequency clock and status register
|
||||||
|
std::unique_lock<std::mutex> lck(lf_csr_lock);
|
||||||
|
|
||||||
uint16_t temp = lf_csr;
|
uint16_t temp = lf_csr;
|
||||||
if (!peek_only) DOLOG(debug, false, "READ-I/O line frequency clock: %o", temp);
|
if (!peek_only) DOLOG(debug, false, "READ-I/O line frequency clock: %o", temp);
|
||||||
return temp;
|
return temp;
|
||||||
|
@ -855,6 +857,8 @@ void bus::write(const uint16_t addr_in, const word_mode_t word_mode, uint16_t va
|
||||||
}
|
}
|
||||||
|
|
||||||
if (a == ADDR_LFC) { // line frequency clock and status register
|
if (a == ADDR_LFC) { // line frequency clock and status register
|
||||||
|
std::unique_lock<std::mutex> lck(lf_csr_lock);
|
||||||
|
|
||||||
DOLOG(debug, true, "WRITE-I/O set line frequency clock/status register: %06o", value);
|
DOLOG(debug, true, "WRITE-I/O set line frequency clock/status register: %06o", value);
|
||||||
lf_csr = value;
|
lf_csr = value;
|
||||||
return;
|
return;
|
||||||
|
@ -1025,10 +1029,14 @@ void bus::writeUnibusByte(const uint16_t a, const uint8_t v)
|
||||||
|
|
||||||
void bus::set_lf_crs_b7()
|
void bus::set_lf_crs_b7()
|
||||||
{
|
{
|
||||||
|
std::unique_lock<std::mutex> lck(lf_csr_lock);
|
||||||
|
|
||||||
lf_csr |= 128;
|
lf_csr |= 128;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t bus::get_lf_crs()
|
uint8_t bus::get_lf_crs()
|
||||||
{
|
{
|
||||||
|
std::unique_lock<std::mutex> lck(lf_csr_lock);
|
||||||
|
|
||||||
return lf_csr;
|
return lf_csr;
|
||||||
}
|
}
|
||||||
|
|
2
bus.h
2
bus.h
|
@ -5,6 +5,7 @@
|
||||||
// #define SYSTEM_11_44
|
// #define SYSTEM_11_44
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
#include <mutex>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
@ -91,6 +92,7 @@ private:
|
||||||
|
|
||||||
uint16_t MMR0 { 0 }, MMR1 { 0 }, MMR2 { 0 }, MMR3 { 0 }, CPUERR { 0 }, PIR { 0 }, CSR { 0 };
|
uint16_t MMR0 { 0 }, MMR1 { 0 }, MMR2 { 0 }, MMR3 { 0 }, CPUERR { 0 }, PIR { 0 }, CSR { 0 };
|
||||||
|
|
||||||
|
std::mutex lf_csr_lock;
|
||||||
uint16_t lf_csr { 0 };
|
uint16_t lf_csr { 0 };
|
||||||
|
|
||||||
uint16_t microprogram_break_register { 0 };
|
uint16_t microprogram_break_register { 0 };
|
||||||
|
|
Loading…
Add table
Reference in a new issue