rf_dagfuncs.h revision 1.1 1 1.1 oster /* $NetBSD: rf_dagfuncs.h,v 1.1 1998/11/13 04:20:28 oster Exp $ */
2 1.1 oster /*
3 1.1 oster * Copyright (c) 1995 Carnegie-Mellon University.
4 1.1 oster * All rights reserved.
5 1.1 oster *
6 1.1 oster * Author: Mark Holland, William V. Courtright II, Jim Zelenka
7 1.1 oster *
8 1.1 oster * Permission to use, copy, modify and distribute this software and
9 1.1 oster * its documentation is hereby granted, provided that both the copyright
10 1.1 oster * notice and this permission notice appear in all copies of the
11 1.1 oster * software, derivative works or modified versions, and any portions
12 1.1 oster * thereof, and that both notices appear in supporting documentation.
13 1.1 oster *
14 1.1 oster * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
15 1.1 oster * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
16 1.1 oster * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
17 1.1 oster *
18 1.1 oster * Carnegie Mellon requests users of this software to return to
19 1.1 oster *
20 1.1 oster * Software Distribution Coordinator or Software.Distribution (at) CS.CMU.EDU
21 1.1 oster * School of Computer Science
22 1.1 oster * Carnegie Mellon University
23 1.1 oster * Pittsburgh PA 15213-3890
24 1.1 oster *
25 1.1 oster * any improvements or extensions that they make and grant Carnegie the
26 1.1 oster * rights to redistribute these changes.
27 1.1 oster */
28 1.1 oster
29 1.1 oster /*****************************************************************************************
30 1.1 oster *
31 1.1 oster * dagfuncs.h -- header file for DAG node execution routines
32 1.1 oster *
33 1.1 oster ****************************************************************************************/
34 1.1 oster
35 1.1 oster /*
36 1.1 oster * :
37 1.1 oster * Log: rf_dagfuncs.h,v
38 1.1 oster * Revision 1.17 1996/07/22 19:52:16 jimz
39 1.1 oster * switched node params to RF_DagParam_t, a union of
40 1.1 oster * a 64-bit int and a void *, for better portability
41 1.1 oster * attempted hpux port, but failed partway through for
42 1.1 oster * lack of a single C compiler capable of compiling all
43 1.1 oster * source files
44 1.1 oster *
45 1.1 oster * Revision 1.16 1996/06/10 11:55:47 jimz
46 1.1 oster * Straightened out some per-array/not-per-array distinctions, fixed
47 1.1 oster * a couple bugs related to confusion. Added shutdown lists. Removed
48 1.1 oster * layout shutdown function (now subsumed by shutdown lists).
49 1.1 oster *
50 1.1 oster * Revision 1.15 1996/06/06 17:27:20 jimz
51 1.1 oster * added another read mirror func (partitioning), changed names so dag
52 1.1 oster * creation routines can use the appropriate one
53 1.1 oster *
54 1.1 oster * Revision 1.14 1996/05/30 11:29:41 jimz
55 1.1 oster * Numerous bug fixes. Stripe lock release code disagreed with the taking code
56 1.1 oster * about when stripes should be locked (I made it consistent: no parity, no lock)
57 1.1 oster * There was a lot of extra serialization of I/Os which I've removed- a lot of
58 1.1 oster * it was to calculate values for the cache code, which is no longer with us.
59 1.1 oster * More types, function, macro cleanup. Added code to properly quiesce the array
60 1.1 oster * on shutdown. Made a lot of stuff array-specific which was (bogusly) general
61 1.1 oster * before. Fixed memory allocation, freeing bugs.
62 1.1 oster *
63 1.1 oster * Revision 1.13 1996/05/24 22:17:04 jimz
64 1.1 oster * continue code + namespace cleanup
65 1.1 oster * typed a bunch of flags
66 1.1 oster *
67 1.1 oster * Revision 1.12 1996/05/24 04:28:55 jimz
68 1.1 oster * release cleanup ckpt
69 1.1 oster *
70 1.1 oster * Revision 1.11 1996/05/23 21:46:35 jimz
71 1.1 oster * checkpoint in code cleanup (release prep)
72 1.1 oster * lots of types, function names have been fixed
73 1.1 oster *
74 1.1 oster * Revision 1.10 1996/05/18 19:51:34 jimz
75 1.1 oster * major code cleanup- fix syntax, make some types consistent,
76 1.1 oster * add prototypes, clean out dead code, et cetera
77 1.1 oster *
78 1.1 oster * Revision 1.9 1995/12/01 15:56:46 root
79 1.1 oster * added copyright info
80 1.1 oster *
81 1.1 oster * Revision 1.8 1995/11/07 16:25:23 wvcii
82 1.1 oster * added DiskUnlockFuncForThreads
83 1.1 oster *
84 1.1 oster */
85 1.1 oster
86 1.1 oster #ifndef _RF__RF_DAGFUNCS_H_
87 1.1 oster #define _RF__RF_DAGFUNCS_H_
88 1.1 oster
89 1.1 oster int rf_ConfigureDAGFuncs(RF_ShutdownList_t **listp);
90 1.1 oster int rf_TerminateFunc(RF_DagNode_t *node);
91 1.1 oster int rf_TerminateUndoFunc(RF_DagNode_t *node);
92 1.1 oster int rf_DiskReadMirrorIdleFunc(RF_DagNode_t *node);
93 1.1 oster int rf_DiskReadMirrorPartitionFunc(RF_DagNode_t *node);
94 1.1 oster int rf_DiskReadMirrorUndoFunc(RF_DagNode_t *node);
95 1.1 oster int rf_ParityLogUpdateFunc(RF_DagNode_t *node);
96 1.1 oster int rf_ParityLogOverwriteFunc(RF_DagNode_t *node);
97 1.1 oster int rf_ParityLogUpdateUndoFunc(RF_DagNode_t *node);
98 1.1 oster int rf_ParityLogOverwriteUndoFunc(RF_DagNode_t *node);
99 1.1 oster int rf_NullNodeFunc(RF_DagNode_t *node);
100 1.1 oster int rf_NullNodeUndoFunc(RF_DagNode_t *node);
101 1.1 oster int rf_DiskReadFuncForThreads(RF_DagNode_t *node);
102 1.1 oster int rf_DiskWriteFuncForThreads(RF_DagNode_t *node);
103 1.1 oster int rf_DiskUndoFunc(RF_DagNode_t *node);
104 1.1 oster int rf_DiskUnlockFuncForThreads(RF_DagNode_t *node);
105 1.1 oster int rf_GenericWakeupFunc(RF_DagNode_t *node, int status);
106 1.1 oster int rf_RegularXorFunc(RF_DagNode_t *node);
107 1.1 oster int rf_SimpleXorFunc(RF_DagNode_t *node);
108 1.1 oster int rf_RecoveryXorFunc(RF_DagNode_t *node);
109 1.1 oster int rf_XorIntoBuffer(RF_Raid_t *raidPtr, RF_PhysDiskAddr_t *pda, char *srcbuf,
110 1.1 oster char *targbuf, void *bp);
111 1.1 oster int rf_bxor(char *src, char *dest, int len, void *bp);
112 1.1 oster int rf_longword_bxor(register unsigned long *src, register unsigned long *dest,
113 1.1 oster int len, void *bp);
114 1.1 oster int rf_longword_bxor3(register unsigned long *dest, register unsigned long *a,
115 1.1 oster register unsigned long *b, register unsigned long *c, int len, void *bp);
116 1.1 oster int rf_bxor3(unsigned char *dst, unsigned char *a, unsigned char *b,
117 1.1 oster unsigned char *c, unsigned long len, void *bp);
118 1.1 oster
119 1.1 oster /* function ptrs defined in ConfigureDAGFuncs() */
120 1.1 oster extern int (*rf_DiskReadFunc)(RF_DagNode_t *);
121 1.1 oster extern int (*rf_DiskWriteFunc)(RF_DagNode_t *);
122 1.1 oster extern int (*rf_DiskReadUndoFunc)(RF_DagNode_t *);
123 1.1 oster extern int (*rf_DiskWriteUndoFunc)(RF_DagNode_t *);
124 1.1 oster extern int (*rf_DiskUnlockFunc)(RF_DagNode_t *);
125 1.1 oster extern int (*rf_DiskUnlockUndoFunc)(RF_DagNode_t *);
126 1.1 oster extern int (*rf_SimpleXorUndoFunc)(RF_DagNode_t *);
127 1.1 oster extern int (*rf_RegularXorUndoFunc)(RF_DagNode_t *);
128 1.1 oster extern int (*rf_RecoveryXorUndoFunc)(RF_DagNode_t *);
129 1.1 oster
130 1.1 oster /* macros for manipulating the param[3] in a read or write node */
131 1.1 oster #define RF_CREATE_PARAM3(pri, lk, unlk, wru) (((RF_uint64)(((wru&0xFFFFFF)<<8)|((lk)?0x10:0)|((unlk)?0x20:0)|((pri)&0xF)) ))
132 1.1 oster #define RF_EXTRACT_PRIORITY(_x_) ((((unsigned) ((unsigned long)(_x_))) >> 0) & 0x0F)
133 1.1 oster #define RF_EXTRACT_LOCK_FLAG(_x_) ((((unsigned) ((unsigned long)(_x_))) >> 4) & 0x1)
134 1.1 oster #define RF_EXTRACT_UNLOCK_FLAG(_x_) ((((unsigned) ((unsigned long)(_x_))) >> 5) & 0x1)
135 1.1 oster #define RF_EXTRACT_RU(_x_) ((((unsigned) ((unsigned long)(_x_))) >> 8) & 0xFFFFFF)
136 1.1 oster
137 1.1 oster #endif /* !_RF__RF_DAGFUNCS_H_ */
138