2018-10-31 01:29:32 +08:00
|
|
|
/*
|
2024-04-25 21:47:06 +08:00
|
|
|
* Copyright (C) 2018-2024 Intel Corporation
|
2018-10-31 01:29:32 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2022-11-23 17:14:27 +08:00
|
|
|
#include "aubstream/aubstream.h"
|
2018-10-31 01:29:32 +08:00
|
|
|
|
2019-02-23 08:35:37 +08:00
|
|
|
namespace aub_stream_stubs {
|
2019-02-01 03:03:42 +08:00
|
|
|
uint16_t tbxServerPort = 4321;
|
2019-02-23 08:35:37 +08:00
|
|
|
std::string tbxServerIp = "127.0.0.1";
|
2020-08-22 20:12:46 +08:00
|
|
|
bool tbxFrontdoorMode = false;
|
2024-04-25 21:47:06 +08:00
|
|
|
aub_stream::MMIOList mmioListInjected;
|
2019-02-23 08:35:37 +08:00
|
|
|
} // namespace aub_stream_stubs
|
|
|
|
|
|
|
|
namespace aub_stream {
|
2019-01-14 17:31:06 +08:00
|
|
|
|
2024-04-25 21:47:06 +08:00
|
|
|
void injectMMIOList(MMIOList mmioList) {
|
|
|
|
aub_stream_stubs::mmioListInjected = mmioList;
|
|
|
|
aub_stream_stubs::mmioListInjected.shrink_to_fit();
|
|
|
|
}
|
|
|
|
void setTbxServerPort(uint16_t port) {
|
|
|
|
aub_stream_stubs::tbxServerPort = port;
|
|
|
|
}
|
2019-03-18 23:47:57 +08:00
|
|
|
void setTbxServerIp(std::string server) {
|
|
|
|
// better to avoid reassigning global variables which assume memory allocations since
|
|
|
|
// we could step into false-positive memory leak detection with embedded leak check helper
|
2024-04-25 21:47:06 +08:00
|
|
|
if (aub_stream_stubs::tbxServerIp != server) {
|
2019-03-18 23:47:57 +08:00
|
|
|
aub_stream_stubs::tbxServerIp = server;
|
2024-04-25 21:47:06 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
void setTbxFrontdoorMode(bool frontdoor) {
|
|
|
|
aub_stream_stubs::tbxFrontdoorMode = frontdoor;
|
|
|
|
}
|
|
|
|
void setAubStreamCaller(uint32_t caller) {
|
2019-02-23 08:35:37 +08:00
|
|
|
}
|
|
|
|
|
2019-02-01 03:03:42 +08:00
|
|
|
} // namespace aub_stream
|