#include <Serial.h>


The serial port is translated to a telnet port.
Definition at line 104 of file Serial.h.
Public Member Functions | |
| void | write (const char *s) |
| virtual void | WriteMem (int index, u64 address, int dsize, u64 data) |
| virtual u64 | ReadMem (int index, u64 address, int dsize) |
| CSerial (CConfigurator *cfg, CSystem *c, u16 number) | |
| Constructor. | |
| virtual | ~CSerial () |
| Destructor. | |
| void | receive (const char *data) |
| virtual void | check_state () |
| Check if threads are still running. | |
| virtual int | SaveState (FILE *f) |
| Save state to a Virtual Machine State file. | |
| virtual int | RestoreState (FILE *f) |
| Restore state from a Virtual Machine State file. | |
| void | eval_interrupts () |
| void | WaitForConnection () |
| virtual void | run () |
| Thread entry point. | |
| void | execute () |
| virtual void | init () |
| Initialize the Serial port device. | |
| virtual void | start_threads () |
| virtual void | stop_threads () |
Private Member Functions | |
| void | serial_menu () |
Private Attributes | |
| Poco::Thread * | myThread |
| bool | StopThread |
| bool | breakHit |
| struct CSerial::SSrl_state | state |
| int | listenPort |
| int | listenSocket |
| int | connectSocket |
| int | throughSocket |
Data Structures | |
| struct | SSrl_state |
| The state structure contains all elements that need to be saved to the statefile. More... | |
| CSerial::CSerial | ( | CConfigurator * | cfg, | |
| CSystem * | c, | |||
| u16 | number | |||
| ) |
Constructor.
Definition at line 202 of file Serial.cpp.
References breakHit, CSerial::SSrl_state::iNumber, and state.
| CSerial::~CSerial | ( | ) | [virtual] |
| void CSerial::write | ( | const char * | s | ) |
Definition at line 477 of file Serial.cpp.
References connectSocket.
Referenced by serial_menu(), WaitForConnection(), and WriteMem().
Reimplemented from CSystemComponent.
Definition at line 392 of file Serial.cpp.
References CSerial::SSrl_state::bBRB_LSB, CSerial::SSrl_state::bBRB_MSB, CSerial::SSrl_state::bFCR, CSerial::SSrl_state::bIER, CSerial::SSrl_state::bLCR, CSerial::SSrl_state::bMCR, CSerial::SSrl_state::bSPR, eval_interrupts(), CSerial::SSrl_state::iNumber, printable(), state, TRC_DEV4, and write().
Reimplemented from CSystemComponent.
Definition at line 319 of file Serial.cpp.
References CSerial::SSrl_state::bBRB_LSB, CSerial::SSrl_state::bBRB_MSB, CSerial::SSrl_state::bIER, CSerial::SSrl_state::bIIR, CSerial::SSrl_state::bLCR, CSerial::SSrl_state::bLSR, CSerial::SSrl_state::bMCR, CSerial::SSrl_state::bMSR, CSerial::SSrl_state::bRDR, CSerial::SSrl_state::bSPR, FIFO_SIZE, CSerial::SSrl_state::iNumber, printable(), CSerial::SSrl_state::rcvBuffer, CSerial::SSrl_state::rcvR, CSerial::SSrl_state::rcvW, state, TRC_DEV2, and TRC_DEV4.
| void CSerial::receive | ( | const char * | data | ) |
Definition at line 482 of file Serial.cpp.
References eval_interrupts(), FIFO_SIZE, CSerial::SSrl_state::rcvBuffer, CSerial::SSrl_state::rcvW, and state.
Referenced by execute().
| void CSerial::check_state | ( | ) | [virtual] |
Check if threads are still running.
Enter serial port menu if <break> was received.
Reimplemented from CSystemComponent.
Definition at line 527 of file Serial.cpp.
References breakHit, FAILURE, Poco::Thread::isRunning(), myThread, and serial_menu().
| int CSerial::SaveState | ( | FILE * | f | ) | [virtual] |
Save state to a Virtual Machine State file.
Implements CSystemComponent.
Definition at line 721 of file Serial.cpp.
References CSystemComponent::devid_string, srl_magic1, srl_magic2, and state.
| int CSerial::RestoreState | ( | FILE * | f | ) | [virtual] |
Restore state from a Virtual Machine State file.
Implements CSystemComponent.
Definition at line 736 of file Serial.cpp.
References CSystemComponent::devid_string, srl_magic1, srl_magic2, and state.
| void CSerial::eval_interrupts | ( | ) |
Definition at line 456 of file Serial.cpp.
References CSerial::SSrl_state::bIER, CSerial::SSrl_state::bIIR, CSerial::SSrl_state::iNumber, CSerial::SSrl_state::irq_active, CAliM1543C::pic_deassert(), CAliM1543C::pic_interrupt(), CSerial::SSrl_state::rcvR, CSerial::SSrl_state::rcvW, state, and theAli.
Referenced by execute(), receive(), and WriteMem().
| void CSerial::WaitForConnection | ( | ) |
Definition at line 793 of file Serial.cpp.
References connectSocket, DO, FAILURE_1, CConfigurator::get_text_value(), IAC, CSerial::SSrl_state::iNumber, INVALID_SOCKET, listenPort, listenSocket, CSystemComponent::myCfg, CSerial::SSrl_state::serial_cycles, state, TELOPT_ECHO, TELOPT_LFLOW, TELOPT_NAWS, TELOPT_SGA, WILL, and write().
| void CSerial::run | ( | void | ) | [virtual] |
Thread entry point.
Implements Poco::Runnable.
Definition at line 501 of file Serial.cpp.
References Poco::Exception::displayText(), execute(), Poco::Thread::sleep(), and StopThread.
| void CSerial::execute | ( | ) |
Definition at line 615 of file Serial.cpp.
References AYT, BREAK, breakHit, connectSocket, eval_interrupts(), FIFO_SIZE, got_sigint, IAC, CSerial::SSrl_state::iNumber, listenPort, receive(), RECV_TICKS, SB, SE, CSerial::SSrl_state::serial_cycles, state, WaitForConnection(), and WILL.
Referenced by run().
| void CSerial::init | ( | ) | [virtual] |
Initialize the Serial port device.
Reimplemented from CSystemComponent.
Definition at line 211 of file Serial.cpp.
References CSerial::SSrl_state::bIIR, CSerial::SSrl_state::bLCR, CSerial::SSrl_state::bLSR, CSerial::SSrl_state::bMSR, CSystemComponent::cSystem, CSystemComponent::devid_string, CConfigurator::get_num_value(), CSerial::SSrl_state::iNumber, INVALID_SOCKET, CSerial::SSrl_state::irq_active, listenPort, listenSocket, ls_IP, CSystemComponent::myCfg, myThread, CSerial::SSrl_state::rcvR, CSerial::SSrl_state::rcvW, CSystem::RegisterMemory(), state, throughSocket, U64, and WaitForConnection().
| void CSerial::start_threads | ( | ) | [virtual] |
Reimplemented from CSystemComponent.
Definition at line 286 of file Serial.cpp.
References Poco::Thread::getName(), CSerial::SSrl_state::iNumber, myThread, Poco::Thread::start(), state, and StopThread.
| void CSerial::stop_threads | ( | ) | [virtual] |
Reimplemented from CSystemComponent.
Definition at line 299 of file Serial.cpp.
References Poco::Thread::getName(), Poco::Thread::join(), myThread, and StopThread.
Referenced by ~CSerial().
| void CSerial::serial_menu | ( | ) | [private] |
Definition at line 536 of file Serial.cpp.
References breakHit, connectSocket, CSystemComponent::cSystem, FAILURE, FIFO_SIZE, CSystem::RestoreState(), CSystem::SaveState(), CSystem::start_threads(), CSystem::stop_threads(), and write().
Referenced by check_state().
Poco::Thread* CSerial::myThread [private] |
Definition at line 127 of file Serial.h.
Referenced by check_state(), init(), start_threads(), and stop_threads().
bool CSerial::StopThread [private] |
bool CSerial::breakHit [private] |
Definition at line 129 of file Serial.h.
Referenced by check_state(), CSerial(), execute(), and serial_menu().
struct CSerial::SSrl_state CSerial::state [private] |
Referenced by CSerial(), eval_interrupts(), execute(), init(), ReadMem(), receive(), RestoreState(), SaveState(), start_threads(), WaitForConnection(), and WriteMem().
int CSerial::listenPort [private] |
int CSerial::listenSocket [private] |
int CSerial::connectSocket [private] |
Definition at line 155 of file Serial.h.
Referenced by execute(), serial_menu(), WaitForConnection(), and write().
int CSerial::throughSocket [private] |