forked from marco-pag/fred-linux-test-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfred_lib.h
More file actions
78 lines (52 loc) · 2.27 KB
/
fred_lib.h
File metadata and controls
78 lines (52 loc) · 2.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/*
* Fred for Linux. Experimental support.
*
* Copyright (C) 2018-2021, Marco Pagani, ReTiS Lab.
* <marco.pag(at)outlook.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2.
*/
#ifndef FRED_LIB_H_
#define FRED_LIB_H_
// required to call from a C++ program
#ifdef __cplusplus
extern "C" {
#endif
#include <stddef.h>
#include <stdint.h>
//---------------------------------------------------------------------------------------------
// #define DBG_VERBOSE
//---------------------------------------------------------------------------------------------
enum fred_errors {
FRED_ERR_REQ = 200,
FRED_ERR_ARGS = 100,
FRED_ERR_MEM = -100,
FRED_ERR_COMM = -200,
FRED_ERR_MAP = -400,
FRED_ERR_INT = -500
};
//---------------------------------------------------------------------------------------------
struct fred_data;
struct fred_hw_task;
//---------------------------------------------------------------------------------------------
int fred_init(struct fred_data **self);
int fred_bind(struct fred_data *self, struct fred_hw_task **hw_task, uint32_t hw_task_id);
int fred_accel(struct fred_data *self, const struct fred_hw_task *hw_task);
void fred_free(struct fred_data *self);
//---------------------------------------------------------------------------------------------
int fred_async_accel(struct fred_data *self, const struct fred_hw_task *hw_task);
int fred_async_wait_for_accel(struct fred_data *self);
//---------------------------------------------------------------------------------------------
int fred_get_buffs_count(const struct fred_data *self, struct fred_hw_task *hw_task);
ssize_t fred_get_buff_size(const struct fred_data *self, struct fred_hw_task *hw_task,
int buff_idx);
//---------------------------------------------------------------------------------------------
void *fred_map_buff(const struct fred_data *self, struct fred_hw_task *hw_task, int buff_idx);
void fred_unmap_buff(const struct fred_data *self, struct fred_hw_task *hw_task, int buff_idx);
//---------------------------------------------------------------------------------------------
#ifdef __cplusplus
}
#endif
#endif /* FRED_LIB_H_ */