Source
92
92
h = (MemHeader *)handle->vir_addr;
93
93
_ASSERT_AND_EXECUTE(h != NULL, MEM_EOUT_OF_SHMEMORY, free(handle));
94
94
95
95
h->size = sz;
96
96
h->region = region;
97
97
h->ptr = handle;
98
98
memset(H2P(h), 0, sz);
99
99
return (H2P(h));
100
100
}
101
101
EXIT:
102
+
DEBUG("memplugin_alloc eError=%d", eError);
102
103
return (NULL);
103
104
}
104
105
105
106
/* memory_type is not added if MemHeader is used for Tiler Buffers */
106
107
void memplugin_free(void *ptr)
107
108
{
108
109
shm_buf *handle;
109
110
mem_error_status eError = MEM_EOK;
110
111
MemRegion region;
111
112
115
116
116
117
if( region == MEM_TILER_1D ) {
117
118
MemMgr_Free(P2H(ptr));
118
119
} else if( region == MEM_SHARED ) {
119
120
handle = (P2H(ptr))->ptr;
120
121
SHM_release(handle);
121
122
free(handle);
122
123
} else {
123
124
ERROR("Tiler 2D Allocation/Free not implemented");
124
125
}
125
-
EXIT:;
126
+
EXIT:
127
+
DEBUG("memplugin_free eError=%d", eError);
126
128
}
127
129
128
130
inline int32_t memplugin_share(void *ptr)
129
131
{
130
132
/* No Userspace Virtual pointers to DMA BUF Handles conversion required*/
131
133
/* Do nothing */
132
134
return ((int32_t)ptr);
133
135
}
134
136