Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/C/Linux/arch/mips/jazz/   (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
/*
 * Reset a Jazz machine.
 *
 * We don't trust the firmware so we do it the classic way by poking and
 * stabbing at the keyboard controller ...
 */

#include <linux/jiffies.h>
#include <asm/jazz.h>

#define KBD_STAT_IBF  0x02 /* Keyboard input buffer full */

static void jazz_write_output(unsigned char val)
{
 int status;

 do {
  status = jazz_kh->command;
 } while (status & KBD_STAT_IBF);
 jazz_kh->data = val;
}

static void jazz_write_command(unsigned char val)
{
 int status;

 do {
  status = jazz_kh->command;
 } while (status & KBD_STAT_IBF);
 jazz_kh->command = val;
}

static unsigned char jazz_read_status(void)
{
 return jazz_kh->command;
}

static inline void kb_wait(void)
{
 unsigned long start = jiffies;
 unsigned long timeout = start + HZ/2;

 do {
  if (! (jazz_read_status() & 0x02))
   return;
 } while (time_before_eq(jiffies, timeout));
}

void jazz_machine_restart(char *command)
{
 while(1) {
  kb_wait();
  jazz_write_command(0xd1);
  kb_wait();
  jazz_write_output(0x00);
 }
}

Messung V0.5
C=97 H=91 G=93

¤ Dauer der Verarbeitung: 0.3 Sekunden  ¤

*© 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.