2 * Hyper Operating System V4 Advance
5 * @brief %jp{コンテキスト制御}%en{context control}
7 * Copyright (C) 1998-2014 by Project HOS
8 * http://sourceforge.jp/projects/hos/
12 #ifndef _KERNEL__arch__proc__arm__arm_v7a__proc_h__
13 #define _KERNEL__arch__proc__arm__arm_v7a__proc_h__
17 #define _KERNEL_IMSK_F 0x40 /**< %jp{FIQ割込みマスクビット} */
18 #define _KERNEL_IMSK_I 0x80 /**< %jp{IRQ割込みマスクビット} */
20 #define _KERNEL_IMSK_LV0 0xc0 /**< %jp{割込みマスクレベル0(すべてマスク)} */
21 #define _KERNEL_IMSK_LV1 0x80 /**< %jp{割込みマスクレベル1(FIQのみ許可)} */
22 #define _KERNEL_IMSK_LV2 0x00 /**< %jp{割込みマスクレベル2(すべて許可)} */
26 /** %jp{コンテキスト制御ブロック} */
27 typedef struct _kernel_t_ctxcb
32 /** %jp{割込みコンテキスト制御ブロック} */
33 typedef struct _kernel_t_ictxcb
41 extern _KERNEL_T_ICTXCB _kernel_ictxcb; /**< %jp{割込みコンテキスト制御ブロック} */
49 void _kernel_ena_int(void); /**< %jp{割込み許可} */
50 void _kernel_dis_int(void); /**< %jp{割込み禁止} */
51 void _kernel_wai_int(void); /**< %jp{割込み待ち(アイドル時の処理)} */
53 void _kernel_cre_ctx(_KERNEL_T_CTXCB *pk_ctxcb, VP isp, FP entry, VP_INT par1, VP_INT par2); /**< %jp{実行コンテキストの作成} */
54 void _kernel_rst_ctx(VP_INT par1, VP_INT par2, FP entry, VP isp); /**< %jp{実行コンテキストのリスタート} */
55 void _kernel_sta_ctx(_KERNEL_T_CTXCB *pk_ctxcb); /**< %jp{実行コンテキストの開始} */
56 void _kernel_swi_ctx(_KERNEL_T_CTXCB *pk_ctxinf_nxt, _KERNEL_T_CTXCB *pk_ctxcb_now); /**< %jp{実行コンテキストの切替} */
64 #define _KERNEL_INI_PRC() do {} while (0) /**< %jp{プロセッサ固有の初期化} */
66 #define _KERNEL_INI_INT(stksz, stk) do { _kernel_ictxcb.isp = (VB *)(stk) + (stksz); } while (0) /**< %jp{割込み初期化} */
67 #define _KERNEL_ENA_INT() _kernel_ena_int() /**< %jp{割込み許可} */
68 #define _KERNEL_DIS_INT() _kernel_dis_int() /**< %jp{割込み禁止} */
69 #define _KERNEL_WAI_INT() _kernel_wai_int() /**< %jp{割込み待ち(アイドル時の処理)} */
71 #define _KERNEL_CRE_CTX(pk_ctxcb, stksz, stk, isp, entry, exinf1, exinf2) \
72 _kernel_cre_ctx((pk_ctxcb), (isp), (entry), (exinf1), (exinf2)) /**< %jp{実行コンテキストの作成} */
73 #define _KERNEL_DEL_CTX(pk_ctxcb) do {} while (0) /**< %jp{実行コンテキストの削除} */
74 #define _KERNEL_RST_CTX(pk_ctxcb, stksz, stk, isp, entry, exinf1, exinf2) \
75 _kernel_rst_ctx((exinf1), (exinf2), (entry), (isp)) /**< %jp{実行コンテキストのリスタート} */
76 #define _KERNEL_STA_CTX(pk_ctxcb) _kernel_sta_ctx(pk_ctxcb)
77 #define _KERNEL_SWI_CTX(pk_ctxcb_now, pk_ctxinf_nxt) \
78 _kernel_swi_ctx((pk_ctxinf_nxt), (pk_ctxcb_now)) /**< %jp{実行コンテキストの切替} */
81 #endif /* _KERNEL__arch__proc__arm__arm_v7a__proc_h__ */