1 /* $NetBSD: rf_dagfuncs.h,v 1.9 2005/12/11 12:23:37 christos Exp $ */
3 * Copyright (c) 1995 Carnegie-Mellon University.
6 * Author: Mark Holland, William V. Courtright II, Jim Zelenka
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.
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.
18 * Carnegie Mellon requests users of this software to return to
20 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
21 * School of Computer Science
22 * Carnegie Mellon University
23 * Pittsburgh PA 15213-3890
25 * any improvements or extensions that they make and grant Carnegie the
26 * rights to redistribute these changes.
29 /*****************************************************************************************
31 * dagfuncs.h -- header file for DAG node execution routines
33 ****************************************************************************************/
35 #ifndef _RF__RF_DAGFUNCS_H_
36 #define _RF__RF_DAGFUNCS_H_
38 int rf_ConfigureDAGFuncs(RF_ShutdownList_t
** listp
);
39 int rf_TerminateFunc(RF_DagNode_t
* node
);
40 int rf_TerminateUndoFunc(RF_DagNode_t
* node
);
41 int rf_DiskReadMirrorIdleFunc(RF_DagNode_t
* node
);
42 int rf_DiskReadMirrorPartitionFunc(RF_DagNode_t
* node
);
43 int rf_DiskReadMirrorUndoFunc(RF_DagNode_t
* node
);
44 int rf_ParityLogUpdateFunc(RF_DagNode_t
* node
);
45 int rf_ParityLogOverwriteFunc(RF_DagNode_t
* node
);
46 int rf_ParityLogUpdateUndoFunc(RF_DagNode_t
* node
);
47 int rf_ParityLogOverwriteUndoFunc(RF_DagNode_t
* node
);
48 int rf_NullNodeFunc(RF_DagNode_t
* node
);
49 int rf_NullNodeUndoFunc(RF_DagNode_t
* node
);
50 int rf_DiskReadFuncForThreads(RF_DagNode_t
* node
);
51 int rf_DiskWriteFuncForThreads(RF_DagNode_t
* node
);
52 int rf_DiskUndoFunc(RF_DagNode_t
* node
);
53 int rf_GenericWakeupFunc(RF_DagNode_t
* node
, int status
);
54 int rf_RegularXorFunc(RF_DagNode_t
* node
);
55 int rf_SimpleXorFunc(RF_DagNode_t
* node
);
56 int rf_RecoveryXorFunc(RF_DagNode_t
* node
);
58 rf_XorIntoBuffer(RF_Raid_t
* raidPtr
, RF_PhysDiskAddr_t
* pda
, char *srcbuf
,
60 int rf_bxor(char *src
, char *dest
, int len
);
62 rf_longword_bxor(unsigned long *src
, unsigned long *dest
, int len
);
64 rf_longword_bxor3(unsigned long *dest
, unsigned long *a
, unsigned long *b
,
65 unsigned long *c
, int len
, void *bp
);
67 rf_bxor3(unsigned char *dst
, unsigned char *a
, unsigned char *b
,
68 unsigned char *c
, unsigned long len
, void *bp
);
70 /* function ptrs defined in ConfigureDAGFuncs() */
71 extern int (*rf_DiskReadFunc
) (RF_DagNode_t
*);
72 extern int (*rf_DiskWriteFunc
) (RF_DagNode_t
*);
73 extern int (*rf_DiskReadUndoFunc
) (RF_DagNode_t
*);
74 extern int (*rf_DiskWriteUndoFunc
) (RF_DagNode_t
*);
75 extern int (*rf_SimpleXorUndoFunc
) (RF_DagNode_t
*);
76 extern int (*rf_RegularXorUndoFunc
) (RF_DagNode_t
*);
77 extern int (*rf_RecoveryXorUndoFunc
) (RF_DagNode_t
*);
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)
84 #endif /* !_RF__RF_DAGFUNCS_H_ */