hrt_vaddress mmgr_alloc_attr(const size_t size, const uint16_t attrs)
{
uint16_t masked_attrs = attrs & MMGR_ATTRIBUTE_MASK;
+ WARN_ON(attrs & MMGR_ATTRIBUTE_CONTIGUOUS);
if (masked_attrs & MMGR_ATTRIBUTE_CLEARED) {
- if (masked_attrs & MMGR_ATTRIBUTE_CACHED) {
- if (masked_attrs & MMGR_ATTRIBUTE_CONTIGUOUS)
- return (ia_css_ptr) hrt_isp_css_mm_calloc_contiguous(size);
- else
- return (ia_css_ptr) hrt_isp_css_mm_calloc_cached(size);
- } else {
- if (masked_attrs & MMGR_ATTRIBUTE_CONTIGUOUS)
- return (ia_css_ptr) hrt_isp_css_mm_calloc_contiguous(size);
- else
- return (ia_css_ptr) hrt_isp_css_mm_calloc(size);
- }
+ if (masked_attrs & MMGR_ATTRIBUTE_CACHED)
+ return (ia_css_ptr) hrt_isp_css_mm_calloc_cached(size);
+ else
+ return (ia_css_ptr) hrt_isp_css_mm_calloc(size);
} else {
- if (masked_attrs & MMGR_ATTRIBUTE_CACHED) {
- if (masked_attrs & MMGR_ATTRIBUTE_CONTIGUOUS)
- return (ia_css_ptr) hrt_isp_css_mm_alloc_contiguous(size);
- else
- return (ia_css_ptr) hrt_isp_css_mm_alloc_cached(size);
- } else {
- if (masked_attrs & MMGR_ATTRIBUTE_CONTIGUOUS)
- return (ia_css_ptr) hrt_isp_css_mm_alloc_contiguous(size);
- else
- return (ia_css_ptr) hrt_isp_css_mm_alloc(size);
- }
+ if (masked_attrs & MMGR_ATTRIBUTE_CACHED)
+ return (ia_css_ptr) hrt_isp_css_mm_alloc_cached(size);
+ else
+ return (ia_css_ptr) hrt_isp_css_mm_alloc(size);
}
}
assert(page_table_base_address != (sys_address)-1);
assert((attribute & MMGR_ATTRIBUTE_UNUSED) == 0);
+ WARN_ON(attribute & MMGR_ATTRIBUTE_CONTIGUOUS);
if (attribute & MMGR_ATTRIBUTE_CLEARED) {
if (attribute & MMGR_ATTRIBUTE_CACHED) {
- if (attribute & MMGR_ATTRIBUTE_CONTIGUOUS) /* { */
- ptr = hrt_isp_css_mm_calloc_contiguous(
+ ptr = hrt_isp_css_mm_calloc_cached(
aligned_size + extra_space);
- /* } */ else /* { */
- ptr = hrt_isp_css_mm_calloc_cached(
- aligned_size + extra_space);
- /* } */
} else { /* !MMGR_ATTRIBUTE_CACHED */
- if (attribute & MMGR_ATTRIBUTE_CONTIGUOUS) /* { */
- ptr = hrt_isp_css_mm_calloc_contiguous(
- aligned_size + extra_space);
- /* } */ else /* { */
- ptr = hrt_isp_css_mm_calloc(
+ ptr = hrt_isp_css_mm_calloc(
aligned_size + extra_space);
- /* } */
}
} else { /* MMGR_ATTRIBUTE_CLEARED */
if (attribute & MMGR_ATTRIBUTE_CACHED) {
- if (attribute & MMGR_ATTRIBUTE_CONTIGUOUS) /* { */
- ptr = hrt_isp_css_mm_alloc_contiguous(
- aligned_size + extra_space);
- /* } */ else /* { */
- ptr = hrt_isp_css_mm_alloc_cached(
+ ptr = hrt_isp_css_mm_alloc_cached(
aligned_size + extra_space);
- /* } */
} else { /* !MMGR_ATTRIBUTE_CACHED */
- if (attribute & MMGR_ATTRIBUTE_CONTIGUOUS) /* { */
- ptr = hrt_isp_css_mm_alloc_contiguous(
- aligned_size + extra_space);
- /* } */ else /* { */
- ptr = hrt_isp_css_mm_alloc(
- aligned_size + extra_space);
- /* } */
+ ptr = hrt_isp_css_mm_alloc(
+ aligned_size + extra_space);
}
}
return ptr;