Example #1
0
int
pqos_alloc_release(const unsigned *core_array,
                   const unsigned core_num)
{
	int ret;

        if (core_num == 0 || core_array == 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_release(core_array, core_num);
        else {
#ifdef __linux__
                ret = os_alloc_release(core_array, core_num);
#else
                LOG_INFO("OS interface not supported!\n");
                ret = PQOS_RETVAL_RESOURCE;
#endif
        }
	_pqos_api_unlock();

	return ret;
}
Example #2
0
int pqos_alloc_release(const unsigned *core_array,
                       const unsigned core_num)
{
	int ret;

	_pqos_api_lock();

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

	ret = hw_alloc_release(core_array, core_num);

	_pqos_api_unlock();

	return ret;
}