Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 


Quelle  cpufeature.c   Sprache: C

 
// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright IBM Corp. 2022
 */


#include <linux/cpufeature.h>
#include <linux/export.h>
#include <linux/bug.h>
#include <asm/machine.h>
#include <asm/elf.h>

enum {
 TYPE_HWCAP,
 TYPE_FACILITY,
 TYPE_MACHINE,
};

struct s390_cpu_feature {
 unsigned int type : 4;
 unsigned int num : 28;
};

static struct s390_cpu_feature s390_cpu_features[MAX_CPU_FEATURES] = {
 [S390_CPU_FEATURE_MSA] = {.type = TYPE_HWCAP, .num = HWCAP_NR_MSA},
 [S390_CPU_FEATURE_VXRS] = {.type = TYPE_HWCAP, .num = HWCAP_NR_VXRS},
 [S390_CPU_FEATURE_UV] = {.type = TYPE_FACILITY, .num = 158},
 [S390_CPU_FEATURE_D288] = {.type = TYPE_MACHINE, .num = MFEATURE_DIAG288},
};

/*
 * cpu_have_feature - Test CPU features on module initialization
 */

int cpu_have_feature(unsigned int num)
{
 struct s390_cpu_feature *feature;

 if (WARN_ON_ONCE(num >= MAX_CPU_FEATURES))
  return 0;
 feature = &s390_cpu_features[num];
 switch (feature->type) {
 case TYPE_HWCAP:
  return !!(elf_hwcap & BIT(feature->num));
 case TYPE_FACILITY:
  return test_facility(feature->num);
 case TYPE_MACHINE:
  return test_machine_feature(feature->num);
 default:
  WARN_ON_ONCE(1);
  return 0;
 }
}
EXPORT_SYMBOL(cpu_have_feature);

Messung V0.5
C=96 H=92 G=93

¤ Dauer der Verarbeitung: 0.2 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.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge