Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/C/Linux/arch/powerpc/platforms/cell/spufs/   (Open Source Betriebssystem Version 6.17.9©)  Datei vom 24.10.2025 mit Größe 982 B image not shown  

Quelle  lscsa_alloc.c   Sprache: C

 
// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * SPU local store allocation routines
 *
 * Copyright 2007 Benjamin Herrenschmidt, IBM Corp.
 */


#undef DEBUG

#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>

#include <asm/spu.h>
#include <asm/spu_csa.h>
#include <asm/mmu.h>

#include "spufs.h"

int spu_alloc_lscsa(struct spu_state *csa)
{
 struct spu_lscsa *lscsa;
 unsigned char *p;

 lscsa = vzalloc(sizeof(*lscsa));
 if (!lscsa)
  return -ENOMEM;
 csa->lscsa = lscsa;

 /* Set LS pages reserved to allow for user-space mapping. */
 for (p = lscsa->ls; p < lscsa->ls + LS_SIZE; p += PAGE_SIZE)
  SetPageReserved(vmalloc_to_page(p));

 return 0;
}

void spu_free_lscsa(struct spu_state *csa)
{
 /* Clear reserved bit before vfree. */
 unsigned char *p;

 if (csa->lscsa == NULL)
  return;

 for (p = csa->lscsa->ls; p < csa->lscsa->ls + LS_SIZE; p += PAGE_SIZE)
  ClearPageReserved(vmalloc_to_page(p));

 vfree(csa->lscsa);
}

Messung V0.5
C=93 H=50 G=74

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