xref: /linux/tools/testing/selftests/powerpc/nx-gzip/include/nx.h (revision b83deaa741558babf4b8d51d34f6637ccfff1b26)
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3  * Copyright 2020 IBM Corp.
4  *
5  */
6 #ifndef _NX_H
7 #define _NX_H
8 
9 #include <stdbool.h>
10 
11 #define	NX_FUNC_COMP_842	1
12 #define NX_FUNC_COMP_GZIP	2
13 
14 #ifndef __aligned
15 #define __aligned(x)	__attribute__((aligned(x)))
16 #endif
17 
18 struct nx842_func_args {
19 	bool use_crc;
20 	bool decompress;		/* true decompress; false compress */
21 	bool move_data;
22 	int timeout;			/* seconds */
23 };
24 
25 struct nxbuf_t {
26 	int len;
27 	char *buf;
28 };
29 
30 /* @function should be EFT (aka 842), GZIP etc */
31 void *nx_function_begin(int function, int pri);
32 
33 int nx_function(void *handle, struct nxbuf_t *in, struct nxbuf_t *out,
34 		void *arg);
35 
36 int nx_function_end(void *handle);
37 
38 #endif	/* _NX_H */
39