aboutsummaryrefslogtreecommitdiffstats
path: root/src/msdos.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/msdos.c')
-rw-r--r--src/msdos.c35
1 files changed, 26 insertions, 9 deletions
diff --git a/src/msdos.c b/src/msdos.c
index a557a988d1d..6875f87b90f 100644
--- a/src/msdos.c
+++ b/src/msdos.c
@@ -1272,11 +1272,13 @@ dos_set_keyboard (code, always)
1272 int always; 1272 int always;
1273{ 1273{
1274 int i; 1274 int i;
1275 union REGS regs; 1275 _go32_dpmi_registers regs;
1276 1276
1277 /* See if Keyb.Com is installed (for international keyboard support). */ 1277 /* See if Keyb.Com is installed (for international keyboard support).
1278 Note: calling Int 2Fh via int86 wedges the DOS box on some versions
1279 of Windows 9X! So don't do that! */
1278 regs.x.ax = 0xad80; 1280 regs.x.ax = 0xad80;
1279 int86 (0x2f, &regs, &regs); 1281 _go32_dpmi_simulate_int (0x2f, &regs);
1280 if (regs.h.al == 0xff) 1282 if (regs.h.al == 0xff)
1281 international_keyboard = 1; 1283 international_keyboard = 1;
1282 1284
@@ -3421,6 +3423,25 @@ sigblock (mask) int mask; { return 0; }
3421 && (long)(time).tv_usec <= 0)) 3423 && (long)(time).tv_usec <= 0))
3422#endif 3424#endif
3423 3425
3426/* This yields the rest of the current time slice to the task manager.
3427 It should be called by any code which knows that it has nothing
3428 useful to do except idle.
3429
3430 I don't use __dpmi_yield here, since versions of library before 2.02
3431 called Int 2Fh/AX=1680h there in a way that would wedge the DOS box
3432 on some versions of Windows 9X. */
3433
3434void
3435dos_yield_time_slice (void)
3436{
3437 _go32_dpmi_registers r;
3438
3439 r.x.ax = 0x1680;
3440 r.x.ss = r.x.sp = r.x.flags = 0;
3441 _go32_dpmi_simulate_int (0x2f, &r);
3442 if (r.h.al == 0x80)
3443 errno = ENOSYS;
3444}
3424 3445
3425/* Only event queue is checked. */ 3446/* Only event queue is checked. */
3426/* We don't have to call timer_check here 3447/* We don't have to call timer_check here
@@ -3454,9 +3475,7 @@ sys_select (nfds, rfds, wfds, efds, timeout)
3454 { 3475 {
3455 while (!detect_input_pending ()) 3476 while (!detect_input_pending ())
3456 { 3477 {
3457#if __DJGPP__ >= 2 3478 dos_yield_time_slice ();
3458 __dpmi_yield ();
3459#endif
3460 } 3479 }
3461 } 3480 }
3462 else 3481 else
@@ -3482,9 +3501,7 @@ sys_select (nfds, rfds, wfds, efds, timeout)
3482 if (EMACS_TIME_ZERO_OR_NEG_P (*timeout)) 3501 if (EMACS_TIME_ZERO_OR_NEG_P (*timeout))
3483 return 0; 3502 return 0;
3484 cllast = clnow; 3503 cllast = clnow;
3485#if __DJGPP__ >= 2 3504 dos_yield_time_slice ();
3486 __dpmi_yield ();
3487#endif
3488 } 3505 }
3489 } 3506 }
3490 3507