OSDN Git Service

(none)
authorryuz <ryuz>
Sun, 26 Nov 2006 08:57:25 +0000 (08:57 +0000)
committerryuz <ryuz>
Sun, 26 Nov 2006 08:57:25 +0000 (08:57 +0000)
cfgrtr/include/dpcque.h [new file with mode: 0755]
cfgrtr/source/dpcque.cpp [new file with mode: 0755]

diff --git a/cfgrtr/include/dpcque.h b/cfgrtr/include/dpcque.h
new file mode 100755 (executable)
index 0000000..65d7c38
--- /dev/null
@@ -0,0 +1,33 @@
+// ---------------------------------------------------------------------------
+//  Hyper Operating System V4 Advance コンフィギュレーター                           
+//    KERNEL_DPC_QUE API の処理                                                    
+//                                                                            
+//                                    Copyright (C) 1998-2002 by Project HOS  
+//                                    http://sourceforge.jp/projects/hos/     
+// ---------------------------------------------------------------------------
+
+
+#ifndef __HOSV4CFG_DpcQue_h__
+#define __HOSV4CFG_DpcQue_h__
+
+
+#include "apidef.h"
+#include "parpack.h"
+
+
+// HOS_KERNEL_HEAP 用
+class CApiDpcQue : public CApiDef
+{
+public:
+       CApiDpcQue();           // コンストラクタ
+       ~CApiDpcQue();          // デストラクタ
+
+       int   AnalyzeApi(const char* pszApiName, const char* pszParams);        // APIの解析
+       int   AutoId(void);
+       void  WriteCfgDef(FILE* fp);            // cfgファイル定義部書き出し
+       void  WriteCfgIni(FILE* fp);
+};
+
+
+#endif // __HOSV4CFG_IdleStack_h__
+
diff --git a/cfgrtr/source/dpcque.cpp b/cfgrtr/source/dpcque.cpp
new file mode 100755 (executable)
index 0000000..ee90ead
--- /dev/null
@@ -0,0 +1,132 @@
+// ---------------------------------------------------------------------------
+//  Hyper Operating System V4 Advance コンフィギュレーター                           
+//    KERNEL_DPC_QUE API の処理                                                  
+//                                                                            
+//                                    Copyright (C) 1998-2006 by Project HOS  
+//                                    http://sourceforge.jp/projects/hos/     
+// ---------------------------------------------------------------------------
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "defercd.h"
+#include "dpcque.h"
+#include "analyze.h"
+#include "readcfg.h"
+
+
+#define DPCQUE_QUECNT          0
+#define DPCQUE_QUE                     1
+
+
+// コンストラクタ
+CApiDpcQue::CApiDpcQue()
+{
+       // パラメーター構文設定
+       m_iParamSyntax[0] = 0;          // 単独パラメーター
+       m_iParams = 2;
+}
+
+
+// デストラクタ
+CApiDpcQue::~CApiDpcQue()
+{
+}
+
+
+// 自動ID番号割り当て
+int CApiDpcQue::AutoId(void)
+{
+       return CFG_ERR_OK;
+}
+
+
+// APIの解析
+int CApiDpcQue::AnalyzeApi(const char* pszApiName, const char* pszParams)
+{
+       if ( strcmp(pszApiName, "KERNEL_DPC_QUE") == 0 )
+       {
+               if ( m_iObjs > 0 )
+               {
+                       return CFG_ERR_MULTIDEF;
+               }
+
+               return AddParams(pszParams);
+       }
+
+       return CFG_ERR_NOPROC;
+}
+
+
+// cfgファイル定義部書き出し
+void  CApiDpcQue::WriteCfgDef(FILE* fp)
+{
+       const char* pszQue;
+       const char* pszQueCnt;
+
+       // コメント出力
+       fputs(
+               "\n\n\n"
+               "/* ------------------------------------------ */\n"
+               "/*                 DPC queue                  */\n"
+               "/* ------------------------------------------ */\n\n"
+               , fp);
+
+       // パラメータ読み出し
+       if ( m_iObjs > 0 )
+       {
+               pszQueCnt = m_pParamPacks[0]->GetParam(DPCQUE_QUECNT);
+               pszQue    = m_pParamPacks[0]->GetParam(DPCQUE_QUE);
+       }
+       else
+       {
+               pszQueCnt = "32";               // 指定が無ければデフォルトサイズ
+               pszQue    = "NULL";             // 指定が無ければNULL(自動生成)
+       }
+
+       if ( strcmp(pszQue, "NULL") == 0 )
+       {
+               fprintf(
+                       fp,
+                       "VP_INT _kernel_dpc_queblk[(%s)];\n\n",
+                       pszQueCnt);
+       }
+}
+
+
+// cfgファイル起動部書き出し
+void  CApiDpcQue::WriteCfgIni(FILE* fp)
+{
+       const char* pszQue;
+       const char* pszQueCnt;
+
+       // パラメータ読み出し
+       if ( m_iObjs > 0 )
+       {
+               pszQueCnt = m_pParamPacks[0]->GetParam(DPCQUE_QUECNT);
+               pszQue    = m_pParamPacks[0]->GetParam(DPCQUE_QUE);
+       }
+       else
+       {
+               pszQueCnt = "32";               // 指定が無ければデフォルトサイズ
+               pszQue    = "NULL";             // 指定が無ければNULL(自動生成)
+       }
+       
+       if ( strcmp(pszQue, "NULL") == 0 )
+       {
+               fprintf(
+                       fp,
+                       "\n\t_KERNEL_SYS_INI_DPC((VP)(_kernel_dpc_queblk), (UINT)sizeof(_kernel_dpc_queblk) / szieof(VP_INT));\n");
+       }
+       else
+       {
+               fprintf(
+                       fp,
+                       "\n\t_KERNEL_SYS_INI_DPC((VP)(%s), (UINT)(%s));\n",
+                       pszQue, pszQueCnt);
+       }
+}
+
+
+// end of file