1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-23 11:18:54 +00:00

Synchronize with sys/i386/isa/syscons.c revision 1.205.

This commit is contained in:
KATO Takenori 1997-03-04 06:25:54 +00:00
parent 3a9c9c6e42
commit 541de8d9a5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=23369

View File

@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
* $Id: syscons.c,v 1.28 1997/02/22 09:43:47 peter Exp $ * $Id: syscons.c,v 1.29 1997/03/01 10:53:07 kato Exp $
*/ */
#include "sc.h" #include "sc.h"
@ -207,6 +207,7 @@ static const int nsccons = MAXCONS+2;
((scp->his_atr) + ((((pointer) - (scp->his_atr)) + (scp->history_size)\ ((scp->his_atr) + ((((pointer) - (scp->his_atr)) + (scp->history_size)\
+ (offset)) % (scp->history_size))) + (offset)) % (scp->history_size)))
#endif #endif
#define ISSIGVALID(sig) ((sig) > 0 && (sig) < NSIG)
/* prototypes */ /* prototypes */
static int scattach(struct isa_device *dev); static int scattach(struct isa_device *dev);
@ -948,7 +949,7 @@ scioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
switch (mouse->operation) { switch (mouse->operation) {
case MOUSE_MODE: case MOUSE_MODE:
if (mouse->u.mode.signal > 0 && mouse->u.mode.signal < NSIG) { if (ISSIGVALID(mouse->u.mode.signal)) {
scp->mouse_signal = mouse->u.mode.signal; scp->mouse_signal = mouse->u.mode.signal;
scp->mouse_proc = p; scp->mouse_proc = p;
scp->mouse_pid = p->p_pid; scp->mouse_pid = p->p_pid;
@ -1228,12 +1229,21 @@ scioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
#endif /* PC98 */ #endif /* PC98 */
case VT_SETMODE: /* set screen switcher mode */ case VT_SETMODE: /* set screen switcher mode */
bcopy(data, &scp->smode, sizeof(struct vt_mode)); {
if (scp->smode.mode == VT_PROCESS) { struct vt_mode *mode;
scp->proc = p;
scp->pid = scp->proc->p_pid; mode = (struct vt_mode *)data;
} if (ISSIGVALID(mode->relsig) && ISSIGVALID(mode->acqsig) &&
return 0; ISSIGVALID(mode->frsig)) {
bcopy(data, &scp->smode, sizeof(struct vt_mode));
if (scp->smode.mode == VT_PROCESS) {
scp->proc = p;
scp->pid = scp->proc->p_pid;
}
return 0;
} else
return EINVAL;
}
case VT_GETMODE: /* get screen switcher mode */ case VT_GETMODE: /* get screen switcher mode */
bcopy(&scp->smode, data, sizeof(struct vt_mode)); bcopy(&scp->smode, data, sizeof(struct vt_mode));