diff options
Diffstat (limited to 'boot/boot.c')
-rw-r--r-- | boot/boot.c | 122 |
1 files changed, 0 insertions, 122 deletions
diff --git a/boot/boot.c b/boot/boot.c index 522fedff..d3f62339 100644 --- a/boot/boot.c +++ b/boot/boot.c @@ -985,128 +985,6 @@ bootstrap_compat(in, out) reply->RetCode = MIG_NO_REPLY; } -#ifdef notanymore -/* Imlementiation of tioctl interface */ - -#include <termios.h> -#undef tcgetattr -#undef tcsetattr - -/* This is bletcherously kludged to work with emacs in a fragile - way. */ -int term_modes[4]; -char term_ccs[20]; -int term_speeds[2]; - -kern_return_t -S_tioctl_tiocgeta (mach_port_t port, - int modes[], - char ccs[], - int speeds[]) -{ -#if 1 - union { struct termios t; - struct { int modes[4]; char cc[20]; int speed[2]; } s; } u; - if (tcgetattr (0, &u.t)) - return errno; - bcopy (u.s.modes, modes, sizeof u.s.modes); - bcopy (u.s.cc, ccs, sizeof u.s.cc); - bcopy (u.s.speed, speeds, sizeof u.s.speed); - return 0; -#else - /* Emacs reads the terminal state in one of two cases: - 1) Checking whether or not a preceding tiocseta succeeded; - 2) Finding out what the state of the terminal was on startup. - In case (1) in only cares that we return exactly what it set; - in case (2) it only uses it for a later seta on exit. So we - can just tell it what's lying around. */ - modes[0] = term_modes[0]; - modes[1] = term_modes[1]; - modes[2] = term_modes[2]; - modes[3] = term_modes[3]; - - bcopy (term_ccs, ccs, 20); - - speeds[0] = term_speeds[0]; - speeds[1] = term_speeds[1]; - return 0; -#endif -} - -#define ICANON (1 << 8) - -kern_return_t -S_tioctl_tiocseta (mach_port_t port, - int modes[], - char ccs[], - int speeds[]) -{ -#if 1 - union { struct termios t; - struct { int modes[4]; char cc[20]; int speed[2]; } s; } u; - memcpy (u.s.modes, modes, sizeof u.s.modes); - memcpy (u.s.cc, ccs, sizeof u.s.cc); - memcpy (u.s.speed, speeds, sizeof u.s.speed); - return tcsetattr (0, 0, &u.t) ? errno : 0; -#else - /* Emacs sets the termanal stet in one of two cases: - 1) Putting the terminal into raw mode for running; - 2) Restoring the terminal to its original state. - Because ICANON is set in the original state, and because - emacs always clears ICANON when running, this tells us which - is going on. */ - if ((modes[3] & ICANON) == 0) - { - struct sgttyb sgb; - int bits; - /* Enter raw made. Rather than try and interpret these bits, - we just do what emacs does in .../emacs/src/sysdep.c for - an old style terminal driver. */ - bits = localbits | LDECCTQ | LLITOUT | LPASS8 | LNOFLSH; - ioctl (0, TIOCLSET, &bits); - sgb = term_sgb; - sgb.sg_flags &= ~ECHO; - sgb.sg_flags |= RAW | ANYP; - ioctl (0, TIOCSETN, &sgb); - } - else - { - /* Leave raw mode */ - ioctl (0, TIOCLSET, &localbits); - ioctl (0, TIOCSETN, &term_sgb); - } - - term_modes[0] = modes[0]; - term_modes[1] = modes[1]; - term_modes[2] = modes[2]; - term_modes[3] = modes[3]; - bcopy (ccs, term_ccs, 20); - term_speeds[0] = speeds[0]; - term_speeds[1] = speeds[1]; - return 0; -#endif -} - -kern_return_t -S_tioctl_tiocsetaw (mach_port_t port, - int modes[4], - char ccs[20], - int speeds[2]) -{ - return S_tioctl_tiocseta (port, modes, ccs, speeds); -} - -kern_return_t -S_tioctl_tiocsetaf (mach_port_t port, - int modes[4], - char ccs[20], - int speeds[2]) -{ - return S_tioctl_tiocseta (port, modes, ccs, speeds); -} - -#endif /* notanymore */ - /* Implementation of device interface */ kern_return_t |