Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame^] | 1 | // SPDX-License-Identifier: GPL-2.0 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | /* |
| 3 | * Reset a DECstation machine. |
| 4 | * |
| 5 | * Copyright (C) 199x the Anonymous |
| 6 | * Copyright (C) 2001, 2002, 2003 Maciej W. Rozycki |
| 7 | */ |
| 8 | #include <linux/interrupt.h> |
| 9 | #include <linux/linkage.h> |
| 10 | |
| 11 | #include <asm/addrspace.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 12 | |
Robert P. J. Day | b3f6df9 | 2007-05-25 14:32:28 -0400 | [diff] [blame] | 13 | typedef void __noreturn (* noret_func_t)(void); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 14 | |
Robert P. J. Day | b3f6df9 | 2007-05-25 14:32:28 -0400 | [diff] [blame] | 15 | static inline void __noreturn back_to_prom(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 16 | { |
Maciej W. Rozycki | 3bd4c90 | 2005-06-16 20:30:54 +0000 | [diff] [blame] | 17 | noret_func_t func = (void *)CKSEG1ADDR(0x1fc00000); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 18 | |
| 19 | func(); |
| 20 | } |
| 21 | |
Robert P. J. Day | b3f6df9 | 2007-05-25 14:32:28 -0400 | [diff] [blame] | 22 | void __noreturn dec_machine_restart(char *command) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 23 | { |
| 24 | back_to_prom(); |
| 25 | } |
| 26 | |
Robert P. J. Day | b3f6df9 | 2007-05-25 14:32:28 -0400 | [diff] [blame] | 27 | void __noreturn dec_machine_halt(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 28 | { |
| 29 | back_to_prom(); |
| 30 | } |
| 31 | |
Robert P. J. Day | b3f6df9 | 2007-05-25 14:32:28 -0400 | [diff] [blame] | 32 | void __noreturn dec_machine_power_off(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 33 | { |
| 34 | /* DECstations don't have a software power switch */ |
| 35 | back_to_prom(); |
| 36 | } |
| 37 | |
Ralf Baechle | d62801e | 2006-10-08 17:38:18 +0100 | [diff] [blame] | 38 | irqreturn_t dec_intr_halt(int irq, void *dev_id) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 39 | { |
| 40 | dec_machine_halt(); |
| 41 | } |