semihosting.hh (12531:3141027bd11a) semihosting.hh (12533:a5b047f55eb6)
1/*
2 * Copyright (c) 2018 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

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

43#include <map>
44#include <memory>
45#include <utility>
46#include <vector>
47
48#include "sim/sim_object.hh"
49
50struct ArmSemihostingParams;
1/*
2 * Copyright (c) 2018 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

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

43#include <map>
44#include <memory>
45#include <utility>
46#include <vector>
47
48#include "sim/sim_object.hh"
49
50struct ArmSemihostingParams;
51class PortProxy;
51class SerialDevice;
52class ThreadContext;
53
54/**
55 * Semihosting for AArch32 and AArch64
56 *
57 * This class implements the Arm semihosting interface. This interface
58 * allows baremetal code access service, such as IO, from the

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

248 unsigned calcTickShift() const {
249 int msb = findMsbSet(SimClock::Frequency);
250 return msb > 31 ? msb - 31 : 0;
251 }
252 uint64_t semiTick(Tick tick) const {
253 return tick >> tickShift;
254 }
255 void semiExit(uint64_t code, uint64_t subcode);
52class SerialDevice;
53class ThreadContext;
54
55/**
56 * Semihosting for AArch32 and AArch64
57 *
58 * This class implements the Arm semihosting interface. This interface
59 * allows baremetal code access service, such as IO, from the

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

249 unsigned calcTickShift() const {
250 int msb = findMsbSet(SimClock::Frequency);
251 return msb > 31 ? msb - 31 : 0;
252 }
253 uint64_t semiTick(Tick tick) const {
254 return tick >> tickShift;
255 }
256 void semiExit(uint64_t code, uint64_t subcode);
257 PortProxy &physProxy(ThreadContext *tc);
256 std::string readString(ThreadContext *tc, Addr ptr, size_t len);
257
258 std::string readString(ThreadContext *tc, Addr ptr, size_t len);
259
260 std::unique_ptr<PortProxy> physProxyS;
261
258 private:
259 typedef std::pair<uint64_t, SemiErrno> RetErrno;
260 static constexpr RetErrno retError(SemiErrno e) {
261 return RetErrno((uint64_t)-1, e);
262 }
263
264 static constexpr RetErrno retOK(uint64_t r) {
265 return RetErrno(r, 0);

--- 83 unchanged lines hidden ---
262 private:
263 typedef std::pair<uint64_t, SemiErrno> RetErrno;
264 static constexpr RetErrno retError(SemiErrno e) {
265 return RetErrno((uint64_t)-1, e);
266 }
267
268 static constexpr RetErrno retOK(uint64_t r) {
269 return RetErrno(r, 0);

--- 83 unchanged lines hidden ---