OSDN Git Service

add XILINX microblaze AXI INTC
authorryuz <ryuz@users.sourceforge.jp>
Mon, 21 Feb 2011 15:25:29 +0000 (00:25 +0900)
committerryuz <ryuz@users.sourceforge.jp>
Mon, 21 Feb 2011 15:25:29 +0000 (00:25 +0900)
19 files changed:
cfgrtr/include/attisr.h
cfgrtr/source/attisr.cpp
kernel/build/mb/mb_v8/gcc/Makefile
kernel/include/arch/irc/arm/aduc7000/ircatr.h
kernel/include/arch/irc/arm/at91/ircatr.h
kernel/include/arch/irc/arm/lpc2000/ircatr.h
kernel/include/arch/irc/arm/mx1/ircatr.h
kernel/include/arch/irc/ia32/pcat/ircatr.h
kernel/include/arch/irc/mb/axi_intc/irc.h [new file with mode: 0644]
kernel/include/arch/irc/mb/axi_intc/ircatr.h [new file with mode: 0644]
kernel/include/arch/irc/mips/jelly/ircatr.h
kernel/include/arch/irc/mn103/mn103s/ircatr.h
kernel/include/arch/irc/none/ircatr.h
kernel/include/arch/irc/simple/ircatr.h
kernel/include/object/isrobj.h
kernel/source/arch/irc/mb/axi_intc/dis_int.c [new file with mode: 0644]
kernel/source/arch/irc/mb/axi_intc/ena_int.c [new file with mode: 0644]
kernel/source/arch/irc/mb/axi_intc/kexe_irc.c [new file with mode: 0644]
kernel/source/arch/irc/mb/axi_intc/kini_irc.c [new file with mode: 0644]

index 27eb85e..1491b2f 100755 (executable)
@@ -29,7 +29,8 @@ public:
 
 protected:
        int   m_iMinIntNo;      
-       int   m_iMaxIntNo;      
+       int   m_iMaxIntNo;
+       char* m_pszRegBase;
 };
 
 
index 3386bf8..0cbc7b2 100755 (executable)
@@ -29,13 +29,15 @@ CApiAttIsr::CApiAttIsr()
        m_iParamSyntax[0] = 4;          // 4つのパラメーターブロック
        m_iParams         = 1;
 
-       m_iMinIntNo =  0;       
-       m_iMaxIntNo = -1;
+       m_iMinIntNo  =  0;      
+       m_iMaxIntNo  = -1;
+       m_pszRegBase = NULL;
 }
 
 // デストラクタ
 CApiAttIsr::~CApiAttIsr()
 {
+       delete [] m_pszRegBase;
 }
 
 
@@ -110,6 +112,17 @@ int CApiAttIsr::AnalyzeApi(const char* pszApiName, const char* pszParams)
                m_iMaxIntNo = atoi(pszParams);
                return CFG_ERR_OK;
        }
+       else if ( strcmp(pszApiName, "KERNEL_IRC_REGBASE") == 0 )
+       {
+               if ( m_pszRegBase != NULL )
+               {
+                       return CFG_ERR_MULTIDEF;
+               }
+               
+               int len = strlen(pszParams);
+               m_pszRegBase = new char[len + 1];
+               strcpy(m_pszRegBase, pszParams);
+       }
 
        return CFG_ERR_NOPROC;
 }
@@ -154,8 +167,25 @@ void  CApiAttIsr::WriteCfgDef(FILE* fp)
 
        fprintf(
                        fp,
-               "const ID        _kernel_max_isrid = %d;\n",
-               m_iMaxId);
+                       "const ID        _kernel_max_isrid = %d;\n",
+                       m_iMaxId);
+
+#if _KERNEL_IRCATR_REG_BASE
+       if ( m_pszRegBase != NULL )
+       {
+               fprintf(
+                               fp,
+                               "const VP        _kernel_irc_reg_base = (VP)(%s);\n",
+                               m_pszRegBase);
+       }
+       else
+       {
+               fprintf(
+                               fp,
+                               "const VP        _kernel_irc_reg_base = (VP)(0x%x);\n",
+                               _KERNEL_IRCATR_REG_BASE_DEF);
+       }
+#endif
 }
 
 
