diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2006-07-29 12:52:41 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2006-07-29 12:52:41 +0000 |
commit | eef19c08ee46f4c4ff5f4e55eff45e10d8110adc (patch) | |
tree | fb577408e9b15c298b9f64e0b239f6f0c9dda788 /sys | |
parent | d477cc3a7b7c846444f229ee77bdb1e42ad18026 (diff) |
Do not fail KDENABIO and KDDISABIO ioctls on non-i386 platforms, this allows
older X servers to run; ok matthieu@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/wscons/wsdisplay_compat_usl.c | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/sys/dev/wscons/wsdisplay_compat_usl.c b/sys/dev/wscons/wsdisplay_compat_usl.c index cd1dcef5599..936ab2d62ef 100644 --- a/sys/dev/wscons/wsdisplay_compat_usl.c +++ b/sys/dev/wscons/wsdisplay_compat_usl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wsdisplay_compat_usl.c,v 1.16 2006/06/30 21:34:47 miod Exp $ */ +/* $OpenBSD: wsdisplay_compat_usl.c,v 1.17 2006/07/29 12:52:40 miod Exp $ */ /* $NetBSD: wsdisplay_compat_usl.c,v 1.12 2000/03/23 07:01:47 thorpej Exp $ */ /* @@ -425,21 +425,37 @@ wsdisplay_usl_ioctl2(sc, scr, cmd, data, flag, p) #undef d return (0); +#if defined(__i386__) case KDENABIO: if (suser(p, 0) || securelevel > 0) return (EPERM); /* FALLTHRU */ case KDDISABIO: -#if defined(__i386__) && defined(COMPAT_FREEBSD) +#if defined(COMPAT_FREEBSD) { struct trapframe *fp = (struct trapframe *)p->p_md.md_regs; - if (cmd == KDENABIO) - fp->tf_eflags |= PSL_IOPL; - else - fp->tf_eflags &= ~PSL_IOPL; + extern struct emul emul_freebsd_aout; + extern struct emul emul_freebsd_elf; + + if (p->p_emul == &emul_freebsd_aout || + p->p_emul == &emul_freebsd_elf) { + if (cmd == KDENABIO) + fp->tf_eflags |= PSL_IOPL; + else + fp->tf_eflags &= ~PSL_IOPL; + } } #endif return (0); +#else + case KDENABIO: + case KDDISABIO: + /* + * This is a lie, but non-x86 platforms are not supposed to + * issue these ioctls anyway. + */ + return (0); +#endif case KDSETRAD: /* XXX ignore for now */ return (0); |