2019-09-02 23:09:31 +08:00
|
|
|
function [bytes, nbytes] = eq_get_abi(setsize)
|
2018-11-30 00:56:00 +08:00
|
|
|
|
2019-09-02 23:09:31 +08:00
|
|
|
%% Return current SOF ABI header
|
2018-11-30 00:56:00 +08:00
|
|
|
%
|
2019-09-02 23:09:31 +08:00
|
|
|
% [bytes, nbytes] = eq_get_abi(setsize)
|
2018-11-30 00:56:00 +08:00
|
|
|
%
|
2019-09-02 23:09:31 +08:00
|
|
|
|
|
|
|
% SPDX-License-Identifier: BSD-3-Clause
|
2018-11-30 00:56:00 +08:00
|
|
|
%
|
2019-09-02 23:09:31 +08:00
|
|
|
% Copyright(c) 2018 Intel Corporation. All rights reserved.
|
2018-11-30 00:56:00 +08:00
|
|
|
%
|
2019-09-02 23:09:31 +08:00
|
|
|
% Author: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
|
2018-11-30 00:56:00 +08:00
|
|
|
|
2019-09-02 23:09:31 +08:00
|
|
|
%% Use sof-ctl to write ABI header into a file
|
|
|
|
abifn = 'eq_get_abi.bin';
|
2020-03-31 16:27:05 +08:00
|
|
|
cmd = sprintf('sof-ctl -g %d -b -o %s > /dev/null', setsize, abifn);
|
2019-09-02 23:09:31 +08:00
|
|
|
system(cmd);
|
2018-11-30 00:56:00 +08:00
|
|
|
|
2019-09-02 23:09:31 +08:00
|
|
|
%% Read file and delete it
|
|
|
|
fh = fopen(abifn, 'r');
|
|
|
|
if fh < 0
|
|
|
|
error("Failed to get ABI header. Is sof-ctl installed?");
|
|
|
|
end
|
|
|
|
[bytes, nbytes] = fread(fh, inf, 'uint8');
|
|
|
|
fclose(fh);
|
|
|
|
delete(abifn);
|
2018-11-30 00:56:00 +08:00
|
|
|
|
|
|
|
end
|