Skip to content

Commit 359b7af

Browse files
committed
[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]>
1 parent 8cfec4f commit 359b7af

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

components/drivers/include/drivers/misc.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@
3434
(((__x) - ((__d) / 2)) / (__d)); \
3535
})
3636

37+
#define __KEY_PLACEHOLDER_1 0,
38+
#define ____KEY_ENABLED(__ignored, val, ...) val
39+
#define ___KEY_ENABLED(arg1_or_junk) ____KEY_ENABLED(arg1_or_junk 1, 0)
40+
#define __KEY_ENABLED(value) ___KEY_ENABLED(__KEY_PLACEHOLDER_##value)
41+
#define RT_KEY_ENABLED(key) __KEY_ENABLED(key)
42+
3743
#define RT_FIELD_PREP(mask, val) (((rt_uint64_t)(val) << (__rt_ffsl((mask)) - 1)) & (mask))
3844
#define RT_FIELD_GET(mask, val) (((val) & (mask)) >> (__rt_ffsl((mask)) - 1))
3945

components/drivers/include/rtdevice.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,16 @@ extern "C" {
8989
#include "drivers/pic.h"
9090
#endif /* RT_USING_PIC */
9191

92+
#ifdef RT_USING_PCI
93+
#include "drivers/pci.h"
94+
#ifdef RT_PCI_MSI
95+
#include "drivers/pci_msi.h"
96+
#endif /* RT_PCI_MSI */
97+
#ifdef RT_PCI_ENDPOINT
98+
#include "drivers/pci_endpoint.h"
99+
#endif /* RT_PCI_ENDPOINT */
100+
#endif /* RT_USING_PCI */
101+
92102
#ifdef RT_USING_REGULATOR
93103
#include "drivers/regulator.h"
94104
#endif /* RT_USING_REGULATOR */

components/drivers/pci/host/dw/pcie-dw.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,6 @@ EP_API rt_err_t dw_pcie_ep_inbound_atu(struct dw_pcie_ep *ep, rt_uint8_t func_no
435435
EP_API rt_err_t dw_pcie_ep_outbound_atu(struct dw_pcie_ep *ep, rt_uint8_t func_no,
436436
rt_ubase_t phys_addr, rt_uint64_t pci_addr, rt_size_t size) EP_RET(-RT_ENOSYS)
437437

438-
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()
438+
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)
439439

440440
#endif /* __PCIE_DESIGNWARE_H__ */

0 commit comments

Comments
 (0)