示例#1
0
文件: api.c 项目: 01org/intel-cmt-cat
int
pqos_alloc_assoc_get(const unsigned lcore,
                     unsigned *class_id)
{
	int ret;

	if (class_id == NULL)
		return PQOS_RETVAL_PARAM;

	_pqos_api_lock();

        ret = _pqos_check_init(1);
        if (ret != PQOS_RETVAL_OK) {
                _pqos_api_unlock();
                return ret;
        }

	if (m_interface == PQOS_INTER_MSR)
		ret = hw_alloc_assoc_get(lcore, class_id);
	else {
#ifdef __linux__
		ret = os_alloc_assoc_get(lcore, class_id);
#else
                LOG_INFO("OS interface not supported!\n");
                ret = PQOS_RETVAL_RESOURCE;
#endif
        }
	_pqos_api_unlock();

	return ret;
}
示例#2
0
int pqos_alloc_assoc_get(const unsigned lcore,
                         unsigned *class_id)
{
	int ret;

	_pqos_api_lock();

        ret = _pqos_check_init(1);
        if (ret != PQOS_RETVAL_OK) {
                _pqos_api_unlock();
                return ret;
        }

	ret = hw_alloc_assoc_get(lcore, class_id);

	_pqos_api_unlock();

	return ret;
}