/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 1985, 1997 by Sun Microsystems, Inc.
* All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Vuid (Virtual User Input Device) queue management.
*/
#include <sys/vuid_event.h>
#include <sys/vuid_queue.h>
/* Works for small numbers (< 1000) of seconds */
void
{
/* Initialize vq */
/* Place in pool by freeing all nodes (fudge vq->num for this) */
}
{
/* Merge into existing events based on time stamp */
/* Put later times closer to the bottom than earlier ones */
< /* comment to make cstyle happy - heinous! */) ||
if (vqn == VUID_Q_NODE_NULL)
return (VUID_Q_OVERFLOW);
/* Insert vqn before vq (neither are null) */
/* Initialize vqn's next and prev */
/* Fix up vp next's prev */
/* Fix up vp's next */
/* Change bottom */
/* Change top */
return (VUID_Q_OK);
}
}
/* Place at top of queue */
}
{
if (vqn == VUID_Q_NODE_NULL)
return (VUID_Q_EMPTY);
/* Conditionally copy data */
if (firm_event != FIRM_EVENT_NULL)
/* Change top */
/* Null new top's prev */
/* Change bottom */
/* Release storage */
return (VUID_Q_OK);
}
{
return (VUID_Q_EMPTY);
return (VUID_Q_OK);
}
{
if (vqn == VUID_Q_NODE_NULL)
return (VUID_Q_OVERFLOW);
/* Change new top's next */
/* Null new top's prev */
/* Change old top's prev */
/* Change top */
/* Change bottom */
return (VUID_Q_OK);
}
int
{
int num_start;
return (0);
/*
* Determine the threshold time interval under which events of
* the same type (valuator only) are collapsed.
* min_time_betvqnen_values = ((first_entry_time - last_entry_time) /
* max_number_of_queue_entries) * factor_by_which_to_compress_queue;
*/
/* March down list */
/* See if valuator event */
if (!vq_is_valuator(base))
continue;
/* Run down list looking for a collapse victim */
/* Remember next victim incase axe victim below */
/* Fail if not valuator event */
if (!vq_is_valuator(victim))
goto Advance_Base;
/*
* May peek ahead and do the collapse as long as the
* intervening times of other valuator event types
* are the same. Fail if intervening event's time
* differs from victim's.
*/
goto Advance_Base;
}
/* Fail if time difference is above threshold */
/* Zero factor means collapse regardless of threshold */
if ((factor > 0) &&
goto Advance_Base;
/* Do collapse if same event id */
/* Collapse value into base event */
case FE_PAIR_ABSOLUTE:
/* id is delta */
break;
case FE_PAIR_DELTA:
/* id is absolute */
/* Fall through */
default:
/* Assume id is absolute */
break;
}
/* Remove victim node */
}
}
{}
}
}
int
{
}
void
{
/* Use get if removing off top of queue */
return;
}
/* Update previous next link (not null else vqn would be top) */
/* Change bottom */
else
/* Update next previous link (if null else vqn is bottom) */
/* Release storage */
}
/*
* Caller must initialize data returned from vq_alloc_node.
* VUID_Q_NODE_NULL is possible.
*/
static Vuid_q_node *
{
return (VUID_Q_NODE_NULL);
return (vqn);
}
static void
{
}
static int
{
}
/* atv-btv */
static struct timeval32
{
}
else
else {
}
return (atv);
}
/* tv / dividend */
static struct timeval32
{
int usecs;
if (dividend == 0)
return (tv);
return (tv);
}
/* tv * multiplier (works for small multipliers * seconds, < 1000) */
static struct timeval32
{
int usecs;
usecs *= multiplier;
return (tv);
}
static struct timeval32
{
return (tv);
}