Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/C/Linux/arch/loongarch/kernel/   (Open Source Betriebssystem Version 6.17.9©)  Datei vom 24.10.2025 mit Größe 1 kB image not shown  

Quelle  reset.c   Sprache: C

 
// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (C) 2020-2022 Loongson Technology Corporation Limited
 */

#include <linux/kernel.h>
#include <linux/acpi.h>
#include <linux/efi.h>
#include <linux/export.h>
#include <linux/pm.h>
#include <linux/types.h>
#include <linux/reboot.h>
#include <linux/delay.h>
#include <linux/console.h>

#include <acpi/reboot.h>
#include <asm/idle.h>
#include <asm/loongarch.h>
#include <asm/loongson.h>

void (*pm_power_off)(void);
EXPORT_SYMBOL(pm_power_off);

void machine_halt(void)
{
#ifdef CONFIG_SMP
 preempt_disable();
 smp_send_stop();
#endif
 local_irq_disable();
 clear_csr_ecfg(ECFG0_IM);

 pr_notice("\n\n** You can safely turn off the power now **\n\n");
 console_flush_on_panic(CONSOLE_FLUSH_PENDING);

 while (true) {
  __asm__ __volatile__("idle 0" : : : "memory");
 }
}

void machine_power_off(void)
{
#ifdef CONFIG_SMP
 preempt_disable();
 smp_send_stop();
#endif
#ifdef CONFIG_PM
 if (!acpi_disabled)
  enable_pci_wakeup();
#endif
 do_kernel_power_off();
#ifdef CONFIG_EFI
 efi.reset_system(EFI_RESET_SHUTDOWN, EFI_SUCCESS, 0, NULL);
#endif

 while (true) {
  __asm__ __volatile__("idle 0" : : : "memory");
 }
}

void machine_restart(char *command)
{
#ifdef CONFIG_SMP
 preempt_disable();
 smp_send_stop();
#endif
 do_kernel_restart(command);
#ifdef CONFIG_EFI
 if (efi_capsule_pending(NULL))
  efi_reboot(REBOOT_WARM, NULL);
 else
  efi_reboot(REBOOT_COLD, NULL);
#endif
 if (!acpi_disabled)
  acpi_reboot();

 while (true) {
  __asm__ __volatile__("idle 0" : : : "memory");
 }
}

Messung V0.5
C=92 H=52 G=74

¤ Dauer der Verarbeitung: 0.10 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.