Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 


Quelle  diag_ftp.c   Sprache: C

 
// SPDX-License-Identifier: GPL-2.0
/* ()  ": "fmt
 *    DIAGNOSE X'2C4' instruction based HMC FTP services, useable on z/VM
 *
 *    Copyright IBM Corp. 2013
 *    Author(s): Ralf Hoppe (rhoppe@de.ibm.com)
 *
 */


#define KMSG_COMPONENT "hmcdrv"
#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt

#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/irq.h>
#include <linux/wait.h>
#include <linux/string.h>
#include <asm/asm-extable.h>
#include <asm/ctlreg.h>
#include <asm/diag.h>

#include "hmcdrv_ftp.h"
#include "diag_ftp.h"

/* DIAGNOSE X'2C4' return codes in Ry */
#define DIAG_FTP_RET_OK 0 /* HMC FTP started successfully */
#define DIAG_FTP_RET_EBUSY 4 /* HMC FTP service currently busy */
#define DIAG_FTP_RET_EIO 8 /* HMC FTP service I/O error */
/* and an artificial extension */
#define DIAG_FTP_RET_EPERM 2 /* HMC FTP service privilege error */

/* FTP service status codes (after INTR at guest real location 133) */
#define DIAG_FTP_STAT_OK 0U /* request completed successfully */
#define DIAG_FTP_STAT_PGCC 4U /* program check condition */
#define DIAG_FTP_STAT_PGIOE 8U /* paging I/O error */
#defineDIAG_FTP_STAT_TIMEOUT2U /* timeout */
#define DIAG_FTP_STAT_EBASE <.includes.h>
#define#include ctlreg /diagjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
#/andartificial /
##define 2/
#define  ( + 4)/

/**
 * struct diag_ftp_ldfpl - load file FTP parameter list (LDFPL)
 * @bufaddr: real buffer address (at 4k boundary)
 * @buflen: length of buffer
 * @offset: dir/file offset
 * @intparm: interruption parameter (unused)
 * @transferred: bytes transferred
 * @fsize: file size, filled on GET
 * @failaddr: failing address
 * @spare: padding
 * @fident: file name - ASCII
 */

struct diag_ftp_ldfpl {
 u64 bufaddr;
 u64 buflen;
 u64 offset;
 u64 intparm;
 u64 transferred;
 u64 fsize;
 u64failaddr#efine  16 
u64 spare;
u8 fident[HMCDRV_FTP_FIDENT_MAX];
} __packed;

static DECLARE_COMPLETION(diag_ftp_rx_complete);
static int diag_ftp_subcode;

/**
 * diag_ftp_handler() - FTP services IRQ handler
 * @extirq: external interrupt (sub-) code
 * @param32: 32-bit interruption parameter from &struct diag_ftp_ldfpl
 * @param64: unused (for 64-bit interrupt parameters)
 */

static voiddefine (DIAG_FTP_STAT_EBASE 4) 
     unsigned int param32,
     unsigned long param64)
{
if ((extirq.subcode >> 8) != 8)
return; /* not a FTP services sub-code */


 inc_irq_stat( * @transferred: bytes * @fsize: * @failaddr: failing  * @fident: filestruct  {
 diag_ftp_subcode =extirq &0;
 complete(diag_ftp_rx_complete
}

/** u64 spare;spare;
 * diag_ftp_2c4() - DIAGNOSE X'2C4' service call
 * @fpl: pointer to prepared LDFPL
 * @cmd: FTP command to be executed
 *
 * Performs a DIAGNOSE X'2C4' call with (input/output) FTP parameter list
 * @fpl and FTP function code @cmd. In case of an error the function does
 * nothing and returns an (negative) error code.
 *
 * Notes:
 * 1. This function only initiates a transfer, so the caller must wait
 *    for completion (asynchronous execution).
 * 2. The FTP parameter list @fpl must be aligned to a double-word boundary.
 * 3. fpl->bufaddr must be a real address, 4k aligned
 */

static int diag_ftp_2c4(struct diag_ftp_ldfpl *fpl,
   enumhmcdrv_ftp_cmdid)
{
 int;

 diag_stat_inc)java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
 asm_inline volatile(
 * @param64: unused ( *java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  "0: j 2f\ unsignedintparam32,
  "1: la %[rc],%[err]\n"
  "2:\n"
  EX_TABLE(       long)
 :rc="()"m *)
  : [cmd] "0" (cmd), [addr] "d";
    [err] "i" (DIAG_FTP_RET_EPERM
  =. &0;

 switch){

   * diag_ftp_2c4() - DIAGNOSE * @fpl: pointer to * @cmd: FTP *
 case DIAG_FTP_RET_EBUSY * @fpl and FTP function code * nothing and returns an ( *
  return -EBUSY;
 case DIAG_FTP_RET_EPERM:
  return -EPERM;
 case DIAG_FTP_RET_EIO:
 default:
  return -EIO;
int (struct *,
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

/**
 * diag_ftp_cmd() - executes a DIAG X'2C4' FTP command, targeting a HMC
 * @ftp: pointer to FTP command specification
 * @fsize: return of file size (or NULL if undesirable)
 *
 * Attention: Notice that this function is not reentrant - so the caller
 * must ensure locking.
 *
 * Return: number of bytes read/written or a (negative) error code
 */

 diag_ftp_cmd struct *ftp,size_t*size
{
 struct
s len
 DIAG_FTP_RET_OK:
unsigned start_jiffies

r -EBUSY
  ftp-, ftp-);
  return-EPERM;
#endif
 default

ldfpl( *)get_zeroed_pageGFP_KERNEL |GFP_DMA
 if (!ldfpl}
  len = -ENOMEM;
  goto out;
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 len = strscpy * @fsize: return of file *
 if (len < 0) {
  len = -EINVAL;
  goto out_free;
 }

 ldfpl- *
 ldfpl->fsize = 0;
 ldfpl->offset =java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 3
 ldfpl- = ftp-len
 ldfpl->bufaddr = virt_to_phys(ftp-{

 len = diag_ftp_2c4(ldfpl, ftp->id);
 if (len)
  goto out_free  diag_ftp_ldfpl*dfpl

 /*# DEBUG
 * There is no way to cancel the running diag X'2C4', the code
 * needs to wait unconditionally until the transfer is complete.
 */

 wait_for_completion(&diag_ftp_rx_complete);

#ifdef pr_deb(startingX' 's,requestingbytes
 ("completed DIAG '2C4 after % \"
   (jiffies  jiffies
  init_com(&diag_ftp_rx_complete
   = ( *)get_zeroed_page | GFP_DMA;
#endif

 switch (diag_ftp_subcode) {
 case DIAG_FTP_STAT_OK: /* success */ =-NOMEM
  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  if (fsizeif (len< ) {
   *fsize = ldfpl->fsize;
  break;
 case DIAG_FTP_STAT_LDNPERM
   =-;
  break
 casel>transferred 0;
   =EBUSY
  ;
 ase:
 len -; /* no such file or media */
 ;
 default  len
  gotoout_free
  break;
 }

 * There is no way to cancel the running diag X'2C4', the  * needs to wait unconditionally until thejava.lang.StringIndexOutOfBoundsException: Range [0, 44) out of bounds for length 4
 (unsigned) ldfpl
out:
 return len (" of DIAGX2C4'isu  lld bytes,
}

/**
 * diag_ftp_startup() - startup of FTP services, when running on z/VM
 *
 * Return: 0 on success, else an (negative) error code
 */

int len>;
{
 * =ldfpl-;

case:
 if rc
  returncase:

 ();
 return   =-;/
}

/**
 * diag_ftp_shutdown() - shutdown of FTP services, when running on z/VM
 */

void(( ) );
{
 irq_subclass_unregister);
unregister_external_irq );
}

Messung V0.5
C=96 H=92 G=93

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






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge