14712SN/A// -*- mode:c++ -*-
24712SN/A
38332Snate@binkert.org// Copyright (c) 2010 Advanced Micro Devices, Inc.
44712SN/A// All rights reserved.
54712SN/A//
67087SN/A// The license below extends only to copyright in the software and shall
77087SN/A// not be construed as granting a license to any other intellectual
87087SN/A// property including but not limited to intellectual property relating
97087SN/A// to a hardware implementation of the functionality of the software
107087SN/A// licensed hereunder.  You may use the software subject to the license
117087SN/A// terms below provided that you ensure that this notice is replicated
127087SN/A// unmodified and in its entirety in all distributions of the software,
137087SN/A// modified or unmodified, in source code or in binary form.
144712SN/A//
157087SN/A// Redistribution and use in source and binary forms, with or without
167087SN/A// modification, are permitted provided that the following conditions are
177087SN/A// met: redistributions of source code must retain the above copyright
187087SN/A// notice, this list of conditions and the following disclaimer;
197087SN/A// redistributions in binary form must reproduce the above copyright
207087SN/A// notice, this list of conditions and the following disclaimer in the
217087SN/A// documentation and/or other materials provided with the distribution;
227087SN/A// neither the name of the copyright holders nor the names of its
234712SN/A// contributors may be used to endorse or promote products derived from
247087SN/A// this software without specific prior written permission.
254712SN/A//
264712SN/A// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
274712SN/A// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
284712SN/A// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
294712SN/A// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
304712SN/A// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
314712SN/A// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
324712SN/A// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
334712SN/A// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
344712SN/A// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
354712SN/A// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
364712SN/A// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
374712SN/A//
384712SN/A// Authors: Gabe Black
394712SN/A
404712SN/A////////////////////////////////////////////////////////////////////
414712SN/A//
424712SN/A// "Format" which describes an instruction whose only purpose is to
434712SN/A// call a syscall in SE mode.
444712SN/A//
454712SN/A
464712SN/Aoutput header {{
477715Sgblack@eecs.umich.edu    class NopInst : public X86ISA::X86StaticInst
484712SN/A    {
494712SN/A      public:
504806SN/A        static const RegIndex foldOBit = 0;
514712SN/A        /// Constructor
527715Sgblack@eecs.umich.edu        NopInst(const char *_mnemonic, ExtMachInst _machInst,
534712SN/A                OpClass __opClass) :
544712SN/A            X86ISA::X86StaticInst(_mnemonic, _machInst, __opClass)
554712SN/A        {
564712SN/A        }
574712SN/A
584712SN/A        std::string generateDisassembly(Addr pc,
594712SN/A                const SymbolTable *symtab) const;
604712SN/A    };
614712SN/A}};
624712SN/A
634712SN/Aoutput decoder {{
647715Sgblack@eecs.umich.edu    std::string NopInst::generateDisassembly(Addr PC,
654712SN/A            const SymbolTable *symtab) const
664712SN/A    {
674712SN/A        std::stringstream response;
684712SN/A
694712SN/A        printMnemonic(response, mnemonic);
704712SN/A        return response.str();
714712SN/A    }
724712SN/A}};
734712SN/A
747715Sgblack@eecs.umich.edudef template NopExecute {{
7512234Sgabeblack@google.com    Fault %(class_name)s::execute(ExecContext *xc,
764712SN/A            Trace::InstRecord *traceData) const
774712SN/A    {
787715Sgblack@eecs.umich.edu        return NoFault;
794712SN/A    }
804712SN/A}};
814712SN/A
827715Sgblack@eecs.umich.edudef format NopInst(*opt_flags) {{
837715Sgblack@eecs.umich.edu    iop = InstObjParams(name, Name, 'NopInst', "", opt_flags)
844712SN/A    header_output = BasicDeclare.subst(iop)
854712SN/A    decoder_output = BasicConstructor.subst(iop)
864712SN/A    decode_block = BasicDecode.subst(iop)
877715Sgblack@eecs.umich.edu    exec_output = NopExecute.subst(iop)
884712SN/A}};
894712SN/A
90