Beispiel #1
0
 public CyclicHandler(HNO cycno, ref T_DCYC pk_dcyc, Nucleus pNucleus)
 {
     m_CycNo = cycno;
     m_dcyc = pk_dcyc;
     m_Count = pk_dcyc.cyctim;
     m_Nucleus = pNucleus;
 }
Beispiel #2
0
        public ER def_cyc(HNO cycno, ref T_DCYC pk_dcyc)
        {
            ER Result = ER.E_NOEXS;

            if (g_Kernel == null)
                return ER.E_DLT;

            g_Kernel.LockCPU();
            try {
                Result = g_Kernel.Nucleus.DefineCyclicHandler(cycno, ref pk_dcyc);
            }
            finally {
                g_Kernel.UnlockCPU();
            }

            return Result;
        }
Beispiel #3
0
        public ER act_cyc(HNO cycno, CYCACT cycact)
        {
            CyclicHandler Cyc = null;

            ER ret = ER.E_NOEXS;

            if (g_Kernel == null)
                return ER.E_DLT;

            g_Kernel.LockCPU();
            try {
                ret = g_Kernel.Nucleus.GetCyclicHandler(cycno, ref Cyc);
                if (ret == ER.E_OK)
                    ret = Cyc.Activate(cycact);
            }
            finally {
                g_Kernel.UnlockCPU();
            }

            return ret;
        }
Beispiel #4
0
        public ER ref_cyc(ref T_RCYC pk_rcyc, HNO cycno)
        {
            CyclicHandler Cyc = null;
            ER ret = ER.E_NOEXS;

            ret = g_Kernel.Nucleus.GetCyclicHandler(cycno, ref Cyc);
            if (ret != ER.E_OK)
                return ret;

            return Cyc.ReferStatus(ref pk_rcyc);
        }
Beispiel #5
0
        public ER GetCyclicHandler(HNO cycno, ref CyclicHandler Cyc)
        {
            if (cycno >= m_CyclicHandlerTable.Count)
                return ER.E_PAR;

            Cyc = m_CyclicHandlerTable[cycno];
            if (Cyc == null)
                return ER.E_NOEXS;

            return ER.E_OK;
        }
Beispiel #6
0
        public ER DefineCyclicHandler(HNO cycno, ref T_DCYC pk_dcyc)
        {
            CyclicHandler Cyc;

            //if (pk_dcyc == null)
            //	return ER.E_PAR;

            if (cycno >= m_CyclicHandlerTable.Count)
                return ER.E_PAR;

            Cyc = m_CyclicHandlerTable[cycno];

            // 登録の場合
            if (!pk_dcyc.cycdel) {
                if (pk_dcyc.cychdr == null)
                    return ER.E_PAR;

                if (((uint)pk_dcyc.cycact & (~1u)) != 0)
                    return ER.E_PAR;

                if (pk_dcyc.cyctim <= 0)
                    return ER.E_PAR;

                if (Cyc != null) {
                    Cyc.Redefine(ref pk_dcyc);
                }
                else {
                    Cyc = new CyclicHandler(cycno, ref pk_dcyc, this);
                    m_CyclicHandlerTable[cycno] = Cyc;
                }
            }
            // 登録破棄の場合
            else {
                if (Cyc != null) {
                    //delete Cyc;
                    m_CyclicHandlerTable[cycno] = null;
                }
            }

            return ER.E_OK;
        }