OSDN Git Service

add sh2a-fpu
[hos/hos-v4a.git] / kernel / include / arch / proc / sh / sh2a-fpu / proc.h
1 /** 
2  *  Hyper Operating System V4 Advance
3  *
4  * @file  procatr.h
5  * @brief %jp{プロセッサアーキテクチャ固有機能(SH2 processor)}
6  *
7  * Copyright (C) 1998-2006 by Project HOS
8  * http://sourceforge.jp/projects/hos/
9  */
10
11
12 #ifndef _KERNEL__arch__proc__sh__sh2a_fpu__proc_h__
13 #define _KERNEL__arch__proc__sh__sh2a_fpu__proc_h__
14
15
16 /** %jp{コンテキスト情報保存ブロック}%en{Execution context control block} */
17 typedef struct _kernel_t_ctxcb
18 {
19         VP_INT  sp;
20 } _KERNEL_T_CTXCB;
21
22 /** %jp{割込みコンテキスト制御ブロック} */
23 typedef struct _kernel_t_ictxcb
24 {
25         H       imsk;
26         B       intcnt;
27         VP      isp;
28 } _KERNEL_T_ICTXCB;
29
30
31 extern _KERNEL_T_ICTXCB _kernel_ictxcb;         /**< %jp{割込みコンテキスト制御ブロック} */
32
33
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37
38 void    _kernel_ena_int(void);                                                                                                                                          /**< %jp{割込み許可}%en{Enable interrupt} */
39 void    _kernel_dis_int(void);                                                                                                                                          /**< %jp{割込み禁止}%en{Disable interrupt} */
40 void    _kernel_wai_int(void);                                                                                                                                          /**< %jp{割込み待ち(アイドル時の処理)}%en{Wait for interrupt(sleep)} */
41                                                                                                     
42 void    _kernel_cre_ctx(_KERNEL_T_CTXCB *pk_ctxcb, VP isp, FP entry, VP_INT par1, VP_INT par2);         /**< %jp{実行コンテキストの作成}%en{Create execution context)} */
43 void    _kernel_sta_ctx(_KERNEL_T_CTXCB *pk_ctxcb);                                                                                                     /**< %jp{実行コンテキストの開始}%en{Stert context)} */
44 void    _kernel_rst_ctx(VP_INT par1, VP_INT par2, VP isp, FP entry);                                                            /**< %jp{実行コンテキストのリスタート}%en{Restert context)} */
45 void    _kernel_swi_ctx(_KERNEL_T_CTXCB *pk_ctxcb_nxt, _KERNEL_T_CTXCB *pk_ctxcb_now);                          /**< %jp{実行コンテキストの切替}%en{Switch context)} */
46
47
48 #ifdef __cplusplus
49 }
50 #endif
51
52
53
54 #define _KERNEL_INI_PRC()       do{}while(0)                                                                                                                    /**< %jp{プロセッサの初期化}%en{Initialize processor} */
55
56 #define _KERNEL_INI_INT(stksz, stk)     do { _kernel_ictxcb.isp = (VB *)(stk) + (stksz); } while (0)
57 #define _KERNEL_ENA_INT()                       _kernel_ena_int()                                                                                               /**< %jp{割込み許可}%en{Enable interrupt} */
58 #define _KERNEL_DIS_INT()                       _kernel_dis_int()                                                                                               /**< %jp{割込み禁止}%en{Disable interrupt} */
59 #define _KERNEL_WAI_INT()                       _kernel_wai_int()                                                                                               /**< %jp{割込み待ち(アイドル時の処理)}%en{Wait for interrupt(sleep)} */
60
61 #define _KERNEL_CRE_CTX(pk_ctxcb, stksz, stk, isp, entry, par1, par2)           \
62                                                                         _kernel_cre_ctx((pk_ctxcb), (isp), (entry), (par1), (par2))             /**< %jp{実行コンテキスト生成}%en{Create execution context)} */
63 #define _KERNEL_DEL_CTX(pk_ctxcb)       _kernel_del_ctx(pk_ctxcb)
64 #define _KERNEL_RST_CTX(pk_ctxcb, stksz, stk, isp, entry, par1, par2)           \
65                                                                         _kernel_rst_ctx((par1), (par2), (isp), (entry))                                 /**< %jp{実行コンテキストリスタート}%en{Restert context)} */
66 #define _KERNEL_STA_CTX(pk_ctxcb)       _kernel_sta_ctx(pk_ctxcb)
67 #define _KERNEL_SWI_CTX(pk_ctxcb_now, pk_ctxcb_nxt)                                                     \
68                                                                         _kernel_swi_ctx((pk_ctxcb_nxt), (pk_ctxcb_now))                                 /**< %jp{コンテキストのスイッチ}%en{Switch context)} */
69
70
71
72
73 #endif  /* _KERNEL__arch__proc__sh__sh2a_fpu__proc_h__ */
74
75
76
77 /* end of file */