1 // ---------------------------------------------------------------------------
2 // Hyper Operating System V4 コンフィギュレーター
5 // Copyright (C) 1998-2010 by Project HOS
6 // http://sourceforge.jp/projects/hos/
7 // ---------------------------------------------------------------------------
19 #define INTSTK_STKSZ 0
24 CApiIntStack::CApiIntStack()
27 m_iParamSyntax[0] = 0; // 単独パラメーター
31 m_szStackPointer[0] = '\0';
36 CApiIntStack::~CApiIntStack()
42 int CApiIntStack::AutoId(void)
49 int CApiIntStack::AnalyzeApi(const char* pszApiName, const char* pszParams)
51 if ( strcmp(pszApiName, "KERNEL_INT_STK") == 0 )
55 return CFG_ERR_MULTIDEF;
58 if ( m_szStackPointer[0] != '\0' )
60 return CFG_ERR_DEF_CONFLICT;
63 return AddParams(pszParams);
66 return CFG_ERR_NOPROC;
71 void CApiIntStack::WriteCfgDef(FILE* fp)
84 pszSize = m_pParamPacks[0]->GetParam(INTSTK_STKSZ);
85 pszStack = m_pParamPacks[0]->GetParam(INTSTK_STK);
92 "/* ------------------------------------------ */\n"
93 "/* interrupt stack */\n"
94 "/* ------------------------------------------ */\n\n"
97 if ( strcmp(pszStack, "NULL") == 0 )
101 "VP _kernel_int_stkblk[((%s) + sizeof(VP) - 1) / sizeof(VP)];\n"
102 "const VP _kernel_int_isp = &_kernel_int_stkblk[((%s) + sizeof(VP) - 1) / sizeof(VP)];\n",
109 "const VP _kernel_int_isp = (VP)((VB *)(%s) + (SIZE)(%s));\n",
117 void CApiIntStack::WriteCfgIni(FILE* fp)
120 const char* pszStack;
130 pszSize = m_pParamPacks[0]->GetParam(INTSTK_STKSZ);
131 pszStack = m_pParamPacks[0]->GetParam(INTSTK_STK);
135 if ( strcmp(pszStack, "NULL") == 0 )
139 "\t_KERNEL_SYS_INI_INTSTK((SIZE)sizeof(_kernel_int_stkblk), (VP)(_kernel_int_stkblk));\n");
145 "\t_KERNEL_SYS_INI_INTSTK((SIZE)(%s), (VP)(%s));\n",
152 // ---------------------------------------------------------------------------
154 // ---------------------------------------------------------------------------