terminal.cc (12693:4db8d6442b44) terminal.cc (14249:e6d5e7d248c5)
1/*
1/*
2 * Copyright (c) 2019 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software
9 * licensed hereunder. You may use the software subject to the license
10 * terms below provided that you ensure that this notice is replicated
11 * unmodified and in its entirety in all distributions of the software,
12 * modified or unmodified, in source code or in binary form.
13 *
2 * Copyright (c) 2001-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;
9 * redistributions in binary form must reproduce the above copyright

--- 94 unchanged lines hidden (view full) ---

104}
105
106/*
107 * Terminal code
108 */
109Terminal::Terminal(const Params *p)
110 : SerialDevice(p), listenEvent(NULL), dataEvent(NULL),
111 number(p->number), data_fd(-1), txbuf(16384), rxbuf(16384),
14 * Copyright (c) 2001-2005 The Regents of The University of Michigan
15 * All rights reserved.
16 *
17 * Redistribution and use in source and binary forms, with or without
18 * modification, are permitted provided that the following conditions are
19 * met: redistributions of source code must retain the above copyright
20 * notice, this list of conditions and the following disclaimer;
21 * redistributions in binary form must reproduce the above copyright

--- 94 unchanged lines hidden (view full) ---

116}
117
118/*
119 * Terminal code
120 */
121Terminal::Terminal(const Params *p)
122 : SerialDevice(p), listenEvent(NULL), dataEvent(NULL),
123 number(p->number), data_fd(-1), txbuf(16384), rxbuf(16384),
112 outfile(p->output ? simout.findOrCreate(p->name) : NULL)
124 outfile(terminalDump(p))
113#if TRACING_ON == 1
114 , linebuf(16384)
115#endif
116{
117 if (outfile)
118 outfile->stream()->setf(ios::unitbuf);
119
120 if (p->port)

--- 7 unchanged lines hidden (view full) ---

128
129 if (listenEvent)
130 delete listenEvent;
131
132 if (dataEvent)
133 delete dataEvent;
134}
135
125#if TRACING_ON == 1
126 , linebuf(16384)
127#endif
128{
129 if (outfile)
130 outfile->stream()->setf(ios::unitbuf);
131
132 if (p->port)

--- 7 unchanged lines hidden (view full) ---

140
141 if (listenEvent)
142 delete listenEvent;
143
144 if (dataEvent)
145 delete dataEvent;
146}
147
148OutputStream *
149Terminal::terminalDump(const TerminalParams* p)
150{
151 switch (p->outfile) {
152 case Enums::TerminalDump::none:
153 return nullptr;
154 case Enums::TerminalDump::stdout:
155 return simout.findOrCreate("stdout");
156 case Enums::TerminalDump::stderr:
157 return simout.findOrCreate("stderr");
158 case Enums::TerminalDump::file:
159 return simout.findOrCreate(p->name);
160 default:
161 panic("Invalid option\n");
162 }
163}
136
137///////////////////////////////////////////////////////////////////////
138// socket creation and terminal attach
139//
140
141void
142Terminal::listen(int port)
143{

--- 199 unchanged lines hidden ---
164
165///////////////////////////////////////////////////////////////////////
166// socket creation and terminal attach
167//
168
169void
170Terminal::listen(int port)
171{

--- 199 unchanged lines hidden ---