index ff897b7..33e4cb2 100644 (file)
@@ -26,7 +26,7 @@ CMD_LIBR ?= $(GCC_ARCH)ar
 # %jp{アーキテクチャ定義}%en{architecture}
 ARCH_NAME ?= mb_v8
 ARCH_PROC ?= mb/mb_v8
-ARCH_IRC  ?= none
+ARCH_IRC  ?= mb/axi_intc
 ARCH_CC   ?= gcc
 
 
@@ -92,6 +92,10 @@ ASRCS += $(SRC_PROC_CC_DIR)/kexc_hdr.S
 
 # %jp{C言語ファイルの追加}%en{C sources}
 CSRCS += $(SRC_PROC_DIR)/val_int.c
+CSRCS += $(SRC_IRC_DIR)/kini_irc.c
+CSRCS += $(SRC_IRC_DIR)/kexe_irc.c
+CSRCS += $(SRC_IRC_DIR)/ena_int.c
+CSRCS += $(SRC_IRC_DIR)/dis_int.c
 
 
 # %jp{カーネル共通ソースの追加}%en{kernel common sources}
index cc74b00..f55fa25 100755 (executable)
@@ -15,6 +15,7 @@
 #define _KERNEL_IRCATR_INC_PATH                                "arm/aduc7000"
 
 #define _KERNEL_IRCATR_IRC                                     TRUE            /**< %jp{IRCの有無} */
+#define _KERNEL_IRCATR_REG_BASE                                FALSE           /**< %jp{IRCレジスタベースアドレスの有無} */
 
 #define _KERNEL_IRCATR_TMIN_INTNO                      0                       /**< %jp{割込み番号の最小値} */
 #define _KERNEL_IRCATR_TMAX_INTNO                      31                      /**< %jp{割込み番号の最大値} */
index 0f2cb13..6286704 100755 (executable)
@@ -16,6 +16,7 @@
 #define _KERNEL_IRCATR_INC_PATH                                "arm/at91"
 
 #define _KERNEL_IRCATR_IRC                                     TRUE            /**< %jp{IRCの有無} */
+#define _KERNEL_IRCATR_REG_BASE                                FALSE           /**< %jp{IRCレジスタベースアドレスの有無} */
 
 #define _KERNEL_IRCATR_TMIN_INTNO                      0                       /**< %jp{割込み番号の最小値} */
 #define _KERNEL_IRCATR_TMAX_INTNO                      31                      /**< %jp{割込み番号の最大値} */
index 3d5d575..a46180f 100755 (executable)
@@ -16,6 +16,7 @@
 #define _KERNEL_IRCATR_INC_PATH                                "arm/lpc2000"
 
 #define _KERNEL_IRCATR_IRC                                     TRUE            /**< %jp{IRCの有無} */
+#define _KERNEL_IRCATR_REG_BASE                                FALSE           /**< %jp{IRCレジスタベースアドレスの有無} */
 
 #define _KERNEL_IRCATR_TMIN_INTNO                      0                       /**< %jp{割込み番号の最小値} */
 #define _KERNEL_IRCATR_TMAX_INTNO                      31                      /**< %jp{割込み番号の最大値} */
index a5b2113..4e0f132 100755 (executable)
@@ -16,6 +16,7 @@
 #define _KERNEL_IRCATR_INC_PATH                                "arm/mx1"
 
 #define _KERNEL_IRCATR_IRC                                     TRUE            /**< %jp{IRCの有無} */
+#define _KERNEL_IRCATR_REG_BASE                                FALSE           /**< %jp{IRCレジスタベースアドレスの有無} */
 
 #define _KERNEL_IRCATR_TMIN_INTNO                      0                       /**< %jp{割込み番号の最小値} */
 #define _KERNEL_IRCATR_TMAX_INTNO                      63                      /**< %jp{割込み番号の最大値} */
index 798bca4..87abb19 100755 (executable)
@@ -16,6 +16,7 @@
 #define _KERNEL_IRCATR_INC_PATH                                "ia32/pcat"
 
 #define _KERNEL_IRCATR_IRC                                     TRUE            /**< %jp{IRCの有無} */
