]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - sys/cddl/compat/opensolaris/sys/cyclic.h
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / sys / cddl / compat / opensolaris / sys / cyclic.h
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  *
22  * $FreeBSD$
23  *
24  */
25 /*
26  * Copyright (c) 1999-2001 by Sun Microsystems, Inc.
27  * All rights reserved.
28  */
29
30 #ifndef _COMPAT_OPENSOLARIS_SYS_CYCLIC_H_
31 #define _COMPAT_OPENSOLARIS_SYS_CYCLIC_H_
32
33 #ifndef _KERNEL
34 typedef void    cpu_t;
35 #endif
36
37
38 #ifndef _ASM
39 #include <sys/time.h>
40 #include <sys/cpuvar.h>
41 #endif /* !_ASM */
42
43 #ifndef _ASM
44
45 typedef uintptr_t cyclic_id_t;
46 typedef int cyc_index_t;
47 typedef uint16_t cyc_level_t;
48 typedef void (*cyc_func_t)(void *);
49 typedef void *cyb_arg_t;
50
51 #define CYCLIC_NONE             ((cyclic_id_t)0)
52
53 typedef struct cyc_handler {
54         cyc_func_t cyh_func;
55         void *cyh_arg;
56 } cyc_handler_t;
57
58 typedef struct cyc_time {
59         hrtime_t cyt_when;
60         hrtime_t cyt_interval;
61 } cyc_time_t;
62
63 typedef struct cyc_omni_handler {
64         void (*cyo_online)(void *, cpu_t *, cyc_handler_t *, cyc_time_t *);
65         void (*cyo_offline)(void *, cpu_t *, void *);
66         void *cyo_arg;
67 } cyc_omni_handler_t;
68
69 #ifdef _KERNEL
70
71 cyclic_id_t cyclic_add(cyc_handler_t *, cyc_time_t *);
72 cyclic_id_t cyclic_add_omni(cyc_omni_handler_t *);
73 void cyclic_remove(cyclic_id_t);
74
75 #endif /* _KERNEL */
76
77 #endif /* !_ASM */
78
79 #endif