intr_control.cc revision 146
14484Sbinkertn@umich.edu/*
24484Sbinkertn@umich.edu * Copyright (c) 2003 The Regents of The University of Michigan
34484Sbinkertn@umich.edu * All rights reserved.
44484Sbinkertn@umich.edu *
54484Sbinkertn@umich.edu * Redistribution and use in source and binary forms, with or without
64484Sbinkertn@umich.edu * modification, are permitted provided that the following conditions are
74484Sbinkertn@umich.edu * met: redistributions of source code must retain the above copyright
84484Sbinkertn@umich.edu * notice, this list of conditions and the following disclaimer;
94484Sbinkertn@umich.edu * redistributions in binary form must reproduce the above copyright
104484Sbinkertn@umich.edu * notice, this list of conditions and the following disclaimer in the
114484Sbinkertn@umich.edu * documentation and/or other materials provided with the distribution;
124484Sbinkertn@umich.edu * neither the name of the copyright holders nor the names of its
134484Sbinkertn@umich.edu * contributors may be used to endorse or promote products derived from
144484Sbinkertn@umich.edu * this software without specific prior written permission.
154484Sbinkertn@umich.edu *
164484Sbinkertn@umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
174484Sbinkertn@umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
184484Sbinkertn@umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
194484Sbinkertn@umich.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
204484Sbinkertn@umich.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
214484Sbinkertn@umich.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
224484Sbinkertn@umich.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
234484Sbinkertn@umich.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
244484Sbinkertn@umich.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
254484Sbinkertn@umich.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
264484Sbinkertn@umich.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
274484Sbinkertn@umich.edu */
284484Sbinkertn@umich.edu
294484Sbinkertn@umich.edu#include <string>
304484Sbinkertn@umich.edu#include <vector>
314484Sbinkertn@umich.edu
324484Sbinkertn@umich.edu#include "cpu/base_cpu.hh"
334484Sbinkertn@umich.edu#include "cpu/intr_control.hh"
344484Sbinkertn@umich.edu#include "sim/builder.hh"
354484Sbinkertn@umich.edu#include "sim/sim_object.hh"
364484Sbinkertn@umich.edu
374484Sbinkertn@umich.eduusing namespace std;
384484Sbinkertn@umich.edu
394484Sbinkertn@umich.eduIntrControl::IntrControl(const string &name, BaseCPU *c)
404484Sbinkertn@umich.edu    : SimObject(name), cpu(c)
414484Sbinkertn@umich.edu{}
424484Sbinkertn@umich.edu
434484Sbinkertn@umich.eduBEGIN_DECLARE_SIM_OBJECT_PARAMS(IntrControl)
444484Sbinkertn@umich.edu
454484Sbinkertn@umich.edu    SimObjectParam<BaseCPU *> cpu;
464484Sbinkertn@umich.edu
474484Sbinkertn@umich.eduEND_DECLARE_SIM_OBJECT_PARAMS(IntrControl)
484484Sbinkertn@umich.edu
494484Sbinkertn@umich.eduBEGIN_INIT_SIM_OBJECT_PARAMS(IntrControl)
504484Sbinkertn@umich.edu
514484Sbinkertn@umich.edu    INIT_PARAM(cpu, "the processor")
524484Sbinkertn@umich.edu
534484Sbinkertn@umich.eduEND_INIT_SIM_OBJECT_PARAMS(IntrControl)
544484Sbinkertn@umich.edu
554484Sbinkertn@umich.eduCREATE_SIM_OBJECT(IntrControl)
564484Sbinkertn@umich.edu{
574484Sbinkertn@umich.edu    return new IntrControl(getInstanceName(), cpu);
584484Sbinkertn@umich.edu}
594484Sbinkertn@umich.edu
604484Sbinkertn@umich.eduREGISTER_SIM_OBJECT("IntrControl", IntrControl)
614484Sbinkertn@umich.edu