• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ MALI_CHECK_NON_NULL函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中MALI_CHECK_NON_NULL函数的典型用法代码示例。如果您正苦于以下问题:C++ MALI_CHECK_NON_NULL函数的具体用法?C++ MALI_CHECK_NON_NULL怎么用?C++ MALI_CHECK_NON_NULL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了MALI_CHECK_NON_NULL函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: _mali_ukk_dump_mmu_page_table

_mali_osk_errcode_t _mali_ukk_dump_mmu_page_table( _mali_uk_dump_mmu_page_table_s * args )
{
	struct dump_info info = { 0, 0, 0, NULL };
	struct mali_session_data * session_data;

	MALI_DEBUG_ASSERT_POINTER(args);
	MALI_CHECK_NON_NULL(args->ctx, _MALI_OSK_ERR_INVALID_ARGS);
	MALI_CHECK_NON_NULL(args->buffer, _MALI_OSK_ERR_INVALID_ARGS);

	session_data = (struct mali_session_data *)(args->ctx);

	info.buffer_left = args->size;
	info.buffer = args->buffer;

	args->register_writes = info.buffer;
	MALI_CHECK_NO_ERROR(dump_mmu_registers(session_data->page_directory, &info));

	args->page_table_dump = info.buffer;
	MALI_CHECK_NO_ERROR(dump_mmu_page_table(session_data->page_directory, &info));

	args->register_writes_size = info.register_writes_size;
	args->page_table_dump_size = info.page_table_dump_size;

	MALI_SUCCESS;
}
开发者ID:M0RT3ZA,项目名称:android_kernel_samsung_smdk4412,代码行数:25,代码来源:mali_mmu_page_directory.c


示例2: _mali_ukk_release_ump_mem

_mali_osk_errcode_t _mali_ukk_release_ump_mem(_mali_uk_release_ump_mem_s *args)
{
    mali_mem_allocation * descriptor;
    struct mali_session_data *session;

    MALI_DEBUG_ASSERT_POINTER(args);
    MALI_CHECK_NON_NULL(args->ctx, _MALI_OSK_ERR_INVALID_ARGS);

    session = (struct mali_session_data *)args->ctx;
    MALI_CHECK_NON_NULL(session, _MALI_OSK_ERR_INVALID_ARGS);

    if (_MALI_OSK_ERR_OK != mali_descriptor_mapping_get(session->descriptor_mapping, args->cookie, (void**)&descriptor)) {
        MALI_DEBUG_PRINT(1, ("Invalid memory descriptor %d used to release ump memory\n", args->cookie));
        MALI_ERROR(_MALI_OSK_ERR_FAULT);
    }

    descriptor = mali_descriptor_mapping_free(session->descriptor_mapping, args->cookie);

    if (NULL != descriptor) {
        _mali_osk_mutex_wait(session->memory_lock);
        mali_mem_ump_release(descriptor);
        _mali_osk_mutex_signal(session->memory_lock);

        mali_mem_descriptor_destroy(descriptor);
    }

    MALI_SUCCESS;
}
开发者ID:cm-3470,项目名称:android_kernel_samsung_degaslte,代码行数:28,代码来源:mali_memory_ump.c


示例3: soft_job_start_wrapper

