2020-03-06 11:09:57 +01:00
|
|
|
/*
|
2023-02-16 16:51:55 +00:00
|
|
|
* Copyright (C) 2020-2023 Intel Corporation
|
2020-03-06 11:09:57 +01:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
2020-07-09 12:34:23 -04:00
|
|
|
#include "shared/source/helpers/non_copyable_or_moveable.h"
|
|
|
|
|
|
2020-03-06 11:09:57 +01:00
|
|
|
#include "pci.h"
|
|
|
|
|
|
2022-07-20 18:37:06 +00:00
|
|
|
#include <mutex>
|
2020-03-06 11:09:57 +01:00
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
|
|
namespace L0 {
|
|
|
|
|
|
2023-05-22 13:52:14 +00:00
|
|
|
class OsPci;
|
|
|
|
|
struct OsSysman;
|
2020-07-09 12:34:23 -04:00
|
|
|
class PciImp : public Pci, NEO::NonCopyableOrMovableClass {
|
2020-03-06 11:09:57 +01:00
|
|
|
public:
|
|
|
|
|
void init() override;
|
2020-07-29 02:45:54 -07:00
|
|
|
ze_result_t pciStaticProperties(zes_pci_properties_t *pProperties) override;
|
|
|
|
|
ze_result_t pciGetInitializedBars(uint32_t *pCount, zes_pci_bar_properties_t *pProperties) override;
|
2020-08-14 01:19:58 -07:00
|
|
|
ze_result_t pciGetState(zes_pci_state_t *pState) override;
|
2021-07-12 06:23:08 +00:00
|
|
|
void pciGetStaticFields();
|
2020-03-06 11:09:57 +01:00
|
|
|
|
2020-08-13 23:33:21 +05:30
|
|
|
PciImp(OsSysman *pOsSysman) : pOsSysman(pOsSysman){};
|
2020-03-06 11:09:57 +01:00
|
|
|
~PciImp() override;
|
2020-04-27 05:18:49 -04:00
|
|
|
OsPci *pOsPci = nullptr;
|
2020-03-06 11:09:57 +01:00
|
|
|
|
|
|
|
|
private:
|
2020-04-27 05:18:49 -04:00
|
|
|
OsSysman *pOsSysman = nullptr;
|
2021-06-22 19:03:31 -07:00
|
|
|
bool resizableBarSupported = false;
|
2020-07-29 02:45:54 -07:00
|
|
|
zes_pci_properties_t pciProperties = {};
|
|
|
|
|
std::vector<zes_pci_bar_properties_t *> pciBarProperties = {};
|
2022-07-20 18:37:06 +00:00
|
|
|
std::once_flag initPciOnce;
|
|
|
|
|
void initPci();
|
2020-03-06 11:09:57 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace L0
|