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

Quelle  physaddr.c   Sprache: C

 
// SPDX-License-Identifier: GPL-2.0

#include <linux/types.h>
#include <linux/mmdebug.h>
#include <linux/mm.h>
#include <asm/page.h>
#include <asm/sections.h>

phys_addr_t __virt_to_phys(unsigned long x)
{
 /*
 * Boundary checking aginst the kernel linear mapping space.
 */

 WARN(!is_linear_mapping(x) && !is_kernel_mapping(x),
      "virt_to_phys used for non-linear address: %p (%pS)\n",
      (void *)x, (void *)x);

 return __va_to_pa_nodebug(x);
}
EXPORT_SYMBOL(__virt_to_phys);

phys_addr_t __phys_addr_symbol(unsigned long x)
{
 unsigned long kernel_start = kernel_map.virt_addr;
 unsigned long kernel_end = kernel_start + kernel_map.size;

 /*
 * Boundary checking aginst the kernel image mapping.
 * __pa_symbol should only be used on kernel symbol addresses.
 */

 VIRTUAL_BUG_ON(x < kernel_start || x > kernel_end);

 return __va_to_pa_nodebug(x);
}
EXPORT_SYMBOL(__phys_addr_symbol);

phys_addr_t linear_mapping_va_to_pa(unsigned long x)
{
 BUG_ON(!kernel_map.va_pa_offset);

 return ((unsigned long)(x) - kernel_map.va_pa_offset);
}
EXPORT_SYMBOL(linear_mapping_va_to_pa);

void *linear_mapping_pa_to_va(unsigned long x)
{
 BUG_ON(!kernel_map.va_pa_offset);

 return ((void *)((unsigned long)(x) + kernel_map.va_pa_offset));
}
EXPORT_SYMBOL(linear_mapping_pa_to_va);

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

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