/*
 *  TOPPERS/SSP Kernel
 *      Smallest Set Profile Kernel
 *
 *  Copyright (C) 2008 by Witz Corporation, JAPAN
 *  Copyright (C) 2010,2011 by Naoki Saito
 *             Nagoya Municipal Industrial Research Institute, JAPAN
 * 
 *  上記著作権者は，以下の (1)〜(4) の条件を満たす場合に限り，本ソフトウェ
 *  ア（本ソフトウェアを改変したものを含む．以下同じ）を使用・複製・改変・
 *  再配布（以下，利用と呼ぶ）することを無償で許諾する．
 *  (1) 本ソフトウェアをソースコードの形で利用する場合には，上記の著作権
 *      表示，この利用条件および下記の無保証規定が，そのままの形でソース
 *      コード中に含まれていること．
 *  (2) 本ソフトウェアを，ライブラリ形式など，他のソフトウェア開発に使用
 *      できる形で再配布する場合には，再配布に伴うドキュメント（利用者マ
 *      ニュアルなど）に，上記の著作権表示，この利用条件および下記の無保
 *      証規定を掲載すること．
 *  (3) 本ソフトウェアを，機器に組み込むなど，他のソフトウェア開発に使用
 *      できない形で再配布する場合には，次のいずれかの条件を満たすこと．
 *    (a) 再配布に伴うドキュメント（利用者マニュアルなど）に，上記の著作
 *        権表示，この利用条件および下記の無保証規定を掲載すること．
 *    (b) 再配布の形態を，別に定める方法によって，TOPPERSプロジェクトに報
 *        告すること．
 *  (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損害
 *      からも，上記著作権者およびTOPPERSプロジェクトを免責すること．また，
 *      本ソフトウェアのユーザまたはエンドユーザからのいかなる理由に基づ
 *      く請求からも，上記著作権者およびTOPPERSプロジェクトを免責すること．
 * 
 *  本ソフトウェアは，無保証で提供されているものである．上記著作権者およ
 *  びTOPPERSプロジェクトは，本ソフトウェアに関して，特定の使用目的に対す
 *  る適合性も含めて，いかなる保証も行わない．また，本ソフトウェアの利用
 *  により直接的または間接的に生じたいかなる損害に関しても，その責任を負
 *  わない．
 * 
 */

/*
 *		プロセッサ依存モジュール（M32C/87用）
 *
 *  このインクルードファイルは，target_config.h（または，そこからインク
 *  ルードされるファイル）のみからインクルードされる．他のファイルから
 *  直接インクルードしてはならない．
 */


#ifndef TOPPERS_M32C87_CONFIG_H
#define TOPPERS_M32C87_CONFIG_H


/*
 *  割込み番号の最大値
 */
#define INTNO_MAX	UINT_C(64)

/*
 *  割込み制御レジスタテーブル
 */

