| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: cpu.c,v 1.31.2.1 2009/02/09 00:03:55 jym Exp $ */ | | 1 | /* $NetBSD: cpu.c,v 1.31.2.2 2009/06/18 11:12:07 cegger Exp $ */ |
2 | /* NetBSD: cpu.c,v 1.18 2004/02/20 17:35:01 yamt Exp */ | | 2 | /* NetBSD: cpu.c,v 1.18 2004/02/20 17:35:01 yamt Exp */ |
3 | | | 3 | |
4 | /*- | | 4 | /*- |
5 | * Copyright (c) 2000 The NetBSD Foundation, Inc. | | 5 | * Copyright (c) 2000 The NetBSD Foundation, Inc. |
6 | * Copyright (c) 2002, 2006, 2007 YAMAMOTO Takashi, | | 6 | * Copyright (c) 2002, 2006, 2007 YAMAMOTO Takashi, |
7 | * All rights reserved. | | 7 | * All rights reserved. |
8 | * | | 8 | * |
9 | * This code is derived from software contributed to The NetBSD Foundation | | 9 | * This code is derived from software contributed to The NetBSD Foundation |
10 | * by RedBack Networks Inc. | | 10 | * by RedBack Networks Inc. |
11 | * | | 11 | * |
12 | * Author: Bill Sommerfeld | | 12 | * Author: Bill Sommerfeld |
13 | * | | 13 | * |
14 | * Redistribution and use in source and binary forms, with or without | | 14 | * Redistribution and use in source and binary forms, with or without |
| @@ -56,27 +56,27 @@ | | | @@ -56,27 +56,27 @@ |
56 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | | 56 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
57 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | | 57 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
58 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR AND CONTRIBUTORS BE LIABLE | | 58 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR AND CONTRIBUTORS BE LIABLE |
59 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | | 59 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
60 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | | 60 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
61 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | | 61 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
62 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | | 62 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
63 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 63 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
64 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 64 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
65 | * SUCH DAMAGE. | | 65 | * SUCH DAMAGE. |
66 | */ | | 66 | */ |
67 | | | 67 | |
68 | #include <sys/cdefs.h> | | 68 | #include <sys/cdefs.h> |
69 | __KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.31.2.1 2009/02/09 00:03:55 jym Exp $"); | | 69 | __KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.31.2.2 2009/06/18 11:12:07 cegger Exp $"); |
70 | | | 70 | |
71 | #include "opt_ddb.h" | | 71 | #include "opt_ddb.h" |
72 | #include "opt_multiprocessor.h" | | 72 | #include "opt_multiprocessor.h" |
73 | #include "opt_mpbios.h" /* for MPDEBUG */ | | 73 | #include "opt_mpbios.h" /* for MPDEBUG */ |
74 | #include "opt_mtrr.h" | | 74 | #include "opt_mtrr.h" |
75 | #include "opt_xen.h" | | 75 | #include "opt_xen.h" |
76 | | | 76 | |
77 | #include "lapic.h" | | 77 | #include "lapic.h" |
78 | #include "ioapic.h" | | 78 | #include "ioapic.h" |
79 | | | 79 | |
80 | #include <sys/param.h> | | 80 | #include <sys/param.h> |
81 | #include <sys/proc.h> | | 81 | #include <sys/proc.h> |
82 | #include <sys/user.h> | | 82 | #include <sys/user.h> |
| @@ -265,26 +265,30 @@ cpu_attach(device_t parent, device_t sel | | | @@ -265,26 +265,30 @@ cpu_attach(device_t parent, device_t sel |
265 | ci->ci_flags |= CPUF_PRESENT | CPUF_BSP | CPUF_PRIMARY; | | 265 | ci->ci_flags |= CPUF_PRESENT | CPUF_BSP | CPUF_PRIMARY; |
266 | break; | | 266 | break; |
267 | | | 267 | |
268 | case CPU_ROLE_AP: | | 268 | case CPU_ROLE_AP: |
269 | /* | | 269 | /* |
270 | * report on an AP | | 270 | * report on an AP |
271 | */ | | 271 | */ |
272 | printf("(application processor)\n"); | | 272 | printf("(application processor)\n"); |
273 | break; | | 273 | break; |
274 | | | 274 | |
275 | default: | | 275 | default: |
276 | panic("unknown processor type??\n"); | | 276 | panic("unknown processor type??\n"); |
277 | } | | 277 | } |
| | | 278 | |
| | | 279 | if (!pmf_device_register(self, NULL, NULL)) |
| | | 280 | aprint_error_dev(self, "couldn't establish power handler\n"); |
| | | 281 | |
278 | return; | | 282 | return; |
279 | #else | | 283 | #else |
280 | cpu_attach_common(parent, self, aux); | | 284 | cpu_attach_common(parent, self, aux); |
281 | #endif | | 285 | #endif |
282 | } | | 286 | } |
283 | | | 287 | |
284 | #ifdef XEN3 | | 288 | #ifdef XEN3 |
285 | int | | 289 | int |
286 | vcpu_match(device_t parent, cfdata_t match, void *aux) | | 290 | vcpu_match(device_t parent, cfdata_t match, void *aux) |
287 | { | | 291 | { |
288 | struct vcpu_attach_args *vcaa = aux; | | 292 | struct vcpu_attach_args *vcaa = aux; |
289 | | | 293 | |
290 | if (strcmp(vcaa->vcaa_name, match->cf_name) == 0) | | 294 | if (strcmp(vcaa->vcaa_name, match->cf_name) == 0) |