1 #ifndef _GPXE_BITBASH_H
2 #define _GPXE_BITBASH_H
6 * Bit-bashing interfaces
12 /** Bit-bashing operations */
13 struct bit_basher_operations
{
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
,
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 */
42 /** Bit-bashing operations */
43 struct bit_basher_operations
*op
;
46 extern void write_bit ( struct bit_basher
*basher
, unsigned int bit_id
,
48 extern int read_bit ( struct bit_basher
*basher
, unsigned int bit_id
);
50 #endif /* _GPXE_BITBASH_H */