int soft_job_start_wrapper(struct mali_session_data *session, _mali_uk_soft_job_start_s __user *uargs)
{
	_mali_uk_soft_job_start_s kargs;
	u32 type, point;
	u64 user_job;
	struct mali_timeline_fence fence;
	struct mali_soft_job *job = NULL;
	u32 __user *job_id_ptr = NULL;

	/* If the job was started successfully, 0 is returned.  If there was an error, but the job
	 * was started, we return -ENOENT.  For anything else returned, the job was not started. */

	MALI_CHECK_NON_NULL(uargs, -EINVAL);
	MALI_CHECK_NON_NULL(session, -EINVAL);

	MALI_DEBUG_ASSERT_POINTER(session->soft_job_system);

	if (0 != copy_from_user(&kargs, uargs, sizeof(kargs))) {
		return -EFAULT;
	}

	type = kargs.type;
	user_job = kargs.user_job;
	job_id_ptr = (u32 __user *)(uintptr_t)kargs.job_id_ptr;

	mali_timeline_fence_copy_uk_fence(&fence, &kargs.fence);

	if ((MALI_SOFT_JOB_TYPE_USER_SIGNALED != type) && (MALI_SOFT_JOB_TYPE_SELF_SIGNALED != type)) {
		MALI_DEBUG_PRINT_ERROR(("Invalid soft job type specified\n"));
		return -EINVAL;
	}

	/* Create soft job. */
	job = mali_soft_job_create(session->soft_job_system, (enum mali_soft_job_type)type, user_job);
	if (unlikely(NULL == job)) {
		return map_errcode(_MALI_OSK_ERR_NOMEM);
	}

	/* Write job id back to user space. */
	if (0 != put_user(job->id, job_id_ptr)) {
		MALI_PRINT_ERROR(("Mali Soft Job: failed to put job id"));
		mali_soft_job_destroy(job);
		return map_errcode(_MALI_OSK_ERR_NOMEM);
	}

	/* Start soft job. */
	point = mali_soft_job_start(job, &fence);

	if (0 != put_user(point, &uargs->point)) {
		/* Let user space know that something failed after the job was started. */
		return -ENOENT;
	}

	return 0;
}
开发者ID:CM13-HI6210SFT,项目名称:hisi_kernel_3.10.86_hi6210sft,代码行数:55,代码来源:mali_ukk_soft_job.c


示例4: initialize_subsystems

static _mali_osk_errcode_t initialize_subsystems(void)
{
	int i, j;
    _mali_osk_errcode_t err = _MALI_OSK_ERR_FAULT; /* default error code */

    MALI_CHECK_NON_NULL(system_info_lock = _mali_osk_lock_init( (_mali_osk_lock_flags_t)(_MALI_OSK_LOCKFLAG_SPINLOCK | _MALI_OSK_LOCKFLAG_NONINTERRUPTABLE), 0, 0 ), _MALI_OSK_ERR_FAULT);

#ifdef MALI_SESSION_MEMORY_USAGE
    MALI_CHECK_NON_NULL(session_data_lock = _mali_osk_lock_init( (_mali_osk_lock_flags_t)(_MALI_OSK_LOCKFLAG_NONINTERRUPTABLE), 0, 0 ), _MALI_OSK_ERR_FAULT);

	_MALI_OSK_INIT_LIST_HEAD(&session_data_head);
#endif

	for (i = 0; i < (int)SUBSYSTEMS_COUNT; ++i)
	{
		if (NULL != subsystems[i]->startup)
		{
			/* the subsystem has a startup function defined */
			err = subsystems[i]->startup(i); /* the subsystem identifier is the offset in our subsystems array */
			if (_MALI_OSK_ERR_OK != err) goto cleanup;
		}
	}

	for (j = 0; j < (int)SUBSYSTEMS_COUNT; ++j)
	{
		if (NULL != subsystems[j]->load_complete)
		{
			/* the subsystem has a load_complete function defined */
			err = subsystems[j]->load_complete(j);
			if (_MALI_OSK_ERR_OK != err) goto cleanup;
		}
	}

	/* All systems loaded and resources registered */
	/* Build system info */
	if (_MALI_OSK_ERR_OK != build_system_info()) goto cleanup;

	MALI_SUCCESS; /* all ok */

cleanup:
	/* i is index of subsystem which failed to start, all indices before that has to be shut down */
	for (i = i - 1; i >= 0; --i)
	{
		/* the subsystem identifier is the offset in our subsystems array */
		/* Call possible shutdown notficiation functions */
		if (NULL != subsystems[i]->shutdown) subsystems[i]->shutdown(i);
	}

#ifdef MALI_SESSION_MEMORY_USAGE
    _mali_osk_lock_term( session_data_lock );
#endif
    _mali_osk_lock_term( system_info_lock );
    MALI_ERROR(err); /* err is what the module which failed its startup returned, or the default */
}
开发者ID:Scorpio92,项目名称:mstar6a918,代码行数:54,代码来源:mali_kernel_core.c


