interrupts.hh revision 12334
112837Sgabeblack@google.com/*
212837Sgabeblack@google.com * Copyright (c) 2011 Google
312837Sgabeblack@google.com * All rights reserved.
412837Sgabeblack@google.com *
512837Sgabeblack@google.com * Redistribution and use in source and binary forms, with or without
612837Sgabeblack@google.com * modification, are permitted provided that the following conditions are
712837Sgabeblack@google.com * met: redistributions of source code must retain the above copyright
812837Sgabeblack@google.com * notice, this list of conditions and the following disclaimer;
912837Sgabeblack@google.com * redistributions in binary form must reproduce the above copyright
1012837Sgabeblack@google.com * notice, this list of conditions and the following disclaimer in the
1112837Sgabeblack@google.com * documentation and/or other materials provided with the distribution;
1212837Sgabeblack@google.com * neither the name of the copyright holders nor the names of its
1312837Sgabeblack@google.com * contributors may be used to endorse or promote products derived from
1412837Sgabeblack@google.com * this software without specific prior written permission.
1512837Sgabeblack@google.com *
1612837Sgabeblack@google.com * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1712837Sgabeblack@google.com * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1812837Sgabeblack@google.com * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1912837Sgabeblack@google.com * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
2012837Sgabeblack@google.com * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2112837Sgabeblack@google.com * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2212837Sgabeblack@google.com * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2312837Sgabeblack@google.com * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2412837Sgabeblack@google.com * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2512837Sgabeblack@google.com * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2612837Sgabeblack@google.com * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2712837Sgabeblack@google.com *
2812837Sgabeblack@google.com * Authors: Gabe Black
2912837Sgabeblack@google.com */
3012837Sgabeblack@google.com
3112837Sgabeblack@google.com#ifndef __ARCH_POWER_INTERRUPT_HH__
3212837Sgabeblack@google.com#define __ARCH_POWER_INTERRUPT_HH__
3312837Sgabeblack@google.com
3412837Sgabeblack@google.com#include "base/logging.hh"
3512837Sgabeblack@google.com#include "params/PowerInterrupts.hh"
3613087Sgabeblack@google.com#include "sim/sim_object.hh"
3712837Sgabeblack@google.com
3812837Sgabeblack@google.comclass BaseCPU;
3912837Sgabeblack@google.comclass ThreadContext;
4012914Sgabeblack@google.com
4112914Sgabeblack@google.comnamespace PowerISA {
4212914Sgabeblack@google.com
4312914Sgabeblack@google.comclass Interrupts : public SimObject
4412914Sgabeblack@google.com{
4512914Sgabeblack@google.com  private:
4612914Sgabeblack@google.com    BaseCPU * cpu;
4712951Sgabeblack@google.com
4812951Sgabeblack@google.com  public:
4912951Sgabeblack@google.com    typedef PowerInterruptsParams Params;
5012982Sgabeblack@google.com
5112951Sgabeblack@google.com    const Params *
5212952Sgabeblack@google.com    params() const
5312952Sgabeblack@google.com    {
5412952Sgabeblack@google.com        return dynamic_cast<const Params *>(_params);
5512952Sgabeblack@google.com    }
5612952Sgabeblack@google.com
5712952Sgabeblack@google.com    Interrupts(Params * p) : SimObject(p), cpu(NULL)
5812951Sgabeblack@google.com    {}
5912951Sgabeblack@google.com
6012951Sgabeblack@google.com    void
6112837Sgabeblack@google.com    setCPU(BaseCPU * _cpu)
6212837Sgabeblack@google.com    {
6312837Sgabeblack@google.com        cpu = _cpu;
6412837Sgabeblack@google.com    }
6512837Sgabeblack@google.com
6612837Sgabeblack@google.com    void
6712837Sgabeblack@google.com    post(int int_num, int index)
6812837Sgabeblack@google.com    {
6912837Sgabeblack@google.com        panic("Interrupts::post not implemented.\n");
7012837Sgabeblack@google.com    }
7112837Sgabeblack@google.com
7212837Sgabeblack@google.com    void
7312837Sgabeblack@google.com    clear(int int_num, int index)
7412837Sgabeblack@google.com    {
7512837Sgabeblack@google.com        panic("Interrupts::clear not implemented.\n");
7612837Sgabeblack@google.com    }
7712837Sgabeblack@google.com
7812837Sgabeblack@google.com    void
7912837Sgabeblack@google.com    clearAll()
8012951Sgabeblack@google.com    {
8113091Sgabeblack@google.com        panic("Interrupts::clearAll not implemented.\n");
8213091Sgabeblack@google.com    }
8312951Sgabeblack@google.com
8412837Sgabeblack@google.com    bool
8513091Sgabeblack@google.com    checkInterrupts(ThreadContext *tc) const
8613091Sgabeblack@google.com    {
8713091Sgabeblack@google.com        panic("Interrupts::checkInterrupts not implemented.\n");
8813091Sgabeblack@google.com    }
8913091Sgabeblack@google.com
9012837Sgabeblack@google.com    Fault
9112837Sgabeblack@google.com    getInterrupt(ThreadContext *tc)
9212837Sgabeblack@google.com    {
9312837Sgabeblack@google.com        assert(checkInterrupts(tc));
9412837Sgabeblack@google.com        panic("Interrupts::getInterrupt not implemented.\n");
9512837Sgabeblack@google.com    }
9612837Sgabeblack@google.com
9712982Sgabeblack@google.com    void
9812982Sgabeblack@google.com    updateIntrInfo(ThreadContext *tc)
9912837Sgabeblack@google.com    {
10012837Sgabeblack@google.com        panic("Interrupts::updateIntrInfo not implemented.\n");
10112951Sgabeblack@google.com    }
10212837Sgabeblack@google.com};
10312837Sgabeblack@google.com
10412837Sgabeblack@google.com} // namespace PowerISA
10512837Sgabeblack@google.com
10612837Sgabeblack@google.com#endif // __ARCH_POWER_INTERRUPT_HH__
10712837Sgabeblack@google.com
10812837Sgabeblack@google.com