~thopiekar/arm-mali/libump-sunxi

« back to all changes in this revision

Viewing changes to src/ump_arch.c

  • Committer: Luc Verhaegen
  • Date: 2014-03-25 21:04:12 UTC
  • Revision ID: git-v1:3211f0135d0fb8f2f263979bdcb7ff043886af80
import r3p0 source

Signed-off-by: Luc Verhaegen <libv@skynet.be>

Show diffs side-by-side

added added

removed removed

Lines of Context:
258
258
        }
259
259
        return dd_msync_call_arg.is_cached;
260
260
}
 
261
 
 
262
#if UNIFIED_MEMORY_PROVIDER_VERSION > 2
 
263
/** Cache operation control. Tell when cache maintenance operations start and end.
 
264
This will allow the kernel to merge cache operations togheter, thus making them faster */
 
265
int ump_arch_cache_operations_control(ump_cache_op_control op)
 
266
{
 
267
        _ump_uk_cache_operations_control_s dd_cache_control_arg;
 
268
 
 
269
        dd_cache_control_arg.op = (ump_uk_cache_op_control)op;
 
270
        dd_cache_control_arg.ctx = ump_uk_ctx;
 
271
 
 
272
        UMP_DEBUG_PRINT(4, ("Cache control op:%d",(u32)op ));
 
273
        _ump_uku_cache_operations_control( &dd_cache_control_arg );
 
274
        return 1; /* Always success */
 
275
}
 
276
 
 
277
int ump_arch_switch_hw_usage( ump_secure_id secure_id, ump_hw_usage new_user )
 
278
{
 
279
        _ump_uk_switch_hw_usage_s dd_sitch_user_arg;
 
280
 
 
281
        dd_sitch_user_arg.secure_id = secure_id;
 
282
        dd_sitch_user_arg.new_user = (ump_uk_user)new_user;
 
283
        dd_sitch_user_arg.ctx = ump_uk_ctx;
 
284
 
 
285
        UMP_DEBUG_PRINT(4, ("Switch user UMP:%d User:%d",secure_id, (u32)new_user ));
 
286
        _ump_uku_switch_hw_usage( &dd_sitch_user_arg );
 
287
        return 1; /* Always success */
 
288
}
 
289
 
 
290
int ump_arch_lock( ump_secure_id secure_id, ump_lock_usage lock_usage )
 
291
{
 
292
        _ump_uk_lock_s dd_lock_arg;
 
293
 
 
294
        dd_lock_arg.ctx = ump_uk_ctx;
 
295
        dd_lock_arg.secure_id = secure_id;
 
296
        dd_lock_arg.lock_usage = (ump_uk_lock_usage) lock_usage;
 
297
 
 
298
        UMP_DEBUG_PRINT(4, ("Lock UMP:%d ",secure_id));
 
299
        _ump_uku_lock( &dd_lock_arg );
 
300
        return 1; /* Always success */
 
301
}
 
302
 
 
303
int ump_arch_unlock( ump_secure_id secure_id )
 
304
{
 
305
        _ump_uk_unlock_s dd_unlock_arg;
 
306
 
 
307
        dd_unlock_arg.ctx = ump_uk_ctx;
 
308
        dd_unlock_arg.secure_id = secure_id;
 
309
 
 
310
        UMP_DEBUG_PRINT(4, ("Lock UMP:%d ",secure_id));
 
311
        _ump_uku_unlock( &dd_unlock_arg );
 
312
        return 1; /* Always success */
 
313
}
 
314
#endif /* UNIFIED_MEMORY_PROVIDER_VERSION */