示例5: gp_start_job_wrapper

int gp_start_job_wrapper(struct mali_session_data *session_data, _mali_uk_gp_start_job_s __user *uargs)
{
	_mali_osk_errcode_t err;

	MALI_CHECK_NON_NULL(uargs, -EINVAL);
	MALI_CHECK_NON_NULL(session_data, -EINVAL);

	err = _mali_ukk_gp_start_job(session_data, uargs);
	if (_MALI_OSK_ERR_OK != err) return map_errcode(err);

	return 0;
}
开发者ID:32743069,项目名称:amlogic_common_3050,代码行数:12,代码来源:mali_ukk_gp.c


示例6: pp_disable_wb_wrapper

int pp_disable_wb_wrapper(struct mali_session_data *session_data, _mali_uk_pp_disable_wb_s __user *uargs)
{
	_mali_uk_pp_disable_wb_s kargs;

	MALI_CHECK_NON_NULL(uargs, -EINVAL);
	MALI_CHECK_NON_NULL(session_data, -EINVAL);

	if (0 != copy_from_user(&kargs, uargs, sizeof(_mali_uk_pp_disable_wb_s))) return -EFAULT;

	kargs.ctx = (uintptr_t)session_data;
	_mali_ukk_pp_job_disable_wb(&kargs);

	return 0;
}
开发者ID:HuaweiHonor4C,项目名称:kernel_hi6210sft_mm,代码行数:14,代码来源:mali_ukk_pp.c


示例7: mem_get_cpu_adjust_wrapper

int mem_get_cpu_adjust_wrapper(struct mali_session_data *session_data, _mali_uk_get_cpu_adjust __user *uargs)
{
    _mali_uk_get_cpu_adjust kargs;

    MALI_CHECK_NON_NULL(uargs, -EINVAL);
    MALI_CHECK_NON_NULL(session_data, -EINVAL);

    kargs.ctx = session_data;
    kargs.value = PHYS_TO_BUS_ADDRESS_ADJUST;

    if (0 != put_user(kargs.value, &uargs->value)) return -EFAULT;

    return 0;
}
开发者ID:Scorpio92,项目名称:mstar6a918,代码行数:14,代码来源:mali_ukk_mem.c


示例8: mem_get_miu1_base_wrapper

int mem_get_miu1_base_wrapper(struct mali_session_data *session_data, _mali_uk_get_miu1_base __user *uargs)
{
    _mali_uk_get_miu1_base kargs;

    MALI_CHECK_NON_NULL(uargs, -EINVAL);
    MALI_CHECK_NON_NULL(session_data, -EINVAL);

    kargs.ctx = session_data;
    kargs.addr = MSTAR_MIU1_PHY_BASE;

    if (0 != put_user(kargs.addr, &uargs->addr)) return -EFAULT;

    return 0;
}
开发者ID:Scorpio92,项目名称:mstar6a918,代码行数:14,代码来源:mali_ukk_mem.c


示例9: gp_start_job_wrapper

int gp_start_job_wrapper(struct mali_session_data *session_data, _mali_uk_gp_start_job_s __user *uargs)
{
	_mali_osk_errcode_t err;

	/* If the job was started successfully, 0 is returned.  If there was an error, but the job
	 * was started, we return -ENOENT.  For anything else returned, the job was not started. */

	MALI_CHECK_NON_NULL(uargs, -EINVAL);
	MALI_CHECK_NON_NULL(session_data, -EINVAL);

	err = _mali_ukk_gp_start_job(session_data, uargs);
	if (_MALI_OSK_ERR_OK != err) return map_errcode(err);

	return 0;
}
开发者ID:GREYFOXRGR,项目名称:BPI-M3-bsp,代码行数:15,代码来源:mali_ukk_gp.c


示例10: _mali_ukk_get_gp_core_version

_mali_osk_errcode_t _mali_ukk_get_gp_core_version(_mali_uk_get_gp_core_version_s *args)
{
	MALI_DEBUG_ASSERT_POINTER(args);
	MALI_CHECK_NON_NULL(args->ctx, _MALI_OSK_ERR_INVALID_ARGS);
	args->version = gp_version;
	return _MALI_OSK_ERR_OK;
}
开发者ID:cm-3470,项目名称:android_kernel_samsung_degaslte,代码行数:7,代码来源:mali_gp_scheduler.c


示例11: _mali_ukk_post_notification

_mali_osk_errcode_t _mali_ukk_post_notification( _mali_uk_post_notification_s *args )
{
	_mali_osk_notification_t * notification;
    _mali_osk_notification_queue_t *queue;

    /* check input */
	MALI_DEBUG_ASSERT_POINTER(args);
    MALI_CHECK_NON_NULL(args->ctx, _MALI_OSK_ERR_INVALID_ARGS);

    queue = (_mali_osk_notification_queue_t *)mali_kernel_session_manager_slot_get(args->ctx, mali_subsystem_core_id);

	/* if the queue does not exist we're currently shutting down */
	if (NULL == queue)
	{
		MALI_DEBUG_PRINT(1, ("No notification queue registered with the session. Asking userspace to stop querying\n"));
		MALI_SUCCESS;
	}

	notification = _mali_osk_notification_create(args->type, 0);
	if ( NULL == notification)
	{
		MALI_PRINT_ERROR( ("Failed to create notification object\n")) ;
		return _MALI_OSK_ERR_NOMEM;
	}

	_mali_osk_notification_queue_send(queue, notification);

    MALI_SUCCESS; /* all ok */
}
开发者ID:CoreTech-Development,项目名称:buildroot-linux-kernel-m3,代码行数:29,代码来源:mali_kernel_core.c


示例12: pp_get_core_version_wrapper

int pp_get_core_version_wrapper(struct mali_session_data *session_data, _mali_uk_get_pp_core_version_s __user *uargs)
{
	_mali_uk_get_pp_core_version_s kargs;
	_mali_osk_errcode_t err;

	MALI_CHECK_NON_NULL(uargs, -EINVAL);
	MALI_CHECK_NON_NULL(session_data, -EINVAL);

	kargs.ctx = (uintptr_t)session_data;
	err = _mali_ukk_get_pp_core_version(&kargs);
	if (_MALI_OSK_ERR_OK != err) return map_errcode(err);

	if (0 != put_user(kargs.version, &uargs->version)) return -EFAULT;

	return 0;
}
开发者ID:HuaweiHonor4C,项目名称:kernel_hi6210sft_mm,代码行数:16,代码来源:mali_ukk_pp.c


示例13: _mali_ukk_get_gp_number_of_cores

_mali_osk_errcode_t _mali_ukk_get_gp_number_of_cores(_mali_uk_get_gp_number_of_cores_s *args)
{
	MALI_DEBUG_ASSERT_POINTER(args);
	MALI_CHECK_NON_NULL(args->ctx, _MALI_OSK_ERR_INVALID_ARGS);
	args->number_of_cores = 1;
	return _MALI_OSK_ERR_OK;
}
开发者ID:cm-3470,项目名称:android_kernel_samsung_degaslte,代码行数:7,代码来源:mali_gp_scheduler.c


示例14: _mali_ukk_close

_mali_osk_errcode_t _mali_ukk_close(void **context)
{
    int i;
	struct mali_session_data * session_data;

    MALI_CHECK_NON_NULL(context, _MALI_OSK_ERR_INVALID_ARGS);

	session_data = (struct mali_session_data *)*context;

	MALI_DEBUG_PRINT(2, ("Session ending\n"));

	/* end subsystem sessions in the reverse order they where started in */
	for (i = SUBSYSTEMS_COUNT - 1; i >= 0; --i)
    {
		if (NULL != subsystems[i]->session_end) subsystems[i]->session_end(session_data, &session_data->subsystem_data[i]);
	}

	_mali_osk_notification_queue_term(session_data->ioctl_queue);
	_mali_osk_free(session_data);

    *context = NULL;

	MALI_DEBUG_PRINT(2, ("Session has ended\n"));

    MALI_SUCCESS;
}
开发者ID:CoreTech-Development,项目名称:buildroot-linux-kernel-m3,代码行数:26,代码来源:mali_kernel_core.c


示例15: pmm_policy_init_job_control

_mali_osk_errcode_t pmm_policy_init_job_control( _mali_pmm_internal_state_t *pmm )
{
	_mali_osk_errcode_t err;
	MALI_DEBUG_ASSERT_POINTER( pmm );
	MALI_DEBUG_ASSERT( data_job_control == NULL );
	
	data_job_control = (_pmm_policy_data_job_control_t *) _mali_osk_malloc(sizeof(*data_job_control));
	MALI_CHECK_NON_NULL( data_job_control, _MALI_OSK_ERR_NOMEM );

	data_job_control->core_active_start = _mali_osk_time_tickcount();
	data_job_control->timeout = MALI_PMM_POLICY_JOBCONTROL_INACTIVITY_TIMEOUT;
	
	err = pmm_policy_timer_init( &data_job_control->latency, data_job_control->timeout, MALI_PMM_EVENT_TIMEOUT );
	if( err != _MALI_OSK_ERR_OK )
	{
		_mali_osk_free( data_job_control );
		data_job_control = NULL;
		return err;
	}
	
	/* Start the latency timeout */
	job_control_timeout_setup( pmm, &data_job_control->latency );
	
	MALI_SUCCESS;
}
开发者ID:abazad,项目名称:rockchip-rk3188-generic,代码行数:25,代码来源:mali_pmm_policy_jobcontrol.c


示例16: mem_map_ext_wrapper

int mem_map_ext_wrapper(struct mali_session_data *session_data, _mali_uk_map_external_mem_s __user * argument)
{
	_mali_uk_map_external_mem_s uk_args;
	_mali_osk_errcode_t err_code;

	/* validate input */
	/* the session_data pointer was validated by caller */
	MALI_CHECK_NON_NULL( argument, -EINVAL);

	/* get call arguments from user space. copy_from_user returns how many bytes which where NOT copied */
	if ( 0 != copy_from_user(&uk_args, (void __user *)argument, sizeof(_mali_uk_map_external_mem_s)) ) {
		return -EFAULT;
	}

	uk_args.ctx = session_data;
	err_code = _mali_ukk_map_external_mem( &uk_args );

	if (0 != put_user(uk_args.cookie, &argument->cookie)) {
		if (_MALI_OSK_ERR_OK == err_code) {
			/* Rollback */
			_mali_uk_unmap_external_mem_s uk_args_unmap;

			uk_args_unmap.ctx = session_data;
			uk_args_unmap.cookie = uk_args.cookie;
			err_code = _mali_ukk_unmap_external_mem( &uk_args_unmap );
			if (_MALI_OSK_ERR_OK != err_code) {
				MALI_DEBUG_PRINT(4, ("reverting _mali_ukk_unmap_external_mem, as a result of failing put_user(), failed\n"));
			}
		}
		return -EFAULT;
	}

	/* Return the error that _mali_ukk_free_big_block produced */
	return map_errcode(err_code);
}
开发者ID:Android-Dongyf,项目名称:itop-kernel,代码行数:35,代码来源:mali_ukk_mem.c


示例17: mem_init_wrapper

