void __grab_int_ctrl_break( void ) { if( __old_int_ctrl_break == 0 ) { #if defined(__WINDOWS_386__) __old_int_ctrl_break = _dos_getvect( CTRL_BRK_VEC ); TinySetVect( CTRL_BRK_VEC, (void (_WCNEAR *)(void))__int_ctrl_break_handler ); #elif defined( __386__ ) if( _IsPharLap() ) { __old_int_ctrl_break = pharlap_rm_getvect( CTRL_BRK_VEC ); __old_pm_int_ctrl_break = pharlap_pm_getvect( CTRL_BRK_VEC ); pharlap_setvect( CTRL_BRK_VEC, (pfun) (void (_WCNEAR *)(void))__int_ctrl_break_handler ); } else if( __DPMI_hosted() == 1 ) { DPMILockLinearRegion((long)__int_ctrl_break_handler, ((long)__restore_int23 - (long)__int_ctrl_break_handler)); __old_int_ctrl_break = DPMIGetRealModeInterruptVector( CTRL_BRK_VEC ); __old_pm_int_ctrl_break = DPMIGetPMInterruptVector( CTRL_BRK_VEC ); DPMISetPMInterruptVector( CTRL_BRK_VEC, __int_ctrl_break_handler ); } else { /* what it used to do */ __old_int_ctrl_break = _dos_getvect( CTRL_BRK_VEC ); _dos_setvect( CTRL_BRK_VEC, __int_ctrl_break_handler ); } #else __old_int_ctrl_break = _dos_getvect( CTRL_BRK_VEC ); _dos_setvect( CTRL_BRK_VEC, __int_ctrl_break_handler ); #endif if( __int23_exit == __null_int23_exit ) { __int23_exit = __restore_int_ctrl_break; } else if( __int23_exit == __restore_int23 ) { __int23_exit = __restore_int; } } }
void __GrabFP87( void ) { #ifndef __WINDOWS__ if( _RWD_FPE_handler_exit != __Fini_FPE_handler ) { #ifdef __DOS_386__ if( !_IsPharLap() && ( __DPMI_hosted() == 1 )) { DPMILockLinearRegion((long)&__FPEHandlerStart_, ((long)&__FPEHandlerEnd_ - (long)&__FPEHandlerStart_)); } #endif __Init_FPE_handler(); _RWD_FPE_handler_exit = __Fini_FPE_handler; } #endif }
void __CommonInit( void ) /**************************/ { #if defined(__DOS_386__) && !defined(__OSI__) /* * If we are running under DOS/4G then we need to page lock interrupt * handlers (since we could be running under VMM). */ if (!_IsPharLap() && (__DPMI_hosted() == 1)) { DPMILockLinearRegion((long)&__GETDSStart_, ((long)&__GETDSEnd_ - (long)&__GETDSStart_)); } #endif }