📄 exception_handler.h
字号:
/**
* Copyright (c) 2005 Zhejiang University, P.R.China
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
///==================================================
/**
* @file Exception_Handler.h
* @brief
* @author Chenfeng Zhou <ini_autumn@163.com>
*
* Created : <2005-03-07 19:50:41 by Cheney Chow>
* Last update: <2005-03-07 19:58:23 by Cheney Chow>
*
* $Id: Exception_Handler.h,v 1.1 2005/06/16 06:01:45 qilj Exp $
*/
///==================================================
#ifndef _PPC_EXCEPTION_HANDLER_H_
#define _PPC_EXCEPTION_HANDLER_H_
#include "Core/Global.h"
#include "Reg_Utils.h"
namespace PPC
{
class Exception_Handler
{
protected:
Exception_Handler () {}
virtual ~Exception_Handler () {}
public:
virtual void handle (Core::u32 flag = 0, Core::u32 a = 0) = 0;
protected:
//! For PPC44x, it seems more flexible coz the interupt offset can be
//! caculated dynamically;
//!
//! interrupt vector address,
//! which is specific to the interrupt type, and is determined as follows:
//! IVPR0:15 || IVORn16:27 || 0b0000
static Core::u32 gen_interupt_vec (Core::u32 ivor_n)
{
return (REG_TO_INT(REG(IVPR)) & 0xffff0000) | (ivor_n & 0xfff0);
}
};
class DSI_Handler : public Exception_Handler
{
public:
virtual ~DSI_Handler () {}
virtual void handle(Core::u32 flag = 0, Core::u32 a = 0);
};
class ISI_Handler : public Exception_Handler
{
public:
virtual ~ISI_Handler () {}
virtual void handle(Core::u32 flag = 0, Core::u32 a = 0);
};
class DEC_Handler : public Exception_Handler
{
public:
virtual ~DEC_Handler () {}
virtual void handle(Core::u32 flag = 0, Core::u32 a = 0);
};
class EXT_INT_Handler : public Exception_Handler
{
public:
virtual ~EXT_INT_Handler () {}
virtual void handle(Core::u32 flag = 0, Core::u32 a = 0);
};
class SC_Handler : public Exception_Handler
{
public:
virtual ~SC_Handler () {}
virtual void handle(Core::u32 flag = 0, Core::u32 a = 0);
};
class NO_FPU_Handler : public Exception_Handler
{
public:
virtual ~NO_FPU_Handler () {}
virtual void handle(Core::u32 flag = 0, Core::u32 a = 0);
};
class PROGRAM_Handler : public Exception_Handler
{
public:
virtual ~PROGRAM_Handler () {}
virtual void handle(Core::u32 flag = 0, Core::u32 a = 0);
};
class FLOAT_ASSIT_Handler : public Exception_Handler
{
public:
virtual ~FLOAT_ASSIT_Handler () {}
virtual void handle(Core::u32 flag = 0, Core::u32 a = 0);
};
class MACHINE_CHECK_Handler : public Exception_Handler
{
public:
virtual ~MACHINE_CHECK_Handler () {}
virtual void handle(Core::u32 flag = 0, Core::u32 a = 0);
};
class TRACE_Handler : public Exception_Handler
{
public:
virtual ~TRACE_Handler () {}
virtual void handle(Core::u32 flag = 0, Core::u32 a = 0);
};
class INSTR_TLB_Handler : public Exception_Handler
{
public:
virtual ~INSTR_TLB_Handler () {}
virtual void handle(Core::u32 flag = 0, Core::u32 a = 0);
};
class DATA_TLB_Handler : public Exception_Handler
{
public:
virtual ~DATA_TLB_Handler () {}
virtual void handle(Core::u32 flag = 0, Core::u32 a = 0);
};
} // namespace PPC
#endif // _PPC_EXCEPTION_HANDLER_H_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -