diff options
| author | GuEe-GUI <[email protected]> | 2024-12-11 19:28:20 +0800 |
|---|---|---|
| committer | Rbb666 <[email protected]> | 2024-12-13 10:39:20 +0800 |
| commit | d248a3a2887dc4ec56c5d9cf8ffa535665f42eeb (patch) | |
| tree | 7f0e03b6cf9353e8ffb072ce2011c803d9b14af8 /components/drivers | |
| parent | 76d3cf3b8688f170a0cef4d3816488f54de8c756 (diff) | |
[DM/FIXUP] Fixup PCI build
1. Add PCI include in rtdevice.h
2. Fixup `RT_KEY_ENABLED` loss.
3. remove waring type of `dw_pcie_ep_get_func_from_ep` return.
Signed-off-by: GuEe-GUI <[email protected]>
Diffstat (limited to 'components/drivers')
| -rw-r--r-- | components/drivers/include/drivers/misc.h | 6 | ||||
| -rw-r--r-- | components/drivers/include/rtdevice.h | 10 | ||||
| -rw-r--r-- | components/drivers/pci/host/dw/pcie-dw.h | 2 |
3 files changed, 17 insertions, 1 deletions
diff --git a/components/drivers/include/drivers/misc.h b/components/drivers/include/drivers/misc.h index 9579773e9a..516a2f3721 100644 --- a/components/drivers/include/drivers/misc.h +++ b/components/drivers/include/drivers/misc.h @@ -34,6 +34,12 @@ (((__x) - ((__d) / 2)) / (__d)); \ }) +#define __KEY_PLACEHOLDER_1 0, +#define ____KEY_ENABLED(__ignored, val, ...) val +#define ___KEY_ENABLED(arg1_or_junk) ____KEY_ENABLED(arg1_or_junk 1, 0) +#define __KEY_ENABLED(value) ___KEY_ENABLED(__KEY_PLACEHOLDER_##value) +#define RT_KEY_ENABLED(key) __KEY_ENABLED(key) + #define RT_FIELD_PREP(mask, val) (((rt_uint64_t)(val) << (__rt_ffsl((mask)) - 1)) & (mask)) #define RT_FIELD_GET(mask, val) (((val) & (mask)) >> (__rt_ffsl((mask)) - 1)) diff --git a/components/drivers/include/rtdevice.h b/components/drivers/include/rtdevice.h index 1f007630df..09f5e455f7 100644 --- a/components/drivers/include/rtdevice.h +++ b/components/drivers/include/rtdevice.h @@ -89,6 +89,16 @@ extern "C" { #include "drivers/pic.h" #endif /* RT_USING_PIC */ +#ifdef RT_USING_PCI +#include "drivers/pci.h" +#ifdef RT_PCI_MSI +#include "drivers/pci_msi.h" +#endif /* RT_PCI_MSI */ +#ifdef RT_PCI_ENDPOINT +#include "drivers/pci_endpoint.h" +#endif /* RT_PCI_ENDPOINT */ +#endif /* RT_USING_PCI */ + #ifdef RT_USING_REGULATOR #include "drivers/regulator.h" #endif /* RT_USING_REGULATOR */ diff --git a/components/drivers/pci/host/dw/pcie-dw.h b/components/drivers/pci/host/dw/pcie-dw.h index c0760bf884..0a1183f2d5 100644 --- a/components/drivers/pci/host/dw/pcie-dw.h +++ b/components/drivers/pci/host/dw/pcie-dw.h @@ -435,6 +435,6 @@ EP_API rt_err_t dw_pcie_ep_inbound_atu(struct dw_pcie_ep *ep, rt_uint8_t func_no EP_API rt_err_t dw_pcie_ep_outbound_atu(struct dw_pcie_ep *ep, rt_uint8_t func_no, rt_ubase_t phys_addr, rt_uint64_t pci_addr, rt_size_t size) EP_RET(-RT_ENOSYS) -EP_API struct dw_pcie_ep_func *dw_pcie_ep_get_func_from_ep(struct dw_pcie_ep *ep, rt_uint8_t func_no) EP_RET() +EP_API struct dw_pcie_ep_func *dw_pcie_ep_get_func_from_ep(struct dw_pcie_ep *ep, rt_uint8_t func_no) EP_RET(RT_NULL) #endif /* __PCIE_DESIGNWARE_H__ */ |
