From 668174e5d3ba8615c31aa88c5012eeac81186768 Mon Sep 17 00:00:00 2001 From: Jonathan Gray Date: Sun, 9 Oct 2016 00:53:44 +0000 Subject: Add a power down function pointer so power down can work without the platform abstraction. ok tom@ kettenis@ --- sys/arch/armv7/armv7/armv7_machdep.c | 6 ++++-- sys/arch/armv7/armv7/armv7_machdep.h | 3 ++- sys/arch/armv7/armv7/platform.c | 3 ++- 3 files changed, 8 insertions(+), 4 deletions(-) (limited to 'sys/arch') 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 * @@ -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 * @@ -81,6 +81,7 @@ platform_init(void) return; cpuresetfn = platform_watchdog_reset; + powerdownfn = platform_powerdown; if (platform->board_init) platform->board_init(); } -- cgit v1.2.3