#define INTC_TABLE_DATA														\
	/* 0- */																\
	(volatile uint8_t *)NULL ,		/* BRK命令 */												\
	(volatile uint8_t *)NULL ,		/* Reserved */												\
	(volatile uint8_t *)NULL ,		/* Reserved */												\
	(volatile uint8_t *)NULL ,		/* Reserved */												\
	(volatile uint8_t *)NULL ,		/* Reserved */												\
	(volatile uint8_t *)NULL ,		/* Reserved */												\
	(volatile uint8_t *)NULL ,		/* Reserved */												\
	(volatile uint8_t *)NULL ,		/* Reserved */												\
	/* 8- */																\
	(volatile uint8_t *)TADR_DMO0IC ,	/* DMA0	*/													\
	(volatile uint8_t *)TADR_DMO1IC ,	/* DMA1	*/													\
	(volatile uint8_t *)TADR_DMO2IC ,	/* DMA2	*/													\
	(volatile uint8_t *)TADR_DMO3IC ,	/* DMA3	*/													\
	(volatile uint8_t *)TADR_TA0IC ,	/* タイマA0	*/												\
	(volatile uint8_t *)TADR_TA1IC ,	/* タイマA1	*/												\
	(volatile uint8_t *)TADR_TA2IC ,	/* タイマA2	*/												\
	(volatile uint8_t *)TADR_TA3IC ,	/* タイマA3	*/												\
	/* 16- */															\
	(volatile uint8_t *)TADR_TA4IC ,	/* タイマA4	*/												\
	(volatile uint8_t *)TADR_S0TIC ,	/* UART0送信 */												\
	(volatile uint8_t *)TADR_S0RIC ,	/* UART0受信 */												\
	(volatile uint8_t *)TADR_S1TIC ,	/* UART1送信 */												\
	(volatile uint8_t *)TADR_S1RIC ,	/* UART1受信 */												\
	(volatile uint8_t *)TADR_TB0IC ,	/* タイマB0	*/												\
	(volatile uint8_t *)TADR_TB1IC ,	/* タイマB1	*/												\
	(volatile uint8_t *)TADR_TB2IC ,	/* タイマB2	*/												\
	/* 23- */															\
	(volatile uint8_t *)TADR_TB3IC ,	/* タイマB3	*/												\
	(volatile uint8_t *)TADR_TB4IC ,	/* タイマB4	*/												\
	(volatile uint8_t *)TADR_INT5IC ,	/* INT5	*/													\
	(volatile uint8_t *)TADR_INT4IC ,	/* INT4	*/													\
	(volatile uint8_t *)TADR_INT3IC ,	/* INT3	*/													\
	(volatile uint8_t *)TADR_INT2IC ,	/* INT2	*/													\
	(volatile uint8_t *)TADR_INT1IC ,	/* INT1	*/													\
	(volatile uint8_t *)TADR_INT0IC ,	/* INT0	*/													\
	/* 32- */																\
	(volatile uint8_t *)TADR_TB5IC ,	/* タイマB5	*/												\
	(volatile uint8_t *)TADR_S2TIC ,	/* UART2送信 */												\
	(volatile uint8_t *)TADR_S2RIC ,	/* UART2受信 */												\
	(volatile uint8_t *)TADR_S3TIC ,	/* UART3送信 */												\
	(volatile uint8_t *)TADR_S3RIC ,	/* UART3受信 */												\
	(volatile uint8_t *)TADR_S4TIC ,	/* UART4送信 */												\
	(volatile uint8_t *)TADR_S4RIC ,	/* UART4受信 */												\
	(volatile uint8_t *)TADR_BCN2IC ,	/* バス衝突検出/スタートコンディション検出/					\
	                                 	   ストップコンディション検出(UART2)/障害エラー	*/	\
	/* 40- */																\
	(volatile uint8_t *)TADR_BCN3IC ,	/* バス衝突検出/スタートコンディション検出/					\
	                                 	   ストップコンディション検出(UART3/UART0)/障害エラー	*/	\
	(volatile uint8_t *)TADR_BCN4IC ,	/* バス衝突検出/スタートコンディション検出/					\
	                                 	   ストップコンディション検出(UART4/UART1)/障害エラー	*/	\
	(volatile uint8_t *)TADR_AD0IC ,	/* A/D変換0	*/												\
	(volatile uint8_t *)TADR_KUPIC ,	/* キー入力	*/												\
	(volatile uint8_t *)TADR_IIO0IC ,	/* インテリジェントI/O0,CAN3 */								\
	(volatile uint8_t *)TADR_IIO1IC ,	/* インテリジェントI/O1,CAN4 */								\
	(volatile uint8_t *)TADR_IIO2IC ,	/* インテリジェントI/O2,CAN6 */								\
	(volatile uint8_t *)TADR_IIO3IC ,	/* インテリジェントI/O3,CAN7 */								\
	/* 48- */																\
	(volatile uint8_t *)TADR_IIO4IC ,	/* インテリジェントI/O4	*/									\
	(volatile uint8_t *)TADR_CAN5IC ,	/* CAN5	*/													\
	(volatile uint8_t *)NULL ,       	/* Reserved */													\
	(volatile uint8_t *)NULL ,       	/* Reserved */													\
	(volatile uint8_t *)TADR_IIO8IC ,	/* インテリジェントI/O8	*/									\
	(volatile uint8_t *)TADR_IIO9IC ,	/* インテリジェントI/O9,CAN0 */								\
	(volatile uint8_t *)TADR_IIO10IC ,	/* インテリジェントI/O10,CAN1 */							\
	(volatile uint8_t *)NULL ,        	/* Reserved */													\
	/* 56- */																\
	(volatile uint8_t *)NULL ,        	/* Reserved */													\
	(volatile uint8_t *)TADR_CAN2IC , 	/* CAN2	*/													\
	(volatile uint8_t *)NULL ,        	/* Reserved */													\
	(volatile uint8_t *)NULL ,        	/* Reserved */													\
	(volatile uint8_t *)NULL ,        	/* Reserved */													\
	(volatile uint8_t *)NULL ,        	/* Reserved */													\
	(volatile uint8_t *)NULL ,        	/* Reserved */													\
	(volatile uint8_t *)NULL ,        	/* Reserved */

/*
 *  プロセッサの特殊命令のインライン関数定義
 */
#include "m32c_insn.h"


#include "prc_config.h"

#endif	/* TOPPERS_M32C87_CONFIG_H */
