3 * Support for Intel Camera Imaging ISP subsystem.
4 * Copyright (c) 2015, Intel Corporation.
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License,
8 * version 2, as published by the Free Software Foundation.
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
20 #include "system_api.h"
21 #include "hive_types.h"
23 #define hrt_int_type_of_char char
24 #define hrt_int_type_of_uchar unsigned char
25 #define hrt_int_type_of_short short
26 #define hrt_int_type_of_ushort unsigned short
27 #define hrt_int_type_of_int int
28 #define hrt_int_type_of_uint unsigned int
29 #define hrt_int_type_of_long long
30 #define hrt_int_type_of_ulong unsigned long
31 #define hrt_int_type_of_ptr unsigned int
33 #define hrt_host_type_of_char char
34 #define hrt_host_type_of_uchar unsigned char
35 #define hrt_host_type_of_short short
36 #define hrt_host_type_of_ushort unsigned short
37 #define hrt_host_type_of_int int
38 #define hrt_host_type_of_uint unsigned int
39 #define hrt_host_type_of_long long
40 #define hrt_host_type_of_ulong unsigned long
41 #define hrt_host_type_of_ptr void*
43 #define HRT_TYPE_BYTES(cell, type) (HRT_TYPE_BITS(cell, type)/8)
44 #define HRT_HOST_TYPE(cell_type) HRTCAT(hrt_host_type_of_, cell_type)
45 #define HRT_INT_TYPE(type) HRTCAT(hrt_int_type_of_, type)
47 #define hrt_scalar_store(cell, type, var, data) \
48 HRTCAT(hrt_mem_store_,HRT_TYPE_BITS(cell, type))(\
50 HRTCAT(HIVE_MEM_,var), \
51 HRTCAT(HIVE_ADDR_,var), \
52 (HRT_INT_TYPE(type))(data))
54 #define hrt_scalar_load(cell, type, var) \
55 (HRT_HOST_TYPE(type))(HRTCAT4(_hrt_mem_load_,HRT_PROC_TYPE(cell),_,type) ( \
57 HRTCAT(HIVE_MEM_,var), \
58 HRTCAT(HIVE_ADDR_,var)))
60 #define hrt_indexed_store(cell, type, array, index, data) \
61 HRTCAT(hrt_mem_store_,HRT_TYPE_BITS(cell, type))(\
63 HRTCAT(HIVE_MEM_,array), \
64 (HRTCAT(HIVE_ADDR_,array))+((index)*HRT_TYPE_BYTES(cell, type)), \
65 (HRT_INT_TYPE(type))(data))
67 #define hrt_indexed_load(cell, type, array, index) \
68 (HRT_HOST_TYPE(type))(HRTCAT4(_hrt_mem_load_,HRT_PROC_TYPE(cell),_,type) ( \
70 HRTCAT(HIVE_MEM_,array), \
71 (HRTCAT(HIVE_ADDR_,array))+((index)*HRT_TYPE_BYTES(cell, type))))
73 #endif /* _HRT_VAR_H */