Last change
on this file since e16e8f2 was
e16e8f2,
checked in by Edwin Eefting <edwin@datux.nl>, 3 years ago
|
bootstuff
|
-
Property mode set to
100644
|
File size:
1.2 KB
|
Line | |
---|
1 | #ifndef _GPXE_BITBASH_H |
---|
2 | #define _GPXE_BITBASH_H |
---|
3 | |
---|
4 | /** @file |
---|
5 | * |
---|
6 | * Bit-bashing interfaces |
---|
7 | * |
---|
8 | */ |
---|
9 | |
---|
10 | FILE_LICENCE ( GPL2_OR_LATER ); |
---|
11 | |
---|
12 | struct bit_basher; |
---|
13 | |
---|
14 | /** Bit-bashing operations */ |
---|
15 | struct bit_basher_operations { |
---|
16 | /** |
---|
17 | * Set/clear output bit |
---|
18 | * |
---|
19 | * @v basher Bit-bashing interface |
---|
20 | * @v bit_id Bit number |
---|
21 | * @v data Value to write |
---|
22 | * |
---|
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. |
---|
28 | */ |
---|
29 | void ( * write ) ( struct bit_basher *basher, unsigned int bit_id, |
---|
30 | unsigned long data ); |
---|
31 | /** |
---|
32 | * Read input bit |
---|
33 | * |
---|
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 |
---|
38 | */ |
---|
39 | int ( * read ) ( struct bit_basher *basher, unsigned int bit_id ); |
---|
40 | }; |
---|
41 | |
---|
42 | /** A bit-bashing interface */ |
---|
43 | struct bit_basher { |
---|
44 | /** Bit-bashing operations */ |
---|
45 | struct bit_basher_operations *op; |
---|
46 | }; |
---|
47 | |
---|
48 | extern void write_bit ( struct bit_basher *basher, unsigned int bit_id, |
---|
49 | unsigned long data ); |
---|
50 | extern int read_bit ( struct bit_basher *basher, unsigned int bit_id ); |
---|
51 | |
---|
52 | #endif /* _GPXE_BITBASH_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.