Module Name: src
Committed By: jmcneill
Date: Wed Nov 11 12:37:14 UTC 2015
Modified Files:
src/sys/arch/arm/arm32: arm32_reboot.c
src/sys/arch/arm/include/arm32: machdep.h
Log Message:
add support for optional RB_POWERDOWN handler
To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/arm32/arm32_reboot.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/arm/include/arm32/machdep.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/arm/arm32/arm32_reboot.c
diff -u src/sys/arch/arm/arm32/arm32_reboot.c:1.8 src/sys/arch/arm/arm32/arm32_reboot.c:1.9
--- src/sys/arch/arm/arm32/arm32_reboot.c:1.8 Mon Jan 5 17:04:24 2015
+++ src/sys/arch/arm/arm32/arm32_reboot.c Wed Nov 11 12:37:13 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: arm32_reboot.c,v 1.8 2015/01/05 17:04:24 joerg Exp $ */
+/* $NetBSD: arm32_reboot.c,v 1.9 2015/11/11 12:37:13 jmcneill Exp $ */
/*
* Copyright (c) 2002, 2003, 2005 Genetec Corporation. All rights reserved.
@@ -122,7 +122,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: arm32_reboot.c,v 1.8 2015/01/05 17:04:24 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: arm32_reboot.c,v 1.9 2015/11/11 12:37:13 jmcneill Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -136,11 +136,19 @@ __KERNEL_RCSID(0, "$NetBSD: arm32_reboot
#include <arm/locore.h>
#include <arm/arm32/machdep.h>
+void (*cpu_powerdown_address)(void);
+
static int
docpureset(int howto)
{
- if (howto & RB_POWERDOWN)
- printf("WARNING: powerdown not supported\r\n");
+ if (howto & RB_POWERDOWN) {
+ if (cpu_powerdown_address) {
+ cpu_powerdown_address();
+ printf("WARNING: powerdown failed\r\n");
+ } else {
+ printf("WARNING: powerdown not supported\r\n");
+ }
+ }
if (howto & RB_HALT) {
printf("The operating system has halted.\r\n");
Index: src/sys/arch/arm/include/arm32/machdep.h
diff -u src/sys/arch/arm/include/arm32/machdep.h:1.18 src/sys/arch/arm/include/arm32/machdep.h:1.19
--- src/sys/arch/arm/include/arm32/machdep.h:1.18 Fri Mar 28 21:51:59 2014
+++ src/sys/arch/arm/include/arm32/machdep.h Wed Nov 11 12:37:13 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.h,v 1.18 2014/03/28 21:51:59 matt Exp $ */
+/* $NetBSD: machdep.h,v 1.19 2015/11/11 12:37:13 jmcneill Exp $ */
#ifndef _ARM32_BOOT_MACHDEP_H_
#define _ARM32_BOOT_MACHDEP_H_
@@ -25,6 +25,8 @@
extern void (*cpu_reset_address)(void);
extern paddr_t cpu_reset_address_paddr;
+extern void (*cpu_powerdown_address)(void);
+
extern u_int data_abort_handler_address;
extern u_int prefetch_abort_handler_address;
// extern u_int undefined_handler_address;