summaryrefslogtreecommitdiffstats
path: root/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/cpu_mem_support.h
blob: 6d014fafb713907d2246c30ebc65e3556cf20417 (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
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
/*
 * Support for Intel Camera Imaging ISP subsystem.
 * Copyright (c) 2015, Intel Corporation.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms and conditions of the GNU General Public License,
 * version 2, as published by the Free Software Foundation.
 *
 * This program is distributed in the hope it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 */

#ifndef __CPU_MEM_SUPPORT_H_INCLUDED__
#define __CPU_MEM_SUPPORT_H_INCLUDED__

#if defined (__KERNEL__)
#include <linux/string.h> /* memset */
#else
#include <string.h> /* memset */
#endif

#include "sh_css_internal.h" /* sh_css_malloc and sh_css_free */

static inline void*
ia_css_cpu_mem_alloc(unsigned int size)
{
	return sh_css_malloc(size);
}

static inline void*
ia_css_cpu_mem_copy(void* dst, const void* src, unsigned int size)
{
	if(!src || !dst)
		return NULL;

	return memcpy(dst, src, size);
}

static inline void*
ia_css_cpu_mem_set_zero(void* dst, unsigned int size)
{
	if(!dst)
		return NULL;

	return memset(dst, 0, size);
}

static inline void
ia_css_cpu_mem_free(void* ptr)
{
	if(!ptr)
		return;

	sh_css_free(ptr);
}

#endif /* __CPU_MEM_SUPPORT_H_INCLUDED__ */
OpenPOWER on IntegriCloud