summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2016-10-09 00:53:44 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2016-10-09 00:53:44 +0000
commit668174e5d3ba8615c31aa88c5012eeac81186768 (patch)
tree864574938512fa1bdcdaa18876bcda26e13098f4 /sys/arch
parentf437e2fd9fd69825a9ee8a402538a7184859dc78 (diff)
Add a power down function pointer so power down can work without the
platform abstraction. ok tom@ kettenis@
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/armv7/armv7/armv7_machdep.c6
-rw-r--r--sys/arch/armv7/armv7/armv7_machdep.h3
-rw-r--r--sys/arch/armv7/armv7/platform.c3
3 files changed, 8 insertions, 4 deletions
diff --git a/sys/arch/armv7/armv7/armv7_machdep.c b/sys/arch/armv7/armv7/armv7_machdep.c
index f62e8e91a6f..fc3839d74d6 100644
--- a/sys/arch/armv7/armv7/armv7_machdep.c
+++ b/sys/arch/armv7/armv7/armv7_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: armv7_machdep.c,v 1.43 2016/10/08 17:02:48 tom Exp $ */
+/* $OpenBSD: armv7_machdep.c,v 1.44 2016/10/09 00:53:43 jsg Exp $ */
/* $NetBSD: lubbock_machdep.c,v 1.2 2003/07/15 00:25:06 lukem Exp $ */
/*
@@ -219,6 +219,7 @@ int comcnmode = CONMODE;
int stdout_node = 0;
void (*cpuresetfn)(void);
+void (*powerdownfn)(void);
/*
* void boot(int howto, char *bootstr)
@@ -274,7 +275,8 @@ haltsys:
if ((howto & RB_POWERDOWN) != 0) {
printf("\nAttempting to power down...\n");
delay(500000);
- platform_powerdown();
+ if (powerdownfn)
+ (*powerdownfn)();
}
printf("The operating system has halted.\n");
diff --git a/sys/arch/armv7/armv7/armv7_machdep.h b/sys/arch/armv7/armv7/armv7_machdep.h
index 1dc1b82f4a4..e9492bbea8d 100644
--- a/sys/arch/armv7/armv7/armv7_machdep.h
+++ b/sys/arch/armv7/armv7/armv7_machdep.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: armv7_machdep.h,v 1.10 2016/10/05 07:29:59 patrick Exp $ */
+/* $OpenBSD: armv7_machdep.h,v 1.11 2016/10/09 00:53:43 jsg Exp $ */
/*
* Copyright (c) 2013 Sylvestre Gallon <ccna.syl@gmail.com>
*
@@ -29,6 +29,7 @@ void platform_disable_l2_if_needed(void);
struct board_dev *platform_board_devs();
void *fdt_find_cons(const char *);
extern void (*cpuresetfn)(void);
+extern void (*powerdownfn)(void);
struct armv7_platform {
struct board_dev *devs;
diff --git a/sys/arch/armv7/armv7/platform.c b/sys/arch/armv7/armv7/platform.c
index 7954b7f34a7..f0927faa900 100644
--- a/sys/arch/armv7/armv7/platform.c
+++ b/sys/arch/armv7/armv7/platform.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: platform.c,v 1.16 2016/10/05 22:06:48 kettenis Exp $ */
+/* $OpenBSD: platform.c,v 1.17 2016/10/09 00:53:43 jsg Exp $ */
/*
* Copyright (c) 2014 Patrick Wildt <patrick@blueri.se>
*
@@ -81,6 +81,7 @@ platform_init(void)
return;
cpuresetfn = platform_watchdog_reset;
+ powerdownfn = platform_powerdown;
if (platform->board_init)
platform->board_init();
}