Deleted Added
sdiff udiff text old ( 12693:4db8d6442b44 ) new ( 14249:e6d5e7d248c5 )
full compact
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 *
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),
124 outfile(terminalDump(p))
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}
164
165///////////////////////////////////////////////////////////////////////
166// socket creation and terminal attach
167//
168
169void
170Terminal::listen(int port)
171{

--- 199 unchanged lines hidden ---