diff options
| author | Eli Zaretskii | 1998-06-14 16:19:33 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 1998-06-14 16:19:33 +0000 |
| commit | 9a69bda1ebc8bfed11e047e7bb67ebec58d2486d (patch) | |
| tree | cd8832e9cf807591e9d6a0bc905576b1e87ad2ed /src/msdos.c | |
| parent | 106a57a4cc6d51bb25f3163831a31dedc45f96e5 (diff) | |
| download | emacs-9a69bda1ebc8bfed11e047e7bb67ebec58d2486d.tar.gz emacs-9a69bda1ebc8bfed11e047e7bb67ebec58d2486d.zip | |
(dos_set_keyboard): Call Int 2Fh via the DPMI server, not directly.
(dos_yield_time_slice): New function.
(sys_select): Use it instead of __dpmi_yield.
Diffstat (limited to 'src/msdos.c')
| -rw-r--r-- | src/msdos.c | 35 |
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, ®s, ®s); | 1281 | _go32_dpmi_simulate_int (0x2f, ®s); |
| 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 | |||
| 3434 | void | ||
| 3435 | dos_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 | ||