From: Lionel Sambuc Date: Thu, 15 May 2014 09:45:42 +0000 (+0200) Subject: Message type for BUSC_PCI_GET_BAR X-Git-Tag: v3.3.0~245 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/man.host.html?a=commitdiff_plain;h=ff905e5276fef8e572e97c77dbca4ef884fdcc7b;p=minix.git Message type for BUSC_PCI_GET_BAR Change-Id: I5cb21f09a2c80473101f8da3f435e4dcc3b05491 --- diff --git a/drivers/pci/main.c b/drivers/pci/main.c index 392719bcf..1e76f02ce 100644 --- a/drivers/pci/main.c +++ b/drivers/pci/main.c @@ -534,16 +534,16 @@ message *mp; int r, devind, port, ioflag; u32_t base, size; - devind= mp->BUSC_PGB_DEVIND; - port= mp->BUSC_PGB_PORT; + devind= mp->m_lsys_pci_busc_get_bar.devind; + port= mp->m_lsys_pci_busc_get_bar.port; mp->m_type= pci_get_bar_s(devind, port, &base, &size, &ioflag); if (mp->m_type == OK) { - mp->BUSC_PGB_BASE= base; - mp->BUSC_PGB_SIZE= size; - mp->BUSC_PGB_IOFLAG= ioflag; + mp->m_pci_lsys_busc_get_bar.base= base; + mp->m_pci_lsys_busc_get_bar.size= size; + mp->m_pci_lsys_busc_get_bar.flags= ioflag; } r= ipc_send(mp->m_source, mp); diff --git a/include/minix/com.h b/include/minix/com.h index 39b2665ea..8cf461ae5 100644 --- a/include/minix/com.h +++ b/include/minix/com.h @@ -149,11 +149,6 @@ #define BUSC_PCI_GET_BAR (BUSC_RQ_BASE + 19) /* Get Base Address * 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 * a segment of memory */ diff --git a/include/minix/ipc.h b/include/minix/ipc.h index 4eacc63e9..86ce534d8 100644 --- a/include/minix/ipc.h +++ b/include/minix/ipc.h @@ -598,6 +598,23 @@ typedef struct { } 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 { endpoint_t endpt; @@ -1233,6 +1250,8 @@ typedef struct { mess_lsys_krn_schedctl m_lsys_krn_schedctl; 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_getprocnr m_lsys_pm_getprocnr; 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_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_lc_getgid m_pm_lc_getgid; diff --git a/lib/libsys/pci_get_bar.c b/lib/libsys/pci_get_bar.c index a629f62f2..7fff04341 100644 --- a/lib/libsys/pci_get_bar.c +++ b/lib/libsys/pci_get_bar.c @@ -20,8 +20,8 @@ int *ioflag; message m; m.m_type= BUSC_PCI_GET_BAR; - m.BUSC_PGB_DEVIND= devind; - m.BUSC_PGB_PORT= port; + m.m_lsys_pci_busc_get_bar.devind = devind; + m.m_lsys_pci_busc_get_bar.port = port; r= ipc_sendrec(pci_procnr, &m); if (r != 0) @@ -29,9 +29,9 @@ int *ioflag; if (m.m_type == 0) { - *base= m.BUSC_PGB_BASE; - *size= m.BUSC_PGB_SIZE; - *ioflag= m.BUSC_PGB_IOFLAG; + *base= m.m_pci_lsys_busc_get_bar.base; + *size= m.m_pci_lsys_busc_get_bar.size; + *ioflag= m.m_pci_lsys_busc_get_bar.flags; } return m.m_type; }