m5op_arm.S revision 9686:13a4419f09c5
12929Sktlim@umich.edu/*
22929Sktlim@umich.edu * Copyright (c) 2010 ARM Limited
32932Sktlim@umich.edu * All rights reserved
42929Sktlim@umich.edu *
52929Sktlim@umich.edu * The license below extends only to copyright in the software and shall
62929Sktlim@umich.edu * not be construed as granting a license to any other intellectual
72929Sktlim@umich.edu * property including but not limited to intellectual property relating
82929Sktlim@umich.edu * to a hardware implementation of the functionality of the software
92929Sktlim@umich.edu * licensed hereunder.  You may use the software subject to the license
102929Sktlim@umich.edu * terms below provided that you ensure that this notice is replicated
112929Sktlim@umich.edu * unmodified and in its entirety in all distributions of the software,
122929Sktlim@umich.edu * modified or unmodified, in source code or in binary form.
132929Sktlim@umich.edu *
142929Sktlim@umich.edu * Copyright (c) 2003-2006 The Regents of The University of Michigan
152929Sktlim@umich.edu * All rights reserved.
162929Sktlim@umich.edu *
172929Sktlim@umich.edu * Redistribution and use in source and binary forms, with or without
182929Sktlim@umich.edu * modification, are permitted provided that the following conditions are
192929Sktlim@umich.edu * met: redistributions of source code must retain the above copyright
202929Sktlim@umich.edu * notice, this list of conditions and the following disclaimer;
212929Sktlim@umich.edu * redistributions in binary form must reproduce the above copyright
222929Sktlim@umich.edu * notice, this list of conditions and the following disclaimer in the
232929Sktlim@umich.edu * documentation and/or other materials provided with the distribution;
242929Sktlim@umich.edu * neither the name of the copyright holders nor the names of its
252929Sktlim@umich.edu * contributors may be used to endorse or promote products derived from
262929Sktlim@umich.edu * this software without specific prior written permission.
272929Sktlim@umich.edu *
282932Sktlim@umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
292932Sktlim@umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
302932Sktlim@umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
312929Sktlim@umich.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
326007Ssteve.reinhardt@amd.com * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
337735SAli.Saidi@ARM.com * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
342929Sktlim@umich.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
352929Sktlim@umich.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
362929Sktlim@umich.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
372929Sktlim@umich.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
382929Sktlim@umich.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
392929Sktlim@umich.edu *
402929Sktlim@umich.edu * Authors: Nathan Binkert
418947Sandreas.hansson@arm.com *          Ali Saidi
428947Sandreas.hansson@arm.com *          Chander Sudanthi
438947Sandreas.hansson@arm.com *          Andreas Sandberg
442929Sktlim@umich.edu */
452929Sktlim@umich.edu.syntax unified
462929Sktlim@umich.edu#ifdef __thumb__
472929Sktlim@umich.edu.thumb
482929Sktlim@umich.edu#endif
492929Sktlim@umich.edu
506007Ssteve.reinhardt@amd.com#include "m5ops.h"
516007Ssteve.reinhardt@amd.com
526007Ssteve.reinhardt@amd.com.text
536007Ssteve.reinhardt@amd.com
546007Ssteve.reinhardt@amd.com.macro simple_op name, func, subfunc
556007Ssteve.reinhardt@amd.com        .align 2
566007Ssteve.reinhardt@amd.com        .globl \name
576007Ssteve.reinhardt@amd.com\name:
586007Ssteve.reinhardt@amd.com        /* First, try to trap into m5 using the m5-kvm hypercall
596007Ssteve.reinhardt@amd.com         * hack. The bxj will become a branch to the fallback code
606007Ssteve.reinhardt@amd.com         * if it is executed in the normal m5 environment.
616007Ssteve.reinhardt@amd.com         */
626007Ssteve.reinhardt@amd.com        push {lr}
636007Ssteve.reinhardt@amd.com#ifdef __thumb__
646007Ssteve.reinhardt@amd.com        adr lr, 1f+1
656007Ssteve.reinhardt@amd.com#else
669435SAndreas.Sandberg@ARM.com        adr lr, 1f
679435SAndreas.Sandberg@ARM.com#endif
689435SAndreas.Sandberg@ARM.com        ldr ip, =((((\func) & 0xFF) << 8) | ((\subfunc) & 0xFF))
696007Ssteve.reinhardt@amd.com        bxj lr
706007Ssteve.reinhardt@amd.com        pop {pc}
716007Ssteve.reinhardt@amd.com
726007Ssteve.reinhardt@amd.com        /* Old-style m5 pseudo instruction using CP1 accesses */
736007Ssteve.reinhardt@amd.com1:
746007Ssteve.reinhardt@amd.com#ifdef __thumb__
756007Ssteve.reinhardt@amd.com        .short 0xEE00 | \func
766007Ssteve.reinhardt@amd.com        .short 0x0110 | (\subfunc << 12)
776007Ssteve.reinhardt@amd.com#else
786007Ssteve.reinhardt@amd.com        .long (0xEE000110 | (\func << 16) | (\subfunc << 12))
792929Sktlim@umich.edu#endif
802929Sktlim@umich.edu        pop {pc}
812929Sktlim@umich.edu.endm
826007Ssteve.reinhardt@amd.com
836007Ssteve.reinhardt@amd.com#define SIMPLE_OP(name, func, subfunc) simple_op name, func, subfunc
846007Ssteve.reinhardt@amd.com
859781Sandreas.hansson@arm.comSIMPLE_OP(arm, arm_func, 0)
866007Ssteve.reinhardt@amd.comSIMPLE_OP(quiesce, quiesce_func, 0)
876007Ssteve.reinhardt@amd.comSIMPLE_OP(quiesceNs, quiescens_func, 0)
882929Sktlim@umich.eduSIMPLE_OP(quiesceCycle, quiescecycle_func, 0)
892929Sktlim@umich.eduSIMPLE_OP(quiesceTime, quiescetime_func, 0)
902929Sktlim@umich.eduSIMPLE_OP(rpns, rpns_func, 0)
912929Sktlim@umich.eduSIMPLE_OP(wakeCPU, wakecpu_func, 0)
922929Sktlim@umich.eduSIMPLE_OP(m5_exit, exit_func, 0)
936011Ssteve.reinhardt@amd.comSIMPLE_OP(m5_initparam, initparam_func, 0)
946007Ssteve.reinhardt@amd.comSIMPLE_OP(m5_loadsymbol, loadsymbol_func, 0)
956007Ssteve.reinhardt@amd.comSIMPLE_OP(m5_reset_stats, resetstats_func, 0)
966007Ssteve.reinhardt@amd.comSIMPLE_OP(m5_dump_stats, dumpstats_func, 0)
976007Ssteve.reinhardt@amd.comSIMPLE_OP(m5_dumpreset_stats, dumprststats_func, 0)
986007Ssteve.reinhardt@amd.comSIMPLE_OP(m5_checkpoint, ckpt_func, 0)
996007Ssteve.reinhardt@amd.comSIMPLE_OP(m5_readfile, readfile_func, 0)
1006007Ssteve.reinhardt@amd.comSIMPLE_OP(m5_writefile, writefile_func, 0)
1016007Ssteve.reinhardt@amd.comSIMPLE_OP(m5_debugbreak, debugbreak_func, 0)
1026007Ssteve.reinhardt@amd.comSIMPLE_OP(m5_switchcpu, switchcpu_func, 0)
1036007Ssteve.reinhardt@amd.comSIMPLE_OP(m5_addsymbol, addsymbol_func, 0)
1046007Ssteve.reinhardt@amd.comSIMPLE_OP(m5_panic, panic_func, 0)
1056007Ssteve.reinhardt@amd.comSIMPLE_OP(m5_work_begin, work_begin_func, 0)
1066007Ssteve.reinhardt@amd.comSIMPLE_OP(m5_work_end, work_end_func, 0)
10710742Sandreas.hansson@arm.com
10810742Sandreas.hansson@arm.comSIMPLE_OP(m5a_bsm, annotate_func, an_bsm)
10910384SCurtis.Dunham@arm.comSIMPLE_OP(m5a_esm, annotate_func, an_esm)
11010742Sandreas.hansson@arm.comSIMPLE_OP(m5a_begin, annotate_func, an_begin)
1116007Ssteve.reinhardt@amd.comSIMPLE_OP(m5a_end, annotate_func, an_end)
1129781Sandreas.hansson@arm.comSIMPLE_OP(m5a_q, annotate_func, an_q)
1139781Sandreas.hansson@arm.comSIMPLE_OP(m5a_rq, annotate_func, an_rq)
1149781Sandreas.hansson@arm.comSIMPLE_OP(m5a_dq, annotate_func, an_dq)
1159781Sandreas.hansson@arm.comSIMPLE_OP(m5a_wf, annotate_func, an_wf)
1167735SAli.Saidi@ARM.comSIMPLE_OP(m5a_we, annotate_func, an_we)
1176011Ssteve.reinhardt@amd.comSIMPLE_OP(m5a_ws, annotate_func, an_ws)
1186007Ssteve.reinhardt@amd.comSIMPLE_OP(m5a_sq, annotate_func, an_sq)
1199781Sandreas.hansson@arm.comSIMPLE_OP(m5a_aq, annotate_func, an_aq)
1206007Ssteve.reinhardt@amd.comSIMPLE_OP(m5a_pq, annotate_func, an_pq)
1216007Ssteve.reinhardt@amd.comSIMPLE_OP(m5a_l, annotate_func, an_l)
1227735SAli.Saidi@ARM.comSIMPLE_OP(m5a_identify, annotate_func, an_identify)
1237735SAli.Saidi@ARM.comSIMPLE_OP(m5a_getid, annotate_func, an_getid)
1247735SAli.Saidi@ARM.com