idle_event.cc revision 13905
12381SN/A/* 213732Snikos.nikoleris@arm.com * Copyright (c) 2004-2005 The Regents of The University of Michigan 38949Sandreas.hansson@arm.com * All rights reserved. 48949Sandreas.hansson@arm.com * 58949Sandreas.hansson@arm.com * Redistribution and use in source and binary forms, with or without 68949Sandreas.hansson@arm.com * modification, are permitted provided that the following conditions are 78949Sandreas.hansson@arm.com * met: redistributions of source code must retain the above copyright 88949Sandreas.hansson@arm.com * notice, this list of conditions and the following disclaimer; 98949Sandreas.hansson@arm.com * redistributions in binary form must reproduce the above copyright 108949Sandreas.hansson@arm.com * notice, this list of conditions and the following disclaimer in the 118949Sandreas.hansson@arm.com * documentation and/or other materials provided with the distribution; 128949Sandreas.hansson@arm.com * neither the name of the copyright holders nor the names of its 138949Sandreas.hansson@arm.com * contributors may be used to endorse or promote products derived from 142592SN/A * this software without specific prior written permission. 1510975Sdavid.hashe@amd.com * 162381SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 172381SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 182381SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 192381SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 202381SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 212381SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 222381SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 232381SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 242381SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 252381SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 262381SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 272381SN/A * 282381SN/A * Authors: Lisa Hsu 292381SN/A * Nathan Binkert 302381SN/A */ 312381SN/A 322381SN/A#include "arch/alpha/idle_event.hh" 332381SN/A 342381SN/A#include "arch/alpha/kernel_stats.hh" 352381SN/A#include "cpu/thread_context.hh" 362381SN/A 372381SN/Ausing namespace AlphaISA; 382381SN/A 392381SN/Avoid 402665Ssaidi@eecs.umich.eduIdleStartEvent::process(ThreadContext *tc) 412665Ssaidi@eecs.umich.edu{ 422665Ssaidi@eecs.umich.edu if (tc->getKernelStats()) { 432665Ssaidi@eecs.umich.edu RegVal val = tc->readMiscRegNoEffect(IPR_PALtemp23); 449031Sandreas.hansson@arm.com auto *stats = dynamic_cast<AlphaISA::Kernel::Statistics *>( 4512349Snikos.nikoleris@arm.com tc->getKernelStats()); 462381SN/A assert(stats); 472381SN/A stats->setIdleProcess(val, tc); 482381SN/A } 492381SN/A remove(); 502662Sstever@eecs.umich.edu} 512381SN/A