1/* $NetBSD: rf_dagfuncs.h,v 1.10 2006/01/09 01:33:27 oster 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@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
38int rf_ConfigureDAGFuncs(RF_ShutdownList_t ** listp);
39int rf_TerminateFunc(RF_DagNode_t * node);
40int rf_TerminateUndoFunc(RF_DagNode_t * node);
41int rf_DiskReadMirrorIdleFunc(RF_DagNode_t * node);
42int rf_DiskReadMirrorPartitionFunc(RF_DagNode_t * node);
43int rf_DiskReadMirrorUndoFunc(RF_DagNode_t * node);
44int rf_ParityLogUpdateFunc(RF_DagNode_t * node);
45int rf_ParityLogOverwriteFunc(RF_DagNode_t * node);
46int rf_ParityLogUpdateUndoFunc(RF_DagNode_t * node);
47int rf_ParityLogOverwriteUndoFunc(RF_DagNode_t * node);
48int rf_NullNodeFunc(RF_DagNode_t * node);
49int rf_NullNodeUndoFunc(RF_DagNode_t * node);
50int rf_DiskReadFuncForThreads(RF_DagNode_t * node);
51int rf_DiskWriteFuncForThreads(RF_DagNode_t * node);
52int rf_DiskUndoFunc(RF_DagNode_t * node);
53int rf_GenericWakeupFunc(RF_DagNode_t * node, int status);
54int rf_RegularXorFunc(RF_DagNode_t * node);
55int rf_SimpleXorFunc(RF_DagNode_t * node);
56int rf_RecoveryXorFunc(RF_DagNode_t * node);
57int
58rf_XorIntoBuffer(RF_Raid_t * raidPtr, RF_PhysDiskAddr_t * pda, char *srcbuf,
59 char *targbuf);
60int rf_bxor(char *src, char *dest, int len);
61int
62rf_longword_bxor(unsigned long *src, unsigned long *dest, int len);
63int
64rf_longword_bxor3(unsigned long *dest, unsigned long *a, unsigned long *b,
65 unsigned long *c, int len, void *bp);
66int
67rf_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() */
71extern int (*rf_DiskReadFunc) (RF_DagNode_t *);
72extern int (*rf_DiskWriteFunc) (RF_DagNode_t *);
73extern int (*rf_DiskReadUndoFunc) (RF_DagNode_t *);
74extern int (*rf_DiskWriteUndoFunc) (RF_DagNode_t *);
75extern int (*rf_SimpleXorUndoFunc) (RF_DagNode_t *);
76extern int (*rf_RegularXorUndoFunc) (RF_DagNode_t *);
77extern int (*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