| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: arm32_reboot.c,v 1.1 2012/08/31 23:59:51 matt Exp $ */ | | 1 | /* $NetBSD: arm32_reboot.c,v 1.2 2012/09/05 06:29:09 skrll Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 2002, 2003, 2005 Genetec Corporation. All rights reserved. | | 4 | * Copyright (c) 2002, 2003, 2005 Genetec Corporation. All rights reserved. |
5 | * Written by Hiroyuki Bessho for Genetec Corporation. | | 5 | * Written by Hiroyuki Bessho for Genetec Corporation. |
6 | * | | 6 | * |
7 | * Redistribution and use in source and binary forms, with or without | | 7 | * Redistribution and use in source and binary forms, with or without |
8 | * modification, are permitted provided that the following conditions | | 8 | * modification, are permitted provided that the following conditions |
9 | * are met: | | 9 | * are met: |
10 | * 1. Redistributions of source code must retain the above copyright | | 10 | * 1. Redistributions of source code must retain the above copyright |
11 | * notice, this list of conditions and the following disclaimer. | | 11 | * notice, this list of conditions and the following disclaimer. |
12 | * 2. Redistributions in binary form must reproduce the above copyright | | 12 | * 2. Redistributions in binary form must reproduce the above copyright |
13 | * notice, this list of conditions and the following disclaimer in the | | 13 | * notice, this list of conditions and the following disclaimer in the |
14 | * documentation and/or other materials provided with the distribution. | | 14 | * documentation and/or other materials provided with the distribution. |
| @@ -112,27 +112,27 @@ | | | @@ -112,27 +112,27 @@ |
112 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | | 112 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
113 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | | 113 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
114 | * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTERS BE LIABLE FOR ANY DIRECT, | | 114 | * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTERS BE LIABLE FOR ANY DIRECT, |
115 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | | 115 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
116 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | | 116 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
117 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | | 117 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
118 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | | 118 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
119 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 119 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
120 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 120 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
121 | * SUCH DAMAGE. | | 121 | * SUCH DAMAGE. |
122 | */ | | 122 | */ |
123 | | | 123 | |
124 | #include <sys/cdefs.h> | | 124 | #include <sys/cdefs.h> |
125 | __KERNEL_RCSID(0, "$NetBSD: arm32_reboot.c,v 1.1 2012/08/31 23:59:51 matt Exp $"); | | 125 | __KERNEL_RCSID(0, "$NetBSD: arm32_reboot.c,v 1.2 2012/09/05 06:29:09 skrll Exp $"); |
126 | | | 126 | |
127 | #include <sys/param.h> | | 127 | #include <sys/param.h> |
128 | #include <sys/device.h> | | 128 | #include <sys/device.h> |
129 | #include <sys/kernel.h> | | 129 | #include <sys/kernel.h> |
130 | #include <sys/reboot.h> | | 130 | #include <sys/reboot.h> |
131 | | | 131 | |
132 | #include <dev/cons.h> | | 132 | #include <dev/cons.h> |
133 | | | 133 | |
134 | #include <uvm/uvm_extern.h> | | 134 | #include <uvm/uvm_extern.h> |
135 | | | 135 | |
136 | #include <arm/arm32/machdep.h> | | 136 | #include <arm/arm32/machdep.h> |
137 | | | 137 | |
138 | void | | 138 | void |
| @@ -164,26 +164,28 @@ cpu_reboot(int howto, char *bootstr) | | | @@ -164,26 +164,28 @@ cpu_reboot(int howto, char *bootstr) |
164 | if (!(howto & RB_NOSYNC)) | | 164 | if (!(howto & RB_NOSYNC)) |
165 | bootsync(); | | 165 | bootsync(); |
166 | | | 166 | |
167 | /* Say NO to interrupts */ | | 167 | /* Say NO to interrupts */ |
168 | splhigh(); | | 168 | splhigh(); |
169 | | | 169 | |
170 | /* Do a dump if requested. */ | | 170 | /* Do a dump if requested. */ |
171 | if ((howto & (RB_DUMP | RB_HALT)) == RB_DUMP) | | 171 | if ((howto & (RB_DUMP | RB_HALT)) == RB_DUMP) |
172 | dumpsys(); | | 172 | dumpsys(); |
173 | | | 173 | |
174 | /* Run any shutdown hooks */ | | 174 | /* Run any shutdown hooks */ |
175 | doshutdownhooks(); | | 175 | doshutdownhooks(); |
176 | | | 176 | |
| | | 177 | pmf_system_shutdown(boothowto); |
| | | 178 | |
177 | /* Make sure IRQ's are disabled */ | | 179 | /* Make sure IRQ's are disabled */ |
178 | IRQdisable; | | 180 | IRQdisable; |
179 | | | 181 | |
180 | if (howto & RB_HALT) { | | 182 | if (howto & RB_HALT) { |
181 | printf("The operating system has halted.\r\n"); | | 183 | printf("The operating system has halted.\r\n"); |
182 | printf("Please press any key to reboot.\r\n"); | | 184 | printf("Please press any key to reboot.\r\n"); |
183 | cngetc(); | | 185 | cngetc(); |
184 | } | | 186 | } |
185 | | | 187 | |
186 | printf("rebooting...\r\n"); | | 188 | printf("rebooting...\r\n"); |
187 | if (cpu_reset_address) | | 189 | if (cpu_reset_address) |
188 | (*cpu_reset_address)(); | | 190 | (*cpu_reset_address)(); |
189 | cpu_reset(); | | 191 | cpu_reset(); |