4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
24 */
25
26 #ifndef _SYS_CYCLIC_H
27 #define _SYS_CYCLIC_H
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32
33 #ifndef _ASM
34 #include <sys/time.h>
35 #include <sys/cpuvar.h>
36 #include <sys/cpupart.h>
37 #endif /* !_ASM */
38
39 #define CY_LOW_LEVEL 0
40 #define CY_LOCK_LEVEL 1
41 #define CY_HIGH_LEVEL 2
42 #define CY_SOFT_LEVELS 2
43 #define CY_LEVELS 3
55
56 typedef struct cyc_handler {
57 cyc_func_t cyh_func;
58 void *cyh_arg;
59 cyc_level_t cyh_level;
60 } cyc_handler_t;
61
62 typedef struct cyc_time {
63 hrtime_t cyt_when;
64 hrtime_t cyt_interval;
65 } cyc_time_t;
66
67 typedef struct cyc_omni_handler {
68 void (*cyo_online)(void *, cpu_t *, cyc_handler_t *, cyc_time_t *);
69 void (*cyo_offline)(void *, cpu_t *, void *);
70 void *cyo_arg;
71 } cyc_omni_handler_t;
72
73 #define CY_INFINITY INT64_MAX
74
75 #ifdef _KERNEL
76
77 extern cyclic_id_t cyclic_add(cyc_handler_t *, cyc_time_t *);
78 extern cyclic_id_t cyclic_add_omni(cyc_omni_handler_t *);
79 extern void cyclic_remove(cyclic_id_t);
80 extern void cyclic_bind(cyclic_id_t, cpu_t *, cpupart_t *);
81 extern int cyclic_reprogram(cyclic_id_t, hrtime_t);
82 extern hrtime_t cyclic_getres();
83
84 extern int cyclic_offline(cpu_t *cpu);
85 extern void cyclic_online(cpu_t *cpu);
86 extern int cyclic_juggle(cpu_t *cpu);
87 extern void cyclic_move_in(cpu_t *);
88 extern int cyclic_move_out(cpu_t *);
89 extern void cyclic_suspend();
90 extern void cyclic_resume();
91
92 extern void cyclic_fire(cpu_t *cpu);
93 extern void cyclic_softint(cpu_t *cpu, cyc_level_t level);
94
95 #endif /* _KERNEL */
96
97 #endif /* !_ASM */
98
99 #ifdef __cplusplus
100 }
101 #endif
102
103 #endif /* _SYS_CYCLIC_H */
|
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
24 *
25 * Copyright 2017 RackTop Systems.
26 */
27
28 #ifndef _SYS_CYCLIC_H
29 #define _SYS_CYCLIC_H
30
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34
35 #ifndef _ASM
36 #include <sys/time.h>
37 #include <sys/cpuvar.h>
38 #include <sys/cpupart.h>
39 #endif /* !_ASM */
40
41 #define CY_LOW_LEVEL 0
42 #define CY_LOCK_LEVEL 1
43 #define CY_HIGH_LEVEL 2
44 #define CY_SOFT_LEVELS 2
45 #define CY_LEVELS 3
57
58 typedef struct cyc_handler {
59 cyc_func_t cyh_func;
60 void *cyh_arg;
61 cyc_level_t cyh_level;
62 } cyc_handler_t;
63
64 typedef struct cyc_time {
65 hrtime_t cyt_when;
66 hrtime_t cyt_interval;
67 } cyc_time_t;
68
69 typedef struct cyc_omni_handler {
70 void (*cyo_online)(void *, cpu_t *, cyc_handler_t *, cyc_time_t *);
71 void (*cyo_offline)(void *, cpu_t *, void *);
72 void *cyo_arg;
73 } cyc_omni_handler_t;
74
75 #define CY_INFINITY INT64_MAX
76
77 #if defined(_KERNEL) || defined(_FAKE_KERNEL)
78
79 extern cyclic_id_t cyclic_add(cyc_handler_t *, cyc_time_t *);
80 extern cyclic_id_t cyclic_add_omni(cyc_omni_handler_t *);
81 extern void cyclic_remove(cyclic_id_t);
82 extern void cyclic_bind(cyclic_id_t, cpu_t *, cpupart_t *);
83 extern int cyclic_reprogram(cyclic_id_t, hrtime_t);
84 extern hrtime_t cyclic_getres();
85
86 extern int cyclic_offline(cpu_t *cpu);
87 extern void cyclic_online(cpu_t *cpu);
88 extern int cyclic_juggle(cpu_t *cpu);
89 extern void cyclic_move_in(cpu_t *);
90 extern int cyclic_move_out(cpu_t *);
91 extern void cyclic_suspend();
92 extern void cyclic_resume();
93
94 extern void cyclic_fire(cpu_t *cpu);
95 extern void cyclic_softint(cpu_t *cpu, cyc_level_t level);
96
97 #endif /* _KERNEL || _FAKE_KERNEL */
98
99 #endif /* !_ASM */
100
101 #ifdef __cplusplus
102 }
103 #endif
104
105 #endif /* _SYS_CYCLIC_H */
|