[sundance] Add reset completion check
[gpxe.git] / src / include / gpxe / bitbash.h
blob62bdce004074f2f5c150809f173038e8b7f58a91
1 #ifndef _GPXE_BITBASH_H
2 #define _GPXE_BITBASH_H
4 /** @file
6 * Bit-bashing interfaces
8 */
10 struct bit_basher;
12 /** Bit-bashing operations */
13 struct bit_basher_operations {
14 /**
15 * Set/clear output bit
17 * @v basher Bit-bashing interface
18 * @v bit_id Bit number
19 * @v data Value to write
21 * @c data will be 0 if a logic 0 should be written (i.e. the
22 * bit should be cleared), or -1UL if a logic 1 should be
23 * written (i.e. the bit should be set). This is done so that
24 * the method may simply binary-AND @c data with the
25 * appropriate bit mask.
27 void ( * write ) ( struct bit_basher *basher, unsigned int bit_id,
28 unsigned long data );
29 /**
30 * Read input bit
32 * @v basher Bit-bashing interface
33 * @v bit_id Bit number
34 * @ret zero Input is a logic 0
35 * @ret non-zero Input is a logic 1
37 int ( * read ) ( struct bit_basher *basher, unsigned int bit_id );
40 /** A bit-bashing interface */
41 struct bit_basher {
42 /** Bit-bashing operations */
43 struct bit_basher_operations *op;
46 extern void write_bit ( struct bit_basher *basher, unsigned int bit_id,
47 unsigned long data );
48 extern int read_bit ( struct bit_basher *basher, unsigned int bit_id );
50 #endif /* _GPXE_BITBASH_H */