int mem_init_wrapper(struct mali_session_data *session_data, _mali_uk_init_mem_s __user *uargs)
{
    _mali_uk_init_mem_s kargs;
    _mali_osk_errcode_t err;

    MALI_CHECK_NON_NULL(uargs, -EINVAL);

    kargs.ctx = session_data;
    err = _mali_ukk_init_mem(&kargs);
    if (_MALI_OSK_ERR_OK != err)
    {
        return map_errcode(err);
    }

    if (0 != put_user(kargs.mali_address_base, &uargs->mali_address_base)) goto mem_init_rollback;
    if (0 != put_user(kargs.memory_size, &uargs->memory_size)) goto mem_init_rollback;

    return 0;

mem_init_rollback:
	{
		_mali_uk_term_mem_s kargs;
		kargs.ctx = session_data;
		err = _mali_ukk_term_mem(&kargs);
		if (_MALI_OSK_ERR_OK != err)
		{
			MALI_DEBUG_PRINT(4, ("reverting _mali_ukk_init_mem, as a result of failing put_user(), failed\n"));
		}
	}
    return -EFAULT;
}
开发者ID:Andro-Boy,项目名称:Googy-Max2-Kernel,代码行数:31,代码来源:mali_ukk_mem.c


示例18: mem_query_mmu_page_table_dump_size_wrapper

int mem_query_mmu_page_table_dump_size_wrapper(struct mali_session_data *session_data, _mali_uk_query_mmu_page_table_dump_size_s __user * uargs)
{
    _mali_uk_query_mmu_page_table_dump_size_s kargs;
    _mali_osk_errcode_t err;

    MALI_CHECK_NON_NULL(uargs, -EINVAL);
    MALI_CHECK_NON_NULL(session_data, -EINVAL);

    kargs.ctx = session_data;

    err = _mali_ukk_query_mmu_page_table_dump_size(&kargs);
    if (_MALI_OSK_ERR_OK != err) return map_errcode(err);

    if (0 != put_user(kargs.size, &uargs->size)) return -EFAULT;

    return 0;
}
开发者ID:Andro-Boy,项目名称:Googy-Max2-Kernel,代码行数:17,代码来源:mali_ukk_mem.c


示例19: mali_kernel_subsystem_core_system_info_fill

static _mali_osk_errcode_t mali_kernel_subsystem_core_system_info_fill(_mali_system_info* info)
{
    MALI_CHECK_NON_NULL(info, _MALI_OSK_ERR_INVALID_ARGS);

	info->drivermode = _MALI_DRIVER_MODE_NORMAL;

	MALI_SUCCESS;
}
开发者ID:CoreTech-Development,项目名称:buildroot-linux-kernel-m3,代码行数:8,代码来源:mali_kernel_core.c


示例20: gp_get_number_of_cores_wrapper

int gp_get_number_of_cores_wrapper(struct mali_session_data *session_data, _mali_uk_get_gp_number_of_cores_s __user *uargs)
{
	_mali_uk_get_gp_number_of_cores_s kargs;
	_mali_osk_errcode_t err;

	MALI_CHECK_NON_NULL(uargs, -EINVAL);
	MALI_CHECK_NON_NULL(session_data, -EINVAL);

	kargs.ctx = session_data;
	err = _mali_ukk_get_gp_number_of_cores(&kargs);
	if (_MALI_OSK_ERR_OK != err) return map_errcode(err);

	/* no known transactions to roll-back */

	if (0 != put_user(kargs.number_of_cores, &uargs->number_of_cores)) return -EFAULT;

	return 0;
}
开发者ID:GREYFOXRGR,项目名称:BPI-M3-bsp,代码行数:18,代码来源:mali_ukk_gp.c



注:本文中的MALI_CHECK_NON_NULL函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ MALI_DEBUG_ASSERT函数代码示例发布时间:2022-05-30
下一篇:
C++ MALI_ASSERT_GROUP_LOCKED函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap