📄 ioc.c
字号:
/* DESCRIPTION *//* *//* This function deletes an I/O driver and removes it from the list *//* of created drivers. Note that this function does not actually *//* invoke the driver. *//* *//* CALLED BY *//* *//* Application *//* IOCE_Delete_Driver Error checking shell *//* *//* CALLS *//* *//* CSC_Remove_From_List Remove node from list *//* [HIC_Make_History_Entry] Make entry in history log *//* [TCT_Check_Stack] Stack checking function *//* TCT_Protect Protect created list *//* TCT_Unprotect Release protection *//* *//* INPUTS *//* *//* driver Driver control block pointer *//* *//* OUTPUTS *//* *//* NU_SUCCESS *//* *//* HISTORY *//* *//* DATE REMARKS *//* *//* 03-01-1993 Created initial version 1.0 *//* 04-19-1993 Verified version 1.0 *//* *//*************************************************************************/STATUS IOC_Delete_Driver(NU_DRIVER *driver){NU_SUPERV_USER_VARIABLES /* Switch to supervisor mode */ NU_SUPERVISOR_MODE();#ifdef NU_ENABLE_STACK_CHECK /* Call stack checking function to check for an overflow condition. */ TCT_Check_Stack();#endif#ifdef NU_ENABLE_HISTORY /* Make an entry that corresponds to this function in the system history log. */ HIC_Make_History_Entry(NU_DELETE_DRIVER_ID, (UNSIGNED) driver , (UNSIGNED) 0, (UNSIGNED) 0);#endif /* Protect against access to the list of created I/O drivers. */ TCT_Protect(&IOD_List_Protect);#ifdef INCLUDE_PROVIEW _RTProf_DumpDriver(RT_PROF_DELETE_DRIVER, driver, RT_PROF_OK);#endif /*INCLUDE_PROVIEW*/ /* Set the driver ID to 0. */ driver -> nu_driver_id = 0; /* Remove the driver from the list of created I/O drivers. */ CSC_Remove_From_List(&IOD_Created_Drivers_List, (CS_NODE *) driver); /* Decrement the total number of created I/O drivers. */ IOD_Total_Drivers--; /* Release protection against access to the list of created I/O drivers. */ TCT_Unprotect(); /* Return to user mode */ NU_USER_MODE(); /* Return a successful completion. */ return(NU_SUCCESS);}/*************************************************************************//* *//* FUNCTION *//* *//* IOC_Request_Driver *//* *//* DESCRIPTION *//* *//* This function sends a user request to the specified I/O driver. *//* *//* CALLED BY *//* *//* Application *//* IOCE_Request_Driver Error checking shell *//* *//* CALLS *//* *//* [HIC_Make_History_Entry] Make entry in history log *//* [TCT_Check_Stack] Stack checking function *//* *//* INPUTS *//* *//* driver Driver control block pointer *//* request User's I/O request *//* *//* OUTPUTS *//* *//* NU_SUCCESS If service is successful *//* *//* HISTORY *//* *//* DATE REMARKS *//* *//* 03-01-1993 Created initial version 1.0 *//* 04-19-1993 Verified version 1.0 *//* *//*************************************************************************/STATUS IOC_Request_Driver(NU_DRIVER *driver , NU_DRIVER_REQUEST *request){NU_SUPERV_USER_VARIABLES /* Switch to supervisor mode */ NU_SUPERVISOR_MODE();#ifdef NU_ENABLE_STACK_CHECK /* Call stack checking function to check for an overflow condition. */ TCT_Check_Stack();#endif#ifdef NU_ENABLE_HISTORY /* Make an entry that corresponds to this function in the system history log. */ HIC_Make_History_Entry(NU_REQUEST_DRIVER_ID, (UNSIGNED) driver, (UNSIGNED) request, (UNSIGNED) 0);#endif#ifdef INCLUDE_PROVIEW _RTProf_DumpDriver(RT_PROF_REQUEST_DRIVER, driver, RT_PROF_OK);#endif /*INCLUDE_PROVIEW*/ /* Call the specified I/O Driver. */ (*(driver -> nu_driver_entry)) (driver, request); /* Return to user mode */ NU_USER_MODE(); /* Return the completion status. */ return(NU_SUCCESS);}/*************************************************************************//* *//* FUNCTION *//* *//* IOC_Resume_Driver *//* *//* DESCRIPTION *//* *//* This function resumes a task previously suspended inside of an *//* I/O driver. Typically, this function is called from within an *//* I/O driver. *//* *//* CALLED BY *//* *//* Application *//* IOCE_Resume_Driver Error checking shell *//* *//* CALLS *//* *//* [HIC_Make_History_Entry] Make entry in history log *//* TCC_Resume_Task Resume a suspended task *//* TCT_Control_To_System Transfer control to higher *//* priority task *//* [TCT_Check_Stack] Stack checking function *//* TCT_Get_Current_Protect Pickup current protection *//* TCT_Set_Current_Protect Set current protection *//* TCT_System_Protect Protect against system access*//* TCT_System_Unprotect Release system protection *//* TCT_Unprotect Release system protection *//* TCT_Unprotect_Specific Release specific protection *//* *//* INPUTS *//* *//* task Pointer of task to resume *//* *//* OUTPUTS *//* *//* NU_SUCCESS If service is successful *//* *//* HISTORY *//* *//* DATE REMARKS *//* *//* 03-01-1993 Created initial version 1.0 *//* 04-19-1993 Verified version 1.0 */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -