Home | History | Annotate | Line # | Download | only in raidframe
      1 /*	$NetBSD: rf_dagfuncs.h,v 1.11 2019/10/10 03:43:59 christos Exp $	*/
      2 /*
      3  * Copyright (c) 1995 Carnegie-Mellon University.
      4  * All rights reserved.
      5  *
      6  * Author: Mark Holland, William V. Courtright II, Jim Zelenka
      7  *
      8  * Permission to use, copy, modify and distribute this software and
      9  * its documentation is hereby granted, provided that both the copyright
     10  * notice and this permission notice appear in all copies of the
     11  * software, derivative works or modified versions, and any portions
     12  * thereof, and that both notices appear in supporting documentation.
     13  *
     14  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
     15  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
     16  * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
     17  *
     18  * Carnegie Mellon requests users of this software to return to
     19  *
     20  *  Software Distribution Coordinator  or  Software.Distribution (at) CS.CMU.EDU
     21  *  School of Computer Science
     22  *  Carnegie Mellon University
     23  *  Pittsburgh PA 15213-3890
     24  *
     25  * any improvements or extensions that they make and grant Carnegie the
     26  * rights to redistribute these changes.
     27  */
     28 
     29 /*****************************************************************************************
     30  *
     31  * dagfuncs.h -- header file for DAG node execution routines
     32  *
     33  ****************************************************************************************/
     34 
     35 #ifndef _RF__RF_DAGFUNCS_H_
     36 #define _RF__RF_DAGFUNCS_H_
     37 
     38 int     rf_ConfigureDAGFuncs(RF_ShutdownList_t ** listp);
     39 void    rf_TerminateFunc(RF_DagNode_t * node);
     40 void    rf_TerminateUndoFunc(RF_DagNode_t * node);
     41 void    rf_DiskReadMirrorIdleFunc(RF_DagNode_t * node);
     42 void    rf_DiskReadMirrorPartitionFunc(RF_DagNode_t * node);
     43 void    rf_DiskReadMirrorUndoFunc(RF_DagNode_t * node);
     44 void    rf_ParityLogUpdateFunc(RF_DagNode_t * node);
     45 void    rf_ParityLogOverwriteFunc(RF_DagNode_t * node);
     46 void    rf_ParityLogUpdateUndoFunc(RF_DagNode_t * node);
     47 void    rf_ParityLogOverwriteUndoFunc(RF_DagNode_t * node);
     48 void    rf_NullNodeFunc(RF_DagNode_t * node);
     49 void    rf_NullNodeUndoFunc(RF_DagNode_t * node);
     50 void    rf_DiskReadFuncForThreads(RF_DagNode_t * node);
     51 void    rf_DiskWriteFuncForThreads(RF_DagNode_t * node);
     52 void    rf_DiskUndoFunc(RF_DagNode_t * node);
     53 void    rf_GenericWakeupFunc(void *, int);
     54 void    rf_RegularXorFunc(RF_DagNode_t * node);
     55 void    rf_SimpleXorFunc(RF_DagNode_t * node);
     56 void    rf_RecoveryXorFunc(RF_DagNode_t * node);
     57 int
     58 rf_XorIntoBuffer(RF_Raid_t * raidPtr, RF_PhysDiskAddr_t * pda, char *srcbuf,
     59 		 char *targbuf);
     60 int     rf_bxor(char *src, char *dest, int len);
     61 int
     62 rf_longword_bxor(unsigned long *src, unsigned long *dest, int len);
     63 int
     64 rf_longword_bxor3(unsigned long *dest, unsigned long *a, unsigned long *b,
     65 		  unsigned long *c, int len, void *bp);
     66 int
     67 rf_bxor3(unsigned char *dst, unsigned char *a, unsigned char *b,
     68     unsigned char *c, unsigned long len, void *bp);
     69 
     70 /* function ptrs defined in ConfigureDAGFuncs() */
     71 extern void (*rf_DiskReadFunc) (RF_DagNode_t *);
     72 extern void (*rf_DiskWriteFunc) (RF_DagNode_t *);
     73 extern void (*rf_DiskReadUndoFunc) (RF_DagNode_t *);
     74 extern void (*rf_DiskWriteUndoFunc) (RF_DagNode_t *);
     75 extern void (*rf_SimpleXorUndoFunc) (RF_DagNode_t *);
     76 extern void (*rf_RegularXorUndoFunc) (RF_DagNode_t *);
     77 extern void (*rf_RecoveryXorUndoFunc) (RF_DagNode_t *);
     78 
     79 /* macros for manipulating the param[3] in a read or write node */
     80 #define RF_CREATE_PARAM3(pri, wru) (((RF_uint64)(((wru&0xFFFFFF)<<8)|((pri)&0xF)) ))
     81 #define RF_EXTRACT_PRIORITY(_x_)     ((((unsigned) ((unsigned long)(_x_))) >> 0) & 0x0F)
     82 #define RF_EXTRACT_RU(_x_)           ((((unsigned) ((unsigned long)(_x_))) >> 8) & 0xFFFFFF)
     83 
     84 #endif				/* !_RF__RF_DAGFUNCS_H_ */
     85