intr_control.hh revision 12334
18733Sgeoffrey.blake@arm.com/*
28733Sgeoffrey.blake@arm.com * Copyright (c) 2001-2005 The Regents of The University of Michigan
38733Sgeoffrey.blake@arm.com * All rights reserved.
48733Sgeoffrey.blake@arm.com *
58733Sgeoffrey.blake@arm.com * Redistribution and use in source and binary forms, with or without
68733Sgeoffrey.blake@arm.com * modification, are permitted provided that the following conditions are
78733Sgeoffrey.blake@arm.com * met: redistributions of source code must retain the above copyright
88733Sgeoffrey.blake@arm.com * notice, this list of conditions and the following disclaimer;
98733Sgeoffrey.blake@arm.com * redistributions in binary form must reproduce the above copyright
108733Sgeoffrey.blake@arm.com * notice, this list of conditions and the following disclaimer in the
118733Sgeoffrey.blake@arm.com * documentation and/or other materials provided with the distribution;
128733Sgeoffrey.blake@arm.com * neither the name of the copyright holders nor the names of its
138733Sgeoffrey.blake@arm.com * contributors may be used to endorse or promote products derived from
148733Sgeoffrey.blake@arm.com * this software without specific prior written permission.
158733Sgeoffrey.blake@arm.com *
168733Sgeoffrey.blake@arm.com * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
178733Sgeoffrey.blake@arm.com * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
188733Sgeoffrey.blake@arm.com * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
198733Sgeoffrey.blake@arm.com * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
208733Sgeoffrey.blake@arm.com * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
218733Sgeoffrey.blake@arm.com * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
228733Sgeoffrey.blake@arm.com * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
238733Sgeoffrey.blake@arm.com * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
248733Sgeoffrey.blake@arm.com * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
258733Sgeoffrey.blake@arm.com * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
268733Sgeoffrey.blake@arm.com * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
278733Sgeoffrey.blake@arm.com *
288733Sgeoffrey.blake@arm.com * Authors: Nathan Binkert
298733Sgeoffrey.blake@arm.com *          Ron Dreslinski
308733Sgeoffrey.blake@arm.com */
318733Sgeoffrey.blake@arm.com
328733Sgeoffrey.blake@arm.com#ifndef __INTR_CONTROL_HH__
338733Sgeoffrey.blake@arm.com#define __INTR_CONTROL_HH__
348733Sgeoffrey.blake@arm.com
358733Sgeoffrey.blake@arm.com#include <vector>
368733Sgeoffrey.blake@arm.com
378733Sgeoffrey.blake@arm.com#include "base/logging.hh"
388733Sgeoffrey.blake@arm.com#include "params/IntrControl.hh"
398733Sgeoffrey.blake@arm.com#include "sim/sim_object.hh"
408733Sgeoffrey.blake@arm.com#include "sim/system.hh"
418733Sgeoffrey.blake@arm.com
428733Sgeoffrey.blake@arm.comclass IntrControl : public SimObject
43{
44  public:
45    System *sys;
46    typedef IntrControlParams Params;
47    IntrControl(const Params *p);
48
49    void clear(int cpu_id, int int_num, int index);
50    void post(int cpu_id, int int_num, int index);
51
52    void
53    clear(int int_num, int index = 0)
54    {
55        clear(0, int_num, index);
56    }
57
58    void
59    post(int int_num, int index = 0)
60    {
61        post(0, int_num, index);
62    }
63};
64
65#endif // __INTR_CONTROL_HH__
66
67
68
69
70
71
72
73