Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm add support for optional RB_POWERDOWN handler



details:   https://anonhg.NetBSD.org/src/rev/9200b8378bae
branches:  trunk
changeset: 341555:9200b8378bae
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Wed Nov 11 12:37:13 2015 +0000

description:
add support for optional RB_POWERDOWN handler

diffstat:

 sys/arch/arm/arm32/arm32_reboot.c    |  16 ++++++++++++----
 sys/arch/arm/include/arm32/machdep.h |   4 +++-
 2 files changed, 15 insertions(+), 5 deletions(-)

diffs (58 lines):

diff -r 8650edd86963 -r 9200b8378bae sys/arch/arm/arm32/arm32_reboot.c
--- a/sys/arch/arm/arm32/arm32_reboot.c Wed Nov 11 12:35:40 2015 +0000
+++ b/sys/arch/arm/arm32/arm32_reboot.c Wed Nov 11 12:37:13 2015 +0000
@@ -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 @@
 #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");
diff -r 8650edd86963 -r 9200b8378bae sys/arch/arm/include/arm32/machdep.h
--- a/sys/arch/arm/include/arm32/machdep.h      Wed Nov 11 12:35:40 2015 +0000
+++ b/sys/arch/arm/include/arm32/machdep.h      Wed Nov 11 12:37:13 2015 +0000
@@ -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;



Home | Main Index | Thread Index | Old Index