summaryrefstree
path: root/kernel/drivers/vision/vpu/include/lib/vpul-gen.h
blob: 45fe317ac846ece10113f8c746dcdde5a681a6f2 (plain)
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
/*
 * Samsung Exynos SoC series VPU driver
 *
 * Copyright (c) 2016 Samsung Electronics Co., Ltd
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */

#ifndef __VPU_GEN_H__
#define __VPU_GEN_H__

#if defined(__KERNEL__)


#else
#define ARRAY_SIZE(x)	(sizeof(x) / sizeof((x)[0]))
#define min(_a, _b)       (((_a) < (_b)) ? (_a) : (_b))
#define max(_a, _b)      (((_a) > (_b)) ? (_a) : (_b))


#endif /* __linux__ */

#define PTR2UINT(_p)		((uintptr_t)(_p))
#define UINT2PTR(_val)		((void *)(uintptr_t)(_val))

#define MV_PTR(_p, _off)	(void *)((uint8_t *)(_p) + (_off))

#define TRUE	1
#define FALSE	0

#endif /* __VPU_GEN_H__ */