/* * Handles a ^Break state * * Actions: * 1) clear the ^Break flag * 2) clear the STDIN stream * 3) decrease the InDOS flag as the kernel drops back to user space * 4) invoke INT-23 and never come back */ void handle_break(void) { mod_cso(CTL_C); CB_FLG &= ~CB_MSK; /* reset the ^Break flag */ KbdFlush(); /* Er, this is con_flush() */ if (!ErrorMode) /* within int21_handler, InDOS is not incremented */ if (InDOS) --InDOS; /* fail-safe */ spawn_int23(); /* invoke user INT-23 and never come back */ }
void handle_break(struct dhdr FAR **pdev, int sft_out) { char *buf = "^C\r\n"; CB_FLG &= ~CB_MSK; /* reset the ^Break flag */ con_flush(pdev); if (sft_out == -1) cooked_write(pdev, 4, buf); else DosRWSft(sft_out, 4, buf, XFR_FORCE_WRITE); if (!ErrorMode) /* within int21_handler, InDOS is not incremented */ if (InDOS) --InDOS; /* fail-safe */ spawn_int23(); /* invoke user INT-23 and never come back */ }