summaryrefslogtreecommitdiff
path: root/stacks/max25-bcpr/include/bcpr/bcpr_lock.h
blob: fd6c6b7349ecad5f79b565a4102da2917ea46fcb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#ifndef BCPR_LOCK_H
#define BCPR_LOCK_H

#include "bcpr/bcpr_config.h"

typedef struct bcpr_port_lock {
    char serial[64];
    unsigned iobase;
    unsigned irq;
    int lock_fd;
    int uart_released;
    int dry_run;
} bcpr_port_lock_t;

/* Exclusive COM lock: flock + setserial uart none. irq must match setserial. */
int bcpr_lock_acquire(bcpr_port_lock_t *lk, const bcpr_dev_config_t *dev,
                      int dry_run);
void bcpr_lock_release(bcpr_port_lock_t *lk);
int bcpr_lock_verify_irq(const char *serial, unsigned expect_irq,
                         unsigned *got_irq, unsigned *got_io);

#endif
git clone -b <branch> https://cgit.mode42.com/<repo>.git
git clone -b <branch> git://cgit.mode42.com/<repo>.git

info@mode42.com