Commit 962da22b authored by Alan Cox's avatar Alan Cox Committed by Greg Kroah-Hartman

atomisp: remove the unused debug wrapping from the mmgr layer

We don't need this layer of indirection and the debugging information is not used. With
this removed we can then go on to try and remove the abstraction layer entirely.
Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6eb04a8c
/* /*
* Support for Intel Camera Imaging ISP subsystem. * Support for Intel Camera Imaging ISP subsystem.
* Copyright (c) 2015, Intel Corporation. * Copyright (c) 2015-2017, Intel Corporation.
* *
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License, * under the terms and conditions of the GNU General Public License,
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
* within the allocation referencable from the * within the allocation referencable from the
* returned pointer/address. * returned pointer/address.
*/ */
#define MMGR_ATTRIBUTE_MASK 0x000f #define MMGR_ATTRIBUTE_MASK 0x000f
#define MMGR_ATTRIBUTE_CACHED 0x0001 #define MMGR_ATTRIBUTE_CACHED 0x0001
#define MMGR_ATTRIBUTE_CONTIGUOUS 0x0002 #define MMGR_ATTRIBUTE_CONTIGUOUS 0x0002
#define MMGR_ATTRIBUTE_PAGEALIGN 0x0004 #define MMGR_ATTRIBUTE_PAGEALIGN 0x0004
...@@ -87,78 +87,43 @@ ...@@ -87,78 +87,43 @@
extern const hrt_vaddress mmgr_NULL; extern const hrt_vaddress mmgr_NULL;
extern const hrt_vaddress mmgr_EXCEPTION; extern const hrt_vaddress mmgr_EXCEPTION;
/*! Set the (sub)system virtual memory page table base address
\param base_addr[in] The address where page table 0 is located
\Note: The base_addr is an absolute system address, thus it is not
relative to the DDR base address
\return none,
*/
extern void mmgr_set_base_address(
const sys_address base_addr);
/*! Return the address of an allocation in memory /*! Return the address of an allocation in memory
\param size[in] Size in bytes of the allocation \param size[in] Size in bytes of the allocation
\param caller_func[in] Caller function name \param caller_func[in] Caller function name
\param caller_line[in] Caller function line number \param caller_line[in] Caller function line number
\return vaddress \return vaddress
*/ */
#define mmgr_malloc(__size) mmgr_malloc_ex(__size, __func__, __LINE__) extern hrt_vaddress mmgr_malloc(const size_t size);
extern hrt_vaddress mmgr_malloc_ex(
const size_t size,
const char *caller_func,
int caller_line);
/*! Return the address of a zero initialised allocation in memory /*! Return the address of a zero initialised allocation in memory
\param N[in] Horizontal dimension of array \param N[in] Horizontal dimension of array
\param size[in] Vertical dimension of array Total size is N*size \param size[in] Vertical dimension of array Total size is N*size
\param caller_func[in] Caller function name
\param caller_line[in] Caller function line number
\return vaddress \return vaddress
*/ */
#define mmgr_calloc(__N, __size) mmgr_calloc_ex(__N, __size, __func__, __LINE__) extern hrt_vaddress mmgr_calloc(const size_t N, const size_t size);
extern hrt_vaddress mmgr_calloc_ex(
const size_t N,
const size_t size,
const char *caller_func,
int caller_line);
/*! Free the memory allocation identified by the address /*! Free the memory allocation identified by the address
\param vaddr[in] Address of the allocation \param vaddr[in] Address of the allocation
\param caller_func[in] Caller function name
\param caller_line[in] Caller function line number
\return vaddress \return vaddress
*/ */
#define mmgr_free(__vaddr) mmgr_free_ex(__vaddr, __func__, __LINE__) extern void mmgr_free(hrt_vaddress vaddr);
extern void mmgr_free_ex(
hrt_vaddress vaddr,
const char *caller_func,
int caller_line);
/*! Return the address of an allocation in memory /*! Return the address of an allocation in memory
\param size[in] Size in bytes of the allocation \param size[in] Size in bytes of the allocation
\param attribute[in] Bit vector specifying the properties \param attribute[in] Bit vector specifying the properties
of the allocation including zero initialisation of the allocation including zero initialisation
\param caller_func[in] Caller function name
\param caller_line[in] Caller function line number
\return vaddress \return vaddress
*/ */
#define mmgr_alloc_attr(__size, __attribute) mmgr_alloc_attr_ex(__size, __attribute, __func__, __LINE__)
extern hrt_vaddress mmgr_alloc_attr_ex( extern hrt_vaddress mmgr_alloc_attr(const size_t size, const uint16_t attribute);
const size_t size,
const uint16_t attribute,
const char *caller_func,
int caller_line);
/*! Return the address of a mapped existing allocation in memory /*! Return the address of a mapped existing allocation in memory
...@@ -187,52 +152,29 @@ extern hrt_vaddress mmgr_mmap( ...@@ -187,52 +152,29 @@ extern hrt_vaddress mmgr_mmap(
\param vaddr[in] Address of an allocation \param vaddr[in] Address of an allocation
\param size[in] Size in bytes of the area to be cleared \param size[in] Size in bytes of the area to be cleared
\param caller_func[in] Caller function name
\param caller_line[in] Caller function line number
\return none \return none
*/ */
#define mmgr_clear(__vaddr, __size) mmgr_clear_ex(__vaddr, __size, __func__, __LINE__) extern void mmgr_clear(hrt_vaddress vaddr, const size_t size);
extern void mmgr_clear_ex(
hrt_vaddress vaddr,
const size_t size,
const char *caller_func,
int caller_line);
/*! Read an array of bytes from a virtual memory address /*! Read an array of bytes from a virtual memory address
\param vaddr[in] Address of an allocation \param vaddr[in] Address of an allocation
\param data[out] pointer to the destination array \param data[out] pointer to the destination array
\param size[in] number of bytes to read \param size[in] number of bytes to read
\param caller_func[in] Caller function name
\param caller_line[in] Caller function line number
\return none \return none
*/ */
#define mmgr_load(__vaddr, __data, __size) mmgr_load_ex(__vaddr, __data, __size, __func__, __LINE__) extern void mmgr_load(const hrt_vaddress vaddr, void *data, const size_t size);
extern void mmgr_load_ex(
const hrt_vaddress vaddr,
void *data,
const size_t size,
const char *caller_func,
int caller_line);
/*! Write an array of bytes to device registers or memory in the device /*! Write an array of bytes to device registers or memory in the device
\param vaddr[in] Address of an allocation \param vaddr[in] Address of an allocation
\param data[in] pointer to the source array \param data[in] pointer to the source array
\param size[in] number of bytes to write \param size[in] number of bytes to write
\param caller_func[in] Caller function name
\param caller_line[in] Caller function line number
\return none \return none
*/ */
#define mmgr_store(__vaddr, __data, __size) mmgr_store_ex(__vaddr, __data, __size, __func__, __LINE__) extern void mmgr_store(const hrt_vaddress vaddr, const void *data, const size_t size);
extern void mmgr_store_ex(
const hrt_vaddress vaddr,
const void *data,
const size_t size,
const char *caller_func,
int caller_line);
#endif /* __MEMORY_ACCESS_H_INCLUDED__ */ #endif /* __MEMORY_ACCESS_H_INCLUDED__ */
/* /*
* Support for Intel Camera Imaging ISP subsystem. * Support for Intel Camera Imaging ISP subsystem.
* Copyright (c) 2015, Intel Corporation. * Copyright (c) 2015-2017, Intel Corporation.
* *
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License, * under the terms and conditions of the GNU General Public License,
...@@ -33,12 +33,12 @@ ia_css_memory_access_init(const struct ia_css_css_mem_env *env) ...@@ -33,12 +33,12 @@ ia_css_memory_access_init(const struct ia_css_css_mem_env *env)
} }
hrt_vaddress hrt_vaddress
mmgr_malloc_ex(const size_t size, const char *caller_func, int caller_line) mmgr_malloc(const size_t size)
{ {
return mmgr_alloc_attr_ex(size, 0, caller_func, caller_line); return mmgr_alloc_attr(size, 0);
} }
hrt_vaddress mmgr_alloc_attr_ex(const size_t size, const uint16_t attrs, const char *caller_func, int caller_line) hrt_vaddress mmgr_alloc_attr(const size_t size, const uint16_t attrs)
{ {
uint32_t my_attrs = 0; uint32_t my_attrs = 0;
uint16_t masked_attrs = attrs & MMGR_ATTRIBUTE_MASK; uint16_t masked_attrs = attrs & MMGR_ATTRIBUTE_MASK;
...@@ -53,49 +53,37 @@ hrt_vaddress mmgr_alloc_attr_ex(const size_t size, const uint16_t attrs, const c ...@@ -53,49 +53,37 @@ hrt_vaddress mmgr_alloc_attr_ex(const size_t size, const uint16_t attrs, const c
if (masked_attrs & MMGR_ATTRIBUTE_PAGEALIGN) if (masked_attrs & MMGR_ATTRIBUTE_PAGEALIGN)
my_attrs |= IA_CSS_MEM_ATTR_PAGEALIGN; my_attrs |= IA_CSS_MEM_ATTR_PAGEALIGN;
(void)caller_func;
(void)caller_line;
ptr = my_env.alloc(size, my_attrs); ptr = my_env.alloc(size, my_attrs);
return ptr; return ptr;
} }
hrt_vaddress hrt_vaddress
mmgr_calloc_ex(const size_t N, const size_t size, const char *caller_func, int caller_line) mmgr_calloc(const size_t N, const size_t size)
{ {
(void)caller_func;
(void)caller_line;
return mmgr_alloc_attr(size * N, MMGR_ATTRIBUTE_CLEARED); return mmgr_alloc_attr(size * N, MMGR_ATTRIBUTE_CLEARED);
} }
void void
mmgr_free_ex(hrt_vaddress vaddr, const char *caller_func, int caller_line) mmgr_free(hrt_vaddress vaddr)
{ {
(void)caller_func;
(void)caller_line;
my_env.free(vaddr); my_env.free(vaddr);
} }
void void
mmgr_clear_ex(hrt_vaddress vaddr, const size_t size, const char *caller_func, int caller_line) mmgr_clear(hrt_vaddress vaddr, const size_t size)
{ {
(void)caller_func;
(void)caller_line;
my_env.set(vaddr, 0, size); my_env.set(vaddr, 0, size);
} }
void void
mmgr_load_ex(const hrt_vaddress vaddr, void *data, const size_t size, const char *caller_func, int caller_line) mmgr_load(const hrt_vaddress vaddr, void *data, const size_t size)
{ {
(void)caller_func;
(void)caller_line;
my_env.load(vaddr, data, size); my_env.load(vaddr, data, size);
} }
void void
mmgr_store_ex(const hrt_vaddress vaddr, const void *data, const size_t size, const char *caller_func, int caller_line) mmgr_store(const hrt_vaddress vaddr, const void *data, const size_t size)
{ {
(void)caller_func;
(void)caller_line;
my_env.store(vaddr, data, size); my_env.store(vaddr, data, size);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment