13549SN/A/*
23549SN/A * Copyright (c) 2004-2005 The Regents of The University of Michigan
33549SN/A * All rights reserved.
43549SN/A *
53549SN/A * Redistribution and use in source and binary forms, with or without
63549SN/A * modification, are permitted provided that the following conditions are
73549SN/A * met: redistributions of source code must retain the above copyright
83549SN/A * notice, this list of conditions and the following disclaimer;
93549SN/A * redistributions in binary form must reproduce the above copyright
103549SN/A * notice, this list of conditions and the following disclaimer in the
113549SN/A * documentation and/or other materials provided with the distribution;
123549SN/A * neither the name of the copyright holders nor the names of its
133549SN/A * contributors may be used to endorse or promote products derived from
143549SN/A * this software without specific prior written permission.
153549SN/A *
163549SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
173549SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
183549SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
193549SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
203549SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
213549SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
223549SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
233549SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
243549SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
253549SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
263549SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
273549SN/A *
283549SN/A * Authors: Lisa Hsu
293549SN/A *          Nathan Binkert
303549SN/A */
313549SN/A
323565Sgblack@eecs.umich.edu#include "arch/alpha/idle_event.hh"
3311793Sbrandon.potter@amd.com
343565Sgblack@eecs.umich.edu#include "arch/alpha/kernel_stats.hh"
353549SN/A#include "cpu/thread_context.hh"
363549SN/A
375567Snate@binkert.orgusing namespace AlphaISA;
383549SN/A
393549SN/Avoid
403549SN/AIdleStartEvent::process(ThreadContext *tc)
413549SN/A{
425569Snate@binkert.org    if (tc->getKernelStats()) {
4313614Sgabeblack@google.com        RegVal val = tc->readMiscRegNoEffect(IPR_PALtemp23);
4413905Sgabeblack@google.com        auto *stats = dynamic_cast<AlphaISA::Kernel::Statistics *>(
4513905Sgabeblack@google.com                tc->getKernelStats());
4613905Sgabeblack@google.com        assert(stats);
4713905Sgabeblack@google.com        stats->setIdleProcess(val, tc);
485569Snate@binkert.org    }
493549SN/A    remove();
503549SN/A}
51