Code is just moved around and not changed. This prepares for using pci in arm demos.
Signed-off-by: Henning Schild <[email protected]> --- inmates/lib/inmate_common.h | 26 ++++++++++++++++++++++++++ inmates/lib/x86/inmate.h | 26 -------------------------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/inmates/lib/inmate_common.h b/inmates/lib/inmate_common.h index 6c779b5..9b770a3 100644 --- a/inmates/lib/inmate_common.h +++ b/inmates/lib/inmate_common.h @@ -42,6 +42,24 @@ #define NS_PER_MSEC 1000000UL #define NS_PER_SEC 1000000000UL +#define PCI_CFG_VENDOR_ID 0x000 +#define PCI_CFG_DEVICE_ID 0x002 +#define PCI_CFG_COMMAND 0x004 +# define PCI_CMD_IO (1 << 0) +# define PCI_CMD_MEM (1 << 1) +# define PCI_CMD_MASTER (1 << 2) +# define PCI_CMD_INTX_OFF (1 << 10) +#define PCI_CFG_STATUS 0x006 +# define PCI_STS_INT (1 << 3) +# define PCI_STS_CAPS (1 << 4) +#define PCI_CFG_BAR 0x010 +# define PCI_BAR_64BIT 0x4 +#define PCI_CFG_CAP_PTR 0x034 + +#define PCI_ID_ANY 0xffff + +#define PCI_DEV_CLASS_OTHER 0xff + #ifndef __ASSEMBLY__ typedef s8 __s8; typedef u8 __u8; @@ -69,6 +87,14 @@ unsigned long strlen(const char *s); int strncmp(const char *s1, const char *s2, unsigned long n); int strcmp(const char *s1, const char *s2); +u32 pci_read_config(u16 bdf, unsigned int addr, unsigned int size); +void pci_write_config(u16 bdf, unsigned int addr, u32 value, + unsigned int size); +int pci_find_device(u16 vendor, u16 device, u16 start_bdf); +int pci_find_cap(u16 bdf, u16 cap); +void pci_msi_set_vector(u16 bdf, unsigned int vector); +void pci_msix_set_vector(u16 bdf, unsigned int vector, u32 index); + const char *cmdline_parse_str(const char *param, char *value_buffer, unsigned long buffer_size, const char *default_value); diff --git a/inmates/lib/x86/inmate.h b/inmates/lib/x86/inmate.h index 964a543..f903f24 100644 --- a/inmates/lib/x86/inmate.h +++ b/inmates/lib/x86/inmate.h @@ -62,24 +62,6 @@ #define APIC_LVL_ASSERT (1 << 14) -#define PCI_CFG_VENDOR_ID 0x000 -#define PCI_CFG_DEVICE_ID 0x002 -#define PCI_CFG_COMMAND 0x004 -# define PCI_CMD_IO (1 << 0) -# define PCI_CMD_MEM (1 << 1) -# define PCI_CMD_MASTER (1 << 2) -# define PCI_CMD_INTX_OFF (1 << 10) -#define PCI_CFG_STATUS 0x006 -# define PCI_STS_INT (1 << 3) -# define PCI_STS_CAPS (1 << 4) -#define PCI_CFG_BAR 0x010 -# define PCI_BAR_64BIT 0x4 -#define PCI_CFG_CAP_PTR 0x034 - -#define PCI_ID_ANY 0xffff - -#define PCI_DEV_CLASS_OTHER 0xff - #define PCI_CAP_MSI 0x05 #define PCI_CAP_MSIX 0x11 @@ -242,14 +224,6 @@ enum map_type { MAP_CACHED, MAP_UNCACHED }; void *alloc(unsigned long size, unsigned long align); void map_range(void *start, unsigned long size, enum map_type map_type); -u32 pci_read_config(u16 bdf, unsigned int addr, unsigned int size); -void pci_write_config(u16 bdf, unsigned int addr, u32 value, - unsigned int size); -int pci_find_device(u16 vendor, u16 device, u16 start_bdf); -int pci_find_cap(u16 bdf, u16 cap); -void pci_msi_set_vector(u16 bdf, unsigned int vector); -void pci_msix_set_vector(u16 bdf, unsigned int vector, u32 index); - extern volatile u32 smp_num_cpus; extern u8 smp_cpu_ids[SMP_MAX_CPUS]; void smp_wait_for_all_cpus(void); -- 2.13.6 -- You received this message because you are subscribed to the Google Groups "Jailhouse" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
