Message type for BUSC_PCI_GET_BAR

Change-Id: I5cb21f09a2c80473101f8da3f435e4dcc3b05491
This commit is contained in:
Lionel Sambuc 2014-05-15 11:45:42 +02:00
parent b562831340
commit ff905e5276
4 changed files with 31 additions and 15 deletions

View file

@ -534,16 +534,16 @@ message *mp;
int r, devind, port, ioflag; int r, devind, port, ioflag;
u32_t base, size; u32_t base, size;
devind= mp->BUSC_PGB_DEVIND; devind= mp->m_lsys_pci_busc_get_bar.devind;
port= mp->BUSC_PGB_PORT; port= mp->m_lsys_pci_busc_get_bar.port;
mp->m_type= pci_get_bar_s(devind, port, &base, &size, &ioflag); mp->m_type= pci_get_bar_s(devind, port, &base, &size, &ioflag);
if (mp->m_type == OK) if (mp->m_type == OK)
{ {
mp->BUSC_PGB_BASE= base; mp->m_pci_lsys_busc_get_bar.base= base;
mp->BUSC_PGB_SIZE= size; mp->m_pci_lsys_busc_get_bar.size= size;
mp->BUSC_PGB_IOFLAG= ioflag; mp->m_pci_lsys_busc_get_bar.flags= ioflag;
} }
r= ipc_send(mp->m_source, mp); r= ipc_send(mp->m_source, mp);

View file

@ -149,11 +149,6 @@
#define BUSC_PCI_GET_BAR (BUSC_RQ_BASE + 19) /* Get Base Address #define BUSC_PCI_GET_BAR (BUSC_RQ_BASE + 19) /* Get Base Address
* Register properties * Register properties
*/ */
#define BUSC_PGB_DEVIND m2_i1 /* device index */
#define BUSC_PGB_PORT m2_i2 /* port (BAR offset) */
#define BUSC_PGB_BASE m2_l1 /* BAR base address */
#define BUSC_PGB_SIZE m2_l2 /* BAR size */
#define BUSC_PGB_IOFLAG m2_i1 /* I/O space? */
#define IOMMU_MAP (BUSC_RQ_BASE + 32) /* Ask IOMMU to map #define IOMMU_MAP (BUSC_RQ_BASE + 32) /* Ask IOMMU to map
* a segment of memory * a segment of memory
*/ */

View file

@ -598,6 +598,23 @@ typedef struct {
} mess_lsys_krn_schedctl; } mess_lsys_krn_schedctl;
_ASSERT_MSG_SIZE(mess_lsys_krn_schedctl); _ASSERT_MSG_SIZE(mess_lsys_krn_schedctl);
typedef struct {
int devind;
int port;
uint8_t padding[48];
} mess_lsys_pci_busc_get_bar;
_ASSERT_MSG_SIZE(mess_lsys_pci_busc_get_bar);
typedef struct {
int base;
size_t size;
uint32_t flags;
uint8_t padding[44];
} mess_pci_lsys_busc_get_bar;
_ASSERT_MSG_SIZE(mess_pci_lsys_busc_get_bar);
typedef struct { typedef struct {
endpoint_t endpt; endpoint_t endpt;
@ -1233,6 +1250,8 @@ typedef struct {
mess_lsys_krn_schedctl m_lsys_krn_schedctl; mess_lsys_krn_schedctl m_lsys_krn_schedctl;
mess_lsys_krn_schedule m_lsys_krn_schedule; mess_lsys_krn_schedule m_lsys_krn_schedule;
mess_lsys_pci_busc_get_bar m_lsys_pci_busc_get_bar;
mess_lsys_pm_getepinfo m_lsys_pm_getepinfo; mess_lsys_pm_getepinfo m_lsys_pm_getepinfo;
mess_lsys_pm_getprocnr m_lsys_pm_getprocnr; mess_lsys_pm_getprocnr m_lsys_pm_getprocnr;
mess_lsys_pm_srv_fork m_lsys_pm_srv_fork; mess_lsys_pm_srv_fork m_lsys_pm_srv_fork;
@ -1244,6 +1263,8 @@ typedef struct {
mess_lsys_vfs_copyfd m_lsys_vfs_copyfd; mess_lsys_vfs_copyfd m_lsys_vfs_copyfd;
mess_lsys_vfs_mapdriver m_lsys_vfs_mapdriver; mess_lsys_vfs_mapdriver m_lsys_vfs_mapdriver;
mess_pci_lsys_busc_get_bar m_pci_lsys_busc_get_bar;
mess_pm_lexec_exec_new m_pm_lexec_exec_new; mess_pm_lexec_exec_new m_pm_lexec_exec_new;
mess_pm_lc_getgid m_pm_lc_getgid; mess_pm_lc_getgid m_pm_lc_getgid;

View file

@ -20,8 +20,8 @@ int *ioflag;
message m; message m;
m.m_type= BUSC_PCI_GET_BAR; m.m_type= BUSC_PCI_GET_BAR;
m.BUSC_PGB_DEVIND= devind; m.m_lsys_pci_busc_get_bar.devind = devind;
m.BUSC_PGB_PORT= port; m.m_lsys_pci_busc_get_bar.port = port;
r= ipc_sendrec(pci_procnr, &m); r= ipc_sendrec(pci_procnr, &m);
if (r != 0) if (r != 0)
@ -29,9 +29,9 @@ int *ioflag;
if (m.m_type == 0) if (m.m_type == 0)
{ {
*base= m.BUSC_PGB_BASE; *base= m.m_pci_lsys_busc_get_bar.base;
*size= m.BUSC_PGB_SIZE; *size= m.m_pci_lsys_busc_get_bar.size;
*ioflag= m.BUSC_PGB_IOFLAG; *ioflag= m.m_pci_lsys_busc_get_bar.flags;
} }
return m.m_type; return m.m_type;
} }