Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Linux/drivers/gpu/drm/i915/gt/   (Open Source Betriebssystem Version 6.17.9©)  Datei vom 24.10.2025 mit Größe 1 kB image not shown  

Quelle  st_shmem_utils.c   Sprache: C

 
// SPDX-License-Identifier: MIT
/*
 * Copyright © 2020 Intel Corporation
 */


/* Just a quick and causal check of the shmem_utils API */

static int igt_shmem_basic(void *ignored)
{
 u32 datum = 0xdeadbeef, result;
 struct file *file;
 u32 *map;
 int err;

 file = shmem_create_from_data("mock", &datum, sizeof(datum));
 if (IS_ERR(file))
  return PTR_ERR(file);

 result = 0;
 err = shmem_read(file, 0, &result, sizeof(result));
 if (err)
  goto out_file;

 if (result != datum) {
  pr_err("Incorrect read back from shmemfs: %x != %x\n",
         result, datum);
  err = -EINVAL;
  goto out_file;
 }

 result = 0xc0ffee;
 err = shmem_write(file, 0, &result, sizeof(result));
 if (err)
  goto out_file;

 map = shmem_pin_map(file);
 if (!map) {
  err = -ENOMEM;
  goto out_file;
 }

 if (*map != result) {
  pr_err("Incorrect read back via mmap of last write: %x != %x\n",
         *map, result);
  err = -EINVAL;
  goto out_map;
 }

out_map:
 shmem_unpin_map(file, map);
out_file:
 fput(file);
 return err;
}

int shmem_utils_mock_selftests(void)
{
 static const struct i915_subtest tests[] = {
  SUBTEST(igt_shmem_basic),
 };

 return i915_subtests(tests, NULL);
}

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

¤ 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.