root / lab3 / utils.c @ 43
History | View | Annotate | Download (337 Bytes)
1 | 30 | up20180655 | #include <lcom/lcf.h> |
---|---|---|---|
2 | |||
3 | #include <stdint.h> |
||
4 | |||
5 | 42 | up20180642 | #ifdef LAB3
|
6 | uint32_t sys_inb_counter = 0;
|
||
7 | #endif
|
||
8 | |||
9 | 30 | up20180655 | int (util_sys_inb)(int port, uint8_t *value) { |
10 | if(value == NULL) return 1; |
||
11 | uint32_t n = 0;
|
||
12 | if(sys_inb(port, &n)) return 1; |
||
13 | *value = n; |
||
14 | 42 | up20180642 | #ifdef LAB3
|
15 | ++sys_inb_counter; |
||
16 | #endif
|
||
17 | 30 | up20180655 | return 0; |
18 | } |