| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: pcu.h,v 1.6 2011/05/02 02:28:57 rmind Exp $ */ | | 1 | /* $NetBSD: pcu.h,v 1.7 2011/05/02 08:26:32 martin Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 2011 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 2011 The NetBSD Foundation, Inc. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to The NetBSD Foundation | | 7 | * This code is derived from software contributed to The NetBSD Foundation |
8 | * by Mindaugas Rasiukevicius. | | 8 | * by Mindaugas Rasiukevicius. |
9 | * | | 9 | * |
10 | * Redistribution and use in source and binary forms, with or without | | 10 | * Redistribution and use in source and binary forms, with or without |
11 | * modification, are permitted provided that the following conditions | | 11 | * modification, are permitted provided that the following conditions |
12 | * are met: | | 12 | * are met: |
13 | * 1. Redistributions of source code must retain the above copyright | | 13 | * 1. Redistributions of source code must retain the above copyright |
14 | * notice, this list of conditions and the following disclaimer. | | 14 | * notice, this list of conditions and the following disclaimer. |
| @@ -26,26 +26,30 @@ | | | @@ -26,26 +26,30 @@ |
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
29 | * POSSIBILITY OF SUCH DAMAGE. | | 29 | * POSSIBILITY OF SUCH DAMAGE. |
30 | */ | | 30 | */ |
31 | | | 31 | |
32 | #ifndef _SYS_PCU_H_ | | 32 | #ifndef _SYS_PCU_H_ |
33 | #define _SYS_PCU_H_ | | 33 | #define _SYS_PCU_H_ |
34 | | | 34 | |
35 | #if !defined(_KERNEL) && !defined(_KMEMUSER) | | 35 | #if !defined(_KERNEL) && !defined(_KMEMUSER) |
36 | #error "not supposed to be exposed to userland" | | 36 | #error "not supposed to be exposed to userland" |
37 | #endif | | 37 | #endif |
38 | | | 38 | |
| | | 39 | #ifndef _KERNEL |
| | | 40 | #include <stdbool.h> |
| | | 41 | #endif |
| | | 42 | |
39 | /* | | 43 | /* |
40 | * Default: no PCU for MD. | | 44 | * Default: no PCU for MD. |
41 | */ | | 45 | */ |
42 | #ifndef PCU_UNIT_COUNT | | 46 | #ifndef PCU_UNIT_COUNT |
43 | #define PCU_UNIT_COUNT 0 | | 47 | #define PCU_UNIT_COUNT 0 |
44 | #endif | | 48 | #endif |
45 | | | 49 | |
46 | #if PCU_UNIT_COUNT > 0 | | 50 | #if PCU_UNIT_COUNT > 0 |
47 | | | 51 | |
48 | typedef struct { | | 52 | typedef struct { |
49 | u_int pcu_id; | | 53 | u_int pcu_id; |
50 | void (*pcu_state_save)(lwp_t *); | | 54 | void (*pcu_state_save)(lwp_t *); |
51 | void (*pcu_state_load)(lwp_t *, bool); | | 55 | void (*pcu_state_load)(lwp_t *, bool); |