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

Quelle  ptrace-fpu.c   Sprache: C

 
// SPDX-License-Identifier: GPL-2.0-or-later

#include <linux/regset.h>

#include <asm/switch_to.h>

#include "ptrace-decl.h"

int ptrace_get_fpr(struct task_struct *child, int index, unsigned long *data)
{
#ifdef CONFIG_PPC_FPU_REGS
 unsigned int fpidx = index - PT_FPR0;
#endif

 if (index > PT_FPSCR)
  return -EIO;

#ifdef CONFIG_PPC_FPU_REGS
 flush_fp_to_thread(child);
 if (fpidx < (PT_FPSCR - PT_FPR0)) {
  if (IS_ENABLED(CONFIG_PPC32))
   // On 32-bit the index we are passed refers to 32-bit words
   *data = ((u32 *)child->thread.fp_state.fpr)[fpidx];
  else
   memcpy(data, &child->thread.TS_FPR(fpidx), sizeof(long));
 } else
  *data = child->thread.fp_state.fpscr;
#else
 *data = 0;
#endif

 return 0;
}

int ptrace_put_fpr(struct task_struct *child, int index, unsigned long data)
{
#ifdef CONFIG_PPC_FPU_REGS
 unsigned int fpidx = index - PT_FPR0;
#endif

 if (index > PT_FPSCR)
  return -EIO;

#ifdef CONFIG_PPC_FPU_REGS
 flush_fp_to_thread(child);
 if (fpidx < (PT_FPSCR - PT_FPR0)) {
  if (IS_ENABLED(CONFIG_PPC32))
   // On 32-bit the index we are passed refers to 32-bit words
   ((u32 *)child->thread.fp_state.fpr)[fpidx] = data;
  else
   memcpy(&child->thread.TS_FPR(fpidx), &data, sizeof(long));
 } else
  child->thread.fp_state.fpscr = data;
#endif

 return 0;
}


Messung V0.5
C=89 H=83 G=85

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