mirror of
https://github.com/livingcomputermuseum/UniBone.git
synced 2026-04-05 05:13:06 +00:00
Reworked inputline()
This commit is contained in:
@@ -33,11 +33,12 @@
|
||||
#include <assert.h>
|
||||
|
||||
#include "logger.hpp"
|
||||
#include "inputline.h"
|
||||
#include "mailbox.h"
|
||||
#include "iopageregister.h"
|
||||
#include "ddrmem.h"
|
||||
|
||||
#include "application.hpp"
|
||||
|
||||
/* another singleton */
|
||||
ddrmem_c *ddrmem;
|
||||
|
||||
@@ -179,7 +180,7 @@ void ddrmem_c::unibus_slave(uint32_t startaddr, uint32_t endaddr) {
|
||||
mailbox->arm2pru_req = ARM2PRU_DDR_SLAVE_MEMORY;
|
||||
printf("Hit 'q' ENTER to end.\n");
|
||||
do { // only this code wait for input under Eclipse
|
||||
s = inputline(buf, sizeof(buf), NULL);
|
||||
s = app->inputline.readline(buf, sizeof(buf), NULL);
|
||||
} while (strlen(s) == 0);
|
||||
// clearing arm2pru_req stops the emulation
|
||||
mailbox_execute(ARM2PRU_NONE);
|
||||
|
||||
@@ -202,6 +202,13 @@ void gpios_c::init() {
|
||||
for (n = 0; n < 4; n++)
|
||||
GPIO_SETVAL(led[n], 1)
|
||||
; // inverted drivers
|
||||
|
||||
// shared with LEDs
|
||||
ARM_DEBUG_PIN0(0) ;
|
||||
ARM_DEBUG_PIN1(0) ;
|
||||
ARM_DEBUG_PIN2(0) ;
|
||||
ARM_DEBUG_PIN3(0) ;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -28,6 +28,9 @@
|
||||
#define _GPIOS_H_
|
||||
|
||||
#include <stdint.h>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
#include "logsource.hpp"
|
||||
|
||||
// device for a set of 32 gpio pins
|
||||
@@ -203,18 +206,18 @@ public:
|
||||
};
|
||||
|
||||
id_enum id;
|
||||
string name;
|
||||
std::string name;
|
||||
unsigned bitwidth;
|
||||
unibus_signal_info_c() {
|
||||
}
|
||||
;
|
||||
unibus_signal_info_c(id_enum id, string name, unsigned bitwidth);
|
||||
unibus_signal_info_c(id_enum id, std::string name, unsigned bitwidth);
|
||||
};
|
||||
|
||||
class unibus_signals_c {
|
||||
public:
|
||||
unibus_signals_c();
|
||||
vector<unibus_signal_info_c> signals;
|
||||
std::vector<unibus_signal_info_c> signals;
|
||||
unsigned max_name_len();
|
||||
unsigned size();
|
||||
|
||||
|
||||
@@ -618,7 +618,8 @@ void unibusadapter_c::INTR(intr_request_c& intr_request,
|
||||
priority_request_level_c *prl = &request_levels[intr_request.level_index];
|
||||
pthread_mutex_lock(&requests_mutex); // lock schedule table operations
|
||||
|
||||
_DEBUG("INTR() req: dev %s, slot/level/vector= %d/%d/%03o",
|
||||
//if (intr_request.device->log_level == LL_DEBUG)
|
||||
DEBUG("INTR() req: dev %s, slot/level/vector= %d/%d/%03o",
|
||||
intr_request.device->name.value.c_str(), (unsigned) intr_request.slot,
|
||||
intr_request.level_index + 4, intr_request.vector);
|
||||
// Is an INTR with same slot and level already executed on PRU
|
||||
@@ -643,12 +644,12 @@ void unibusadapter_c::INTR(intr_request_c& intr_request,
|
||||
// scheduled and request_active_complete() not called
|
||||
pthread_mutex_unlock(&requests_mutex);
|
||||
if (interrupt_register) {
|
||||
_DEBUG("INTR() delayed with IR");
|
||||
DEBUG("INTR() delayed with IR");
|
||||
// if device re-raises a blocked INTR, CSR must complete immediately
|
||||
intr_request.device->set_register_dati_value(interrupt_register,
|
||||
interrupt_register_value, __func__);
|
||||
} else {
|
||||
_DEBUG("INTR() delayed without IR");
|
||||
DEBUG("INTR() delayed without IR");
|
||||
}
|
||||
|
||||
return; // do not schedule a 2nd time
|
||||
@@ -663,14 +664,14 @@ void unibusadapter_c::INTR(intr_request_c& intr_request,
|
||||
// The associated device interrupt register (if any) should be updated
|
||||
// atomically with raising the INTR signal line by PRU.
|
||||
if (interrupt_register && request_is_blocking_active(intr_request.level_index)) {
|
||||
_DEBUG("INTR() delayed, IR now");
|
||||
DEBUG("INTR() delayed, IR now");
|
||||
// one or more another requests are handled by PRU: INTR signal delayed by Arbitrator,
|
||||
// write intr register asynchronically here.
|
||||
intr_request.device->set_register_dati_value(interrupt_register,
|
||||
interrupt_register_value, __func__);
|
||||
intr_request.interrupt_register = NULL; // don't do a 2nd time
|
||||
} else { // forward to PRU
|
||||
_DEBUG("INTR() IR forward to PRU");
|
||||
DEBUG("INTR() IR forward to PRU");
|
||||
// intr_request.level_index, priority_slot, vector in constructor
|
||||
intr_request.interrupt_register = interrupt_register;
|
||||
intr_request.interrupt_register_value = interrupt_register_value;
|
||||
|
||||
Reference in New Issue
Block a user