smt.hh revision 2
16019Shines@cs.fsu.edu/* 27093Sgblack@eecs.umich.edu * Copyright (c) 2003 The Regents of The University of Michigan 37093Sgblack@eecs.umich.edu * All rights reserved. 47093Sgblack@eecs.umich.edu * 57093Sgblack@eecs.umich.edu * Redistribution and use in source and binary forms, with or without 67093Sgblack@eecs.umich.edu * modification, are permitted provided that the following conditions are 77093Sgblack@eecs.umich.edu * met: redistributions of source code must retain the above copyright 87093Sgblack@eecs.umich.edu * notice, this list of conditions and the following disclaimer; 97093Sgblack@eecs.umich.edu * redistributions in binary form must reproduce the above copyright 107093Sgblack@eecs.umich.edu * notice, this list of conditions and the following disclaimer in the 117093Sgblack@eecs.umich.edu * documentation and/or other materials provided with the distribution; 127093Sgblack@eecs.umich.edu * neither the name of the copyright holders nor the names of its 137093Sgblack@eecs.umich.edu * contributors may be used to endorse or promote products derived from 146019Shines@cs.fsu.edu * this software without specific prior written permission. 156019Shines@cs.fsu.edu * 166019Shines@cs.fsu.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 176019Shines@cs.fsu.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 186019Shines@cs.fsu.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 196019Shines@cs.fsu.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 206019Shines@cs.fsu.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 216019Shines@cs.fsu.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 226019Shines@cs.fsu.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 236019Shines@cs.fsu.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 246019Shines@cs.fsu.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 256019Shines@cs.fsu.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 266019Shines@cs.fsu.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 276019Shines@cs.fsu.edu */ 286019Shines@cs.fsu.edu 296019Shines@cs.fsu.edu/** 306019Shines@cs.fsu.edu * @file 316019Shines@cs.fsu.edu * Defines SMT_MAX_CPUS and SMT_MAX_THREADS. 326019Shines@cs.fsu.edu */ 336019Shines@cs.fsu.edu 346019Shines@cs.fsu.edu#ifndef __SMT_HH__ 356019Shines@cs.fsu.edu#define __SMT_HH__ 366019Shines@cs.fsu.edu 376019Shines@cs.fsu.edu#ifndef SMT_MAX_CPUS 386019Shines@cs.fsu.edu/** The maximum number of cpus in any one system. */ 396019Shines@cs.fsu.edu#define SMT_MAX_CPUS 4 406019Shines@cs.fsu.edu#endif 416735Sgblack@eecs.umich.edu 426735Sgblack@eecs.umich.edu#ifndef SMT_MAX_THREADS 436019Shines@cs.fsu.edu/** The number of TPUs in any processor. */ 446019Shines@cs.fsu.edu#define SMT_MAX_THREADS 4 456019Shines@cs.fsu.edu#endif 468229Snate@binkert.org 478229Snate@binkert.org/** 486019Shines@cs.fsu.edu * The maximum number of active threads across all cpus. Used to 498232Snate@binkert.org * initialize per-thread statistics in the cache. 506019Shines@cs.fsu.edu * 516019Shines@cs.fsu.edu * NB: Be careful to only use it once all the CPUs that you care about 526019Shines@cs.fsu.edu * have been initialized 536019Shines@cs.fsu.edu */ 547362Sgblack@eecs.umich.eduextern int maxThreadsPerCPU; 556735Sgblack@eecs.umich.edu 566019Shines@cs.fsu.edu/** 577362Sgblack@eecs.umich.edu * Changes the status and priority of the thread with the given number. 586735Sgblack@eecs.umich.edu * @param thread_number The thread to change. 596019Shines@cs.fsu.edu * @param activate The new active status. 607362Sgblack@eecs.umich.edu * @param priority The new priority. 616735Sgblack@eecs.umich.edu */ 626019Shines@cs.fsu.eduvoid change_thread_state(int thread_number, int activate, int priority); 637362Sgblack@eecs.umich.edu 646735Sgblack@eecs.umich.edu#endif // __SMT_HH__ 656019Shines@cs.fsu.edu