+#define _KERNEL_IRCATR_REG_BASE                                FALSE           /**< %jp{IRCレジスタベースアドレスの有無} */
 
 #define _KERNEL_IRCATR_TMIN_INTNO                      0                       /**< %jp{割込み番号の最小値} */
 #define _KERNEL_IRCATR_TMAX_INTNO                      15                      /**< %jp{割込み番号の最大値} */
diff --git a/kernel/include/arch/irc/mb/axi_intc/irc.h b/kernel/include/arch/irc/mb/axi_intc/irc.h
new file mode 100644 (file)
index 0000000..cc92ab9
--- /dev/null
@@ -0,0 +1,47 @@
+/** 
+ *  Hyper Operating System V4 Advance
+ *
+ * @file  irc.h
+ * @brief XILINX AXI INTC
+ *
+ * Copyright (C) 1998-2011 by Project HOS
+ * http://sourceforge.jp/projects/hos/
+ */
+
+
+#ifndef _KERNEL__arch__irc__xilinx_axi_intc__irc_h__
+#define _KERNEL__arch__irc__xilinx_axi_intc__irc_h__
+
+
+/* %jp{メモリマップドレジスタ定義} */
+#define _KERNEL_IRC_ISR                                        ((volatile UW *)_kernel_irc_reg_base + 0)
+#define _KERNEL_IRC_IPR                                        ((volatile UW *)_kernel_irc_reg_base + 1)
+#define _KERNEL_IRC_IER                                        ((volatile UW *)_kernel_irc_reg_base + 2)
+#define _KERNEL_IRC_IAR                                        ((volatile UW *)_kernel_irc_reg_base + 3)
+#define _KERNEL_IRC_SIE                                        ((volatile UW *)_kernel_irc_reg_base + 4)
+#define _KERNEL_IRC_CIE                                        ((volatile UW *)_kernel_irc_reg_base + 5)
+#define _KERNEL_IRC_IVR                                        ((volatile UW *)_kernel_irc_reg_base + 6)
+#define _KERNEL_IRC_MER                                        ((volatile UW *)_kernel_irc_reg_base + 7)
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void _kernel_ini_irc(void);                    /**< %jp{割込みコントローラの初期化} */
+void _kernel_exe_irc(INHNO inhno);     /**< %jp{割込み処理} */
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#define _KERNEL_INI_IRC()              _kernel_ini_irc()               /**< %jp{割込みコントローラの初期化} */
+#define _KERNEL_EXE_IRC(inhno) _kernel_exe_irc(inhno)  /**< %jp{割込み処理} */
+
+
+#endif /* _KERNEL__arch__irc__xilinx_axi_intc__irc_h__ */
+
+
+/* end of file */
+
diff --git a/kernel/include/arch/irc/mb/axi_intc/ircatr.h b/kernel/include/arch/irc/mb/axi_intc/ircatr.h
new file mode 100644 (file)
index 0000000..9831d30
--- /dev/null
@@ -0,0 +1,30 @@
+/** 
+ *  Hyper Operating System V4 Advance
+ *
+ * @file  ircatr.h
+ * @brief XILINX AXI INTC
+ *
+ * Copyright (C) 1998-2011 by Project HOS
+ * http://sourceforge.jp/projects/hos/
+ */
+
+
+#ifndef _KERNEL__arch__irc__xilinx_axi_intc__ircatr_h__
+#define _KERNEL__arch__irc__xilinx_axi_intc__ircatr_h__
+
+
+#define _KERNEL_IRCATR_INC_PATH                                "mb/axi_intc"
+
+#define _KERNEL_IRCATR_IRC                                     TRUE            /**< %jp{IRCの有無} */
+#define _KERNEL_IRCATR_REG_BASE                                TRUE            /**< %jp{IRCレジスタベースアドレスの有無} */
+#define _KERNEL_IRCATR_REG_BASE_DEF                    0x00000000      /**< %jp{デフォルトのIRCレジスタベースアドレス} */
+
+#define _KERNEL_IRCATR_TMIN_INTNO                      0                       /**< %jp{割込み番号の最小値} */
+#define _KERNEL_IRCATR_TMAX_INTNO                      31                      /**< %jp{割込み番号の最大値} */
+
+
+#endif /* _KERNEL__arch__irc__xilinx_axi_intc__ircatr_h__ */
+
+
+
+/* end of file */
index 392bff9..7dbe67e 100755 (executable)
@@ -16,6 +16,7 @@
 #define _KERNEL_IRCATR_INC_PATH                                "mips/jelly"
 
 #define _KERNEL_IRCATR_IRC                                     TRUE            /**< %jp{IRCの有無} */
