timer.h revision 3348528f7ec68bf2f11d0cbd5c3b9932ea7f0d5c
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (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 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_TIMER_H
#define _SYS_TIMER_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _KERNEL
#define _TIMER_MAX 32
/*
* Bit values for the it_lock field.
*/
#define ITLK_LOCKED 0x01
#define ITLK_WANTED 0x02
#define ITLK_REMOVE 0x04
/*
* Bit values for the it_flags field.
*/
#define IT_SIGNAL 0x01
struct clock_backend;
typedef struct itimer {
void *it_arg;
int it_blockers;
int it_pending;
int it_overrun;
struct clock_backend *it_backend;
void *it_portev; /* port_kevent_t pointer */
void *it_portsrc; /* port_source_t pointer */
int it_portfd; /* port file descriptor */
} itimer_t;
typedef struct clock_backend {
struct sigevent clk_default;
int (*clk_clock_settime)(timespec_t *);
int (*clk_clock_gettime)(timespec_t *);
int (*clk_clock_getres)(timespec_t *);
int (*clk_timer_delete)(itimer_t *);
void (*clk_timer_lwpbind)(itimer_t *);
extern void timer_fire(itimer_t *);
extern void timer_lwpbind();
extern void timer_func(sigqueue_t *);
extern void timer_exit(void);
extern void timer_lwpexit(void);
extern int itimerspecfix(timespec_t *);
extern void timespecfix(timespec_t *);
struct oldsigevent {
/* structure definition prior to notification attributes member */
int _notify;
union {
int _signo;
void (*_notify_function)(union sigval);
} _un;
};
#if defined(_SYSCALL32)
struct oldsigevent32 {
union {
} _un;
};
#endif /* _SYSCALL32 */
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_TIMER_H */