1 #ifndef _GPXE_BITBASH_H
2 #define _GPXE_BITBASH_H
6 * Bit-bashing interfaces
10 FILE_LICENCE ( GPL2_OR_LATER
);
14 /** Bit-bashing operations */
15 struct bit_basher_operations
{
17 * Set/clear output bit
19 * @v basher Bit-bashing interface
20 * @v bit_id Bit number
21 * @v data Value to write
23 * @c data will be 0 if a logic 0 should be written (i.e. the
24 * bit should be cleared), or -1UL if a logic 1 should be
25 * written (i.e. the bit should be set). This is done so that
26 * the method may simply binary-AND @c data with the
27 * appropriate bit mask.
29 void ( * write
) ( struct bit_basher
*basher
, unsigned int bit_id
,
34 * @v basher Bit-bashing interface
35 * @v bit_id Bit number
36 * @ret zero Input is a logic 0
37 * @ret non-zero Input is a logic 1
39 int ( * read
) ( struct bit_basher
*basher
, unsigned int bit_id
);
42 /** A bit-bashing interface */
44 /** Bit-bashing operations */
45 struct bit_basher_operations
*op
;
48 extern void write_bit ( struct bit_basher
*basher
, unsigned int bit_id
,
50 extern int read_bit ( struct bit_basher
*basher
, unsigned int bit_id
);
52 #endif /* _GPXE_BITBASH_H */