+#define _KERNEL_IRCATR_REG_BASE                                FALSE           /**< %jp{IRCレジスタベースアドレスの有無} */
 
 #define _KERNEL_IRCATR_TMIN_INTNO                      0                       /**< %jp{割込み番号の最小値} */
 #define _KERNEL_IRCATR_TMAX_INTNO                      255                     /**< %jp{割込み番号の最大値} */
index e5ea49d..c6ede1f 100755 (executable)
@@ -1,3 +1,13 @@
+/** 
+ *  Hyper Operating System V4 Advance
+ *
+ * @file  ircatr.h
+ * @brief %jp{Panasonic MN103S}%en{Panasonic MN103S}
+ *
+ * Copyright (C) 1998-2011 by Project HOS
+ * http://sourceforge.jp/projects/hos/
+ */
+
 
 #ifndef _KERNEL__arch__irc__mn103s__ircatr_h__
 #define _KERNEL__arch__irc__mn103s__ircatr_h__
@@ -5,6 +15,7 @@
 #define _KERNEL_IRCATR_INC_PATH                                "mn103/mn103s"
 
 #define _KERNEL_IRCATR_IRC                                     TRUE            /**< %jp{IRCの有無} */
+#define _KERNEL_IRCATR_REG_BASE                                FALSE           /**< %jp{IRCレジスタベースアドレスの有無} */
 
 #define _KERNEL_IRCATR_TMIN_INTNO                      1                       /**< %jp{割込み番号の最小値} */
 #define _KERNEL_IRCATR_TMAX_INTNO                      30                      /**< %jp{割込み番号の最大値} */
@@ -12,3 +23,5 @@
 
 #endif /* _KERNEL__arch__irc__mn103s__ircatr_h__ */
 
+
+/* end of file */
index ac12826..9e2678d 100755 (executable)
@@ -4,7 +4,7 @@
  * @file  ircatr.h
  * @brief %jp{割込みコントローラ固有属性定義}%jp{Interrupt controler attribute}
  *
- * Copyright (C) 1998-2006 by Project HOS
+ * Copyright (C) 1998-2011 by Project HOS
  * http://sourceforge.jp/projects/hos/
  */
 
@@ -16,6 +16,7 @@
 #define _KERNEL_IRCATR_INC_PATH                                "none"
 
 #define _KERNEL_IRCATR_IRC                                     FALSE                   /**< %jp{IRCの有無} */
+#define _KERNEL_IRCATR_REG_BASE                                FALSE                   /**< %jp{IRCレジスタベースアドレスの有無} */
 
 #define _KERNEL_IRCATR_TMIN_INTNO                      0                               /**< %jp{割込みハンドラ番号の最小値} */
 #define _KERNEL_IRCATR_TMAX_INTNO                      0                               /**< %jp{割込みハンドラ番号の最大値} */
index 5fca542..c38519c 100755 (executable)
@@ -17,6 +17,7 @@
 #define _KERNEL_IRCATR_INC_PATH                "simple"
 
 #define _KERNEL_IRCATR_IRC                     TRUE                                                    /**< %jp{IRCの有無} */
+#define _KERNEL_IRCATR_REG_BASE                FALSE                                                   /**< %jp{IRCレジスタベースアドレスの有無} */
 
 #define _KERNEL_IRCATR_TMIN_INTNO      _KERNEL_PROCATR_TMIN_INHNO              /**< %jp{割込みハンドラ番号の最小値} */
 #define _KERNEL_IRCATR_TMAX_INTNO      _KERNEL_PROCATR_TMAX_INHNO              /**< %jp{割込みハンドラ番号の最大値} */
