nop.isa revision 7087
12381SN/A// -*- mode:c++ -*-
22592SN/A
32381SN/A// Copyright (c) 2007 The Hewlett-Packard Development Company
42381SN/A// All rights reserved.
52381SN/A//
62381SN/A// The license below extends only to copyright in the software and shall
72381SN/A// not be construed as granting a license to any other intellectual
82381SN/A// property including but not limited to intellectual property relating
92381SN/A// to a hardware implementation of the functionality of the software
102381SN/A// licensed hereunder.  You may use the software subject to the license
112381SN/A// terms below provided that you ensure that this notice is replicated
122381SN/A// unmodified and in its entirety in all distributions of the software,
132381SN/A// modified or unmodified, in source code or in binary form.
142381SN/A//
152381SN/A// Redistribution and use in source and binary forms, with or without
162381SN/A// modification, are permitted provided that the following conditions are
172381SN/A// met: redistributions of source code must retain the above copyright
182381SN/A// notice, this list of conditions and the following disclaimer;
192381SN/A// redistributions in binary form must reproduce the above copyright
202381SN/A// notice, this list of conditions and the following disclaimer in the
212381SN/A// documentation and/or other materials provided with the distribution;
222381SN/A// neither the name of the copyright holders nor the names of its
232381SN/A// contributors may be used to endorse or promote products derived from
242381SN/A// this software without specific prior written permission.
252381SN/A//
262381SN/A// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
272665Ssaidi@eecs.umich.edu// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
282665Ssaidi@eecs.umich.edu// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
292665Ssaidi@eecs.umich.edu// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
302665Ssaidi@eecs.umich.edu// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
312381SN/A// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
322381SN/A// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
332381SN/A// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
342381SN/A// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
352662Sstever@eecs.umich.edu// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
362381SN/A// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
372381SN/A//
382381SN/A// Authors: Gabe Black
392381SN/A
402381SN/A////////////////////////////////////////////////////////////////////
412392SN/A//
422980Sgblack@eecs.umich.edu// "Format" which describes an instruction whose only purpose is to
432394SN/A// call a syscall in SE mode.
442812Srdreslin@umich.edu//
452989Ssaidi@eecs.umich.edu
462394SN/Aoutput header {{
472394SN/A    class SyscallInst : public X86ISA::X86StaticInst
482394SN/A    {
492394SN/A      public:
502812Srdreslin@umich.edu        static const RegIndex foldOBit = 0;
512812Srdreslin@umich.edu        /// Constructor
522812Srdreslin@umich.edu        SyscallInst(const char *_mnemonic, ExtMachInst _machInst,
532812Srdreslin@umich.edu                OpClass __opClass) :
542812Srdreslin@umich.edu            X86ISA::X86StaticInst(_mnemonic, _machInst, __opClass)
552812Srdreslin@umich.edu        {
562813Srdreslin@umich.edu        }
572813Srdreslin@umich.edu
582813Srdreslin@umich.edu        std::string generateDisassembly(Addr pc,
593074Srdreslin@umich.edu                const SymbolTable *symtab) const;
602382SN/A    };
613208Srdreslin@umich.edu}};
623214Srdreslin@umich.edu
632381SN/Aoutput decoder {{
642662Sstever@eecs.umich.edu    std::string SyscallInst::generateDisassembly(Addr PC,
652662Sstever@eecs.umich.edu            const SymbolTable *symtab) const
662662Sstever@eecs.umich.edu    {
672662Sstever@eecs.umich.edu        std::stringstream response;
682662Sstever@eecs.umich.edu
692381SN/A        printMnemonic(response, mnemonic);
702641Sstever@eecs.umich.edu        ccprintf(response, " ");
712381SN/A        printReg(response, _srcRegIdx[0], machInst.opSize);
722813Srdreslin@umich.edu        return response.str();
732813Srdreslin@umich.edu    }
742813Srdreslin@umich.edu}};
752813Srdreslin@umich.edu
762566SN/Adef template SyscallExecute {{
772662Sstever@eecs.umich.edu    Fault %(class_name)s::execute(%(CPU_exec_context)s *xc,
782662Sstever@eecs.umich.edu            Trace::InstRecord *traceData) const
792662Sstever@eecs.umich.edu    {
802662Sstever@eecs.umich.edu        Fault fault = NoFault;
812662Sstever@eecs.umich.edu        %(op_decl)s;
822566SN/A        %(op_rd)s;
832566SN/A        %(code)s;
842566SN/A        return fault;
852662Sstever@eecs.umich.edu    }
862662Sstever@eecs.umich.edu}};
872566SN/A
882662Sstever@eecs.umich.edudef format SyscallInst(code, *opt_flags) {{
892662Sstever@eecs.umich.edu    iop = InstObjParams(name, Name, 'SyscallInst', code, opt_flags)
902566SN/A    header_output = BasicDeclare.subst(iop)
912662Sstever@eecs.umich.edu    decoder_output = BasicConstructor.subst(iop)
922662Sstever@eecs.umich.edu    decode_block = BasicDecode.subst(iop)
932566SN/A    exec_output = SyscallExecute.subst(iop)
942566SN/A}};
952566SN/A
962662Sstever@eecs.umich.edu