Project

General

Profile

Statistics
| Revision:

root / lab3 / utils.c @ 43

History | View | Annotate | Download (337 Bytes)

1
#include <lcom/lcf.h>
2

    
3
#include <stdint.h>
4

    
5
#ifdef LAB3
6
    uint32_t sys_inb_counter = 0;
7
#endif
8

    
9
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
    #ifdef LAB3
15
        ++sys_inb_counter;
16
    #endif
17
    return 0;
18
}