index 101a71d..a8037da 100755 (executable)
 
 struct _kernel_t_isrcb;
 
+#if _KERNEL_IRCATR_REG_BASE
+extern       VP                                        _kernel_irc_reg_base;
+#endif
+
 /* %jp{割込み情報} */
 typedef struct _kernel_t_intinf
 {
diff --git a/kernel/source/arch/irc/mb/axi_intc/dis_int.c b/kernel/source/arch/irc/mb/axi_intc/dis_int.c
new file mode 100644 (file)
index 0000000..5f590de
--- /dev/null
@@ -0,0 +1,27 @@
+/** 
+ *  Hyper Operating System V4 Advance
+ *
+ * @file  dis_int.c
+ * @brief XILINX AXI INTC
+ *
+ * Copyright (C) 1998-2011 by Project HOS
+ * http://sourceforge.jp/projects/hos/
+ */
+
+
+#include "core/core.h"
+#include "object/inhobj.h"
+#include "object/isrobj.h"
+
+
+/* 割込みの禁止 */
+ER dis_int(INTNO intno)
+{
+       *_KERNEL_IRC_CIE = (1 << intno);
+       
+       return E_OK;
+}
+
+
+
+/* end of file */
diff --git a/kernel/source/arch/irc/mb/axi_intc/ena_int.c b/kernel/source/arch/irc/mb/axi_intc/ena_int.c
new file mode 100644 (file)
index 0000000..a7d3066
--- /dev/null
@@ -0,0 +1,26 @@
+/** 
+ *  Hyper Operating System V4 Advance
+ *
+ * @file  ena_int.c
+ * @brief XILINX AXI INTC
+ *
+ * Copyright (C) 1998-2011 by Project HOS
+ * http://sourceforge.jp/projects/hos/
+ */
+
+
+#include "core/core.h"
+#include "object/inhobj.h"
+#include "object/isrobj.h"
+
+
+/* 割込みの許可 */
+ER ena_int(INTNO intno)
+{
+       *_KERNEL_IRC_SIE = (1 << intno);
+       
+       return E_OK;
+}
+
+
+/* end of file */
diff --git a/kernel/source/arch/irc/mb/axi_intc/kexe_irc.c b/kernel/source/arch/irc/mb/axi_intc/kexe_irc.c
new file mode 100644 (file)
index 0000000..3ba8210
--- /dev/null
@@ -0,0 +1,25 @@
+/** 
+ *  Hyper Operating System V4 Advance
+ *
+ * @file  kexe_int.c
+ * @brief XILINX AXI INTC
+ *
+ * Copyright (C) 1998-2011 by Project HOS
+ * http://sourceforge.jp/projects/hos/
+ */
+
+
+#include "core/core.h"
+#include "object/inhobj.h"
+#include "object/isrobj.h"
+
+
+/** %jp{割込みコントローラの割込み処理} */
+void _kernel_exe_irc(INHNO inhno)
+{
+       /* %jp{割込みサービスルーチン呼び出し} */
+       _kernel_exe_isr(*_KERNEL_IRC_IVR);
+}
+
+
+/* end of file */
diff --git a/kernel/source/arch/irc/mb/axi_intc/kini_irc.c b/kernel/source/arch/irc/mb/axi_intc/kini_irc.c
new file mode 100644 (file)
index 0000000..321a25d
--- /dev/null
@@ -0,0 +1,25 @@
+/** 
+ *  Hyper Operating System V4 Advance
+ *
+ * @file  kini_int.c
+ * @brief XILINX AXI INTC
+ *
+ * Copyright (C) 1998-2011 by Project HOS
+ * http://sourceforge.jp/projects/hos/
+ */
+
+
+#include "core/core.h"
+#include "object/inhobj.h"
+#include "object/isrobj.h"
+
+
+/** %jp{割込みコントローラの初期化} */
+void _kernel_ini_irc(void)
+{
+       *_KERNEL_IRC_CIE = 0xffffffff;
+       *_KERNEL_IRC_MER = 0x00000003;
+}
+
+
+/* end of file */