~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/sh/kernel/reboot.c

Version: ~ [ linux-5.13-rc2 ] ~ [ linux-5.12.4 ] ~ [ linux-5.11.21 ] ~ [ linux-5.10.37 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.119 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.190 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.232 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.268 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.268 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.18.140 ] ~ [ linux-3.16.85 ] ~ [ linux-3.14.79 ] ~ [ linux-3.12.74 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 #include <linux/pm.h>
  2 #include <linux/kexec.h>
  3 #include <linux/kernel.h>
  4 #include <linux/reboot.h>
  5 #include <linux/module.h>
  6 #ifdef CONFIG_SUPERH32
  7 #include <asm/watchdog.h>
  8 #endif
  9 #include <asm/addrspace.h>
 10 #include <asm/reboot.h>
 11 #include <asm/tlbflush.h>
 12 #include <asm/traps.h>
 13 
 14 void (*pm_power_off)(void);
 15 EXPORT_SYMBOL(pm_power_off);
 16 
 17 #ifdef CONFIG_SUPERH32
 18 static void watchdog_trigger_immediate(void)
 19 {
 20         sh_wdt_write_cnt(0xFF);
 21         sh_wdt_write_csr(0xC2);
 22 }
 23 #endif
 24 
 25 static void native_machine_restart(char * __unused)
 26 {
 27         local_irq_disable();
 28 
 29         /* Destroy all of the TLBs in preparation for reset by MMU */
 30         __flush_tlb_global();
 31 
 32         /* Address error with SR.BL=1 first. */
 33         trigger_address_error();
 34 
 35 #ifdef CONFIG_SUPERH32
 36         /* If that fails or is unsupported, go for the watchdog next. */
 37         watchdog_trigger_immediate();
 38 #endif
 39 
 40         /*
 41          * Give up and sleep.
 42          */
 43         while (1)
 44                 cpu_sleep();
 45 }
 46 
 47 static void native_machine_shutdown(void)
 48 {
 49         smp_send_stop();
 50 }
 51 
 52 static void native_machine_power_off(void)
 53 {
 54         if (pm_power_off)
 55                 pm_power_off();
 56 }
 57 
 58 static void native_machine_halt(void)
 59 {
 60         /* stop other cpus */
 61         machine_shutdown();
 62 
 63         /* stop this cpu */
 64         stop_this_cpu(NULL);
 65 }
 66 
 67 struct machine_ops machine_ops = {
 68         .power_off      = native_machine_power_off,
 69         .shutdown       = native_machine_shutdown,
 70         .restart        = native_machine_restart,
 71         .halt           = native_machine_halt,
 72 #ifdef CONFIG_KEXEC
 73         .crash_shutdown = native_machine_crash_shutdown,
 74 #endif
 75 };
 76 
 77 void machine_power_off(void)
 78 {
 79         machine_ops.power_off();
 80 }
 81 
 82 void machine_shutdown(void)
 83 {
 84         machine_ops.shutdown();
 85 }
 86 
 87 void machine_restart(char *cmd)
 88 {
 89         machine_ops.restart(cmd);
 90 }
 91 
 92 void machine_halt(void)
 93 {
 94         machine_ops.halt();
 95 }
 96 
 97 #ifdef CONFIG_KEXEC
 98 void machine_crash_shutdown(struct pt_regs *regs)
 99 {
100         machine_ops.crash_shutdown(regs);
101 }
102 #endif
103 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp