Project

General

Profile

Statistics
| Revision:

root / lab4 / mouse_func.c @ 52

History | View | Annotate | Download (582 Bytes)

1 52 up20180655
#include "mouse_func.h"
2
#include "errors.h"
3
#include "kbc.h"
4
#include "mouse.h"
5
6
#include <lcom/lcf.h>
7
8
int (subscribe_mouse_interrupt)(uint8_t interrupt_bit, int *interrupt_id) {
9
    if (interrupt_id == NULL) return NULL_PTR;
10
    *interrupt_id = interrupt_bit;
11
    if (sys_irqsetpolicy(MOUSE_IRQ, IRQ_REENABLE | IRQ_EXCLUSIVE, interrupt_id)) return SBCR_ERROR;
12
    return SUCCESS;
13
}
14
15
int (unsubscribe_interrupt)(int *interrupt_id) {
16
    if (interrupt_id == NULL) return NULL_PTR;
17
    if (sys_irqrmpolicy(interrupt_id)) return UNSBCR_ERROR;
18
    return SUCCESS;
19
}