secure_port_proxy.hh revision 14008
114007Sgabeblack@google.com/* 214007Sgabeblack@google.com * Copyright (c) 2011-2013, 2018 ARM Limited 314007Sgabeblack@google.com * All rights reserved 414007Sgabeblack@google.com * 514007Sgabeblack@google.com * The license below extends only to copyright in the software and shall 614007Sgabeblack@google.com * not be construed as granting a license to any other intellectual 714007Sgabeblack@google.com * property including but not limited to intellectual property relating 814007Sgabeblack@google.com * to a hardware implementation of the functionality of the software 914007Sgabeblack@google.com * licensed hereunder. You may use the software subject to the license 1014007Sgabeblack@google.com * terms below provided that you ensure that this notice is replicated 1114007Sgabeblack@google.com * unmodified and in its entirety in all distributions of the software, 1214007Sgabeblack@google.com * modified or unmodified, in source code or in binary form. 1314007Sgabeblack@google.com * 1414007Sgabeblack@google.com * Redistribution and use in source and binary forms, with or without 1514007Sgabeblack@google.com * modification, are permitted provided that the following conditions are 1614007Sgabeblack@google.com * met: redistributions of source code must retain the above copyright 1714007Sgabeblack@google.com * notice, this list of conditions and the following disclaimer; 1814007Sgabeblack@google.com * redistributions in binary form must reproduce the above copyright 1914007Sgabeblack@google.com * notice, this list of conditions and the following disclaimer in the 2014007Sgabeblack@google.com * documentation and/or other materials provided with the distribution; 2114007Sgabeblack@google.com * neither the name of the copyright holders nor the names of its 2214007Sgabeblack@google.com * contributors may be used to endorse or promote products derived from 2314007Sgabeblack@google.com * this software without specific prior written permission. 2414007Sgabeblack@google.com * 2514007Sgabeblack@google.com * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 2614007Sgabeblack@google.com * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 2714007Sgabeblack@google.com * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 2814007Sgabeblack@google.com * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 2914007Sgabeblack@google.com * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 3014007Sgabeblack@google.com * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 3114007Sgabeblack@google.com * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 3214007Sgabeblack@google.com * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 3314007Sgabeblack@google.com * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 3414007Sgabeblack@google.com * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 3514007Sgabeblack@google.com * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 3614007Sgabeblack@google.com * 3714007Sgabeblack@google.com * Authors: Andreas Hansson 3814007Sgabeblack@google.com */ 3914007Sgabeblack@google.com 4014007Sgabeblack@google.com/** 4114007Sgabeblack@google.com * @file 4214007Sgabeblack@google.com * PortProxy Object Declaration. 4314007Sgabeblack@google.com * 4414007Sgabeblack@google.com * Port proxies are used when non-structural entities need access to 4514007Sgabeblack@google.com * the memory system (or structural entities that want to peak into 4614007Sgabeblack@google.com * the memory system without making a real memory access). 4714007Sgabeblack@google.com * 4814007Sgabeblack@google.com * Proxy objects replace the previous FunctionalPort, TranslatingPort 4914007Sgabeblack@google.com * and VirtualPort objects, which provided the same functionality as 5014007Sgabeblack@google.com * the proxies, but were instances of ports not corresponding to real 5114007Sgabeblack@google.com * structural ports of the simulated system. Via the port proxies all 5214007Sgabeblack@google.com * the accesses go through an actual port (either the system port, 5314007Sgabeblack@google.com * e.g. for processes or initialisation, or a the data port of the 5414007Sgabeblack@google.com * CPU, e.g. for threads) and thus are transparent to a potentially 5514007Sgabeblack@google.com * distributed memory and automatically adhere to the memory map of 5614007Sgabeblack@google.com * the system. 5714007Sgabeblack@google.com */ 5814007Sgabeblack@google.com 5914007Sgabeblack@google.com#ifndef __MEM_SECURE_PORT_PROXY_HH__ 6014007Sgabeblack@google.com#define __MEM_SECURE_PORT_PROXY_HH__ 6114007Sgabeblack@google.com 6214007Sgabeblack@google.com#include "mem/port_proxy.hh" 6314007Sgabeblack@google.com 6414007Sgabeblack@google.com/** 6514007Sgabeblack@google.com * This object is a proxy for a structural port, to be used for debug 6614007Sgabeblack@google.com * accesses to secure memory. 6714007Sgabeblack@google.com * 6814007Sgabeblack@google.com * The addresses are interpreted as physical addresses to secure memory. 6914007Sgabeblack@google.com */ 7014007Sgabeblack@google.comclass SecurePortProxy : public PortProxy 7114007Sgabeblack@google.com{ 7214007Sgabeblack@google.com public: 7314007Sgabeblack@google.com SecurePortProxy(MasterPort &port, unsigned int cache_line_size) 7414007Sgabeblack@google.com : PortProxy(port, cache_line_size) {} 7514007Sgabeblack@google.com 7614008Sgabeblack@google.com bool tryReadBlob(Addr addr, uint8_t *p, int size) const override; 7714008Sgabeblack@google.com bool tryWriteBlob(Addr addr, const uint8_t *p, int size) const override; 7814008Sgabeblack@google.com bool tryMemsetBlob(Addr addr, uint8_t val, int size) const override; 7914007Sgabeblack@google.com}; 8014007Sgabeblack@google.com 8114007Sgabeblack@google.com#endif // __MEM_SECURE_PORT_PROXY_HH__ 82