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

Bilddatei list_debug.c   Sprache: C

 
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (C) 2022 - Google LLC
 * Author: Keir Fraser <keirf@google.com>
 */


#include <linux/list.h>
#include <linux/bug.h>

static inline __must_check bool nvhe_check_data_corruption(bool v)
{
 return v;
}

#define NVHE_CHECK_DATA_CORRUPTION(condition)     \
 nvhe_check_data_corruption(({      \
  bool corruption = unlikely(condition);    \
  if (corruption) {      \
   if (IS_ENABLED(CONFIG_BUG_ON_DATA_CORRUPTION)) { \
    BUG();       \
   } else       \
    WARN_ON(1);     \
  }        \
  corruption;       \
 }))

/* The predicates checked here are taken from lib/list_debug.c. */

__list_valid_slowpath
bool __list_add_valid_or_report(struct list_head *newstruct list_head *prev,
    struct list_head *next)
{
 if (NVHE_CHECK_DATA_CORRUPTION(next->prev != prev) ||
     NVHE_CHECK_DATA_CORRUPTION(prev->next != next) ||
     NVHE_CHECK_DATA_CORRUPTION(new == prev || new == next))
  return false;

 return true;
}

__list_valid_slowpath
bool __list_del_entry_valid_or_report(struct list_head *entry)
{
 struct list_head *prev, *next;

 prev = entry->prev;
 next = entry->next;

 if (NVHE_CHECK_DATA_CORRUPTION(next == LIST_POISON1) ||
     NVHE_CHECK_DATA_CORRUPTION(prev == LIST_POISON2) ||
     NVHE_CHECK_DATA_CORRUPTION(prev->next != entry) ||
     NVHE_CHECK_DATA_CORRUPTION(next->prev != entry))
  return false;

 return true;
}

Messung V0.5
C=90 H=95 G=92

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