[rtems commit] leon, grspw_router: Clear only error bits defined by clear mask

Daniel Hellstrom danielh at rtems.org
Tue Nov 14 09:28:06 UTC 2017


Module:    rtems
Branch:    master
Commit:    2727bc7f80c6ebe5af7bd5711cf1f80ef18911fc
Changeset: http://git.rtems.org/rtems/commit/?id=2727bc7f80c6ebe5af7bd5711cf1f80ef18911fc

Author:    Javier Jalle <javier.jalle at gaisler.com>
Date:      Tue Jun 20 17:39:21 2017 +0200

leon, grspw_router: Clear only error bits defined by clear mask

---

 c/src/lib/libbsp/sparc/shared/include/grspw_router.h | 2 +-
 c/src/lib/libbsp/sparc/shared/spw/grspw_router.c     | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/c/src/lib/libbsp/sparc/shared/include/grspw_router.h b/c/src/lib/libbsp/sparc/shared/include/grspw_router.h
index 94e13b1..2fab8d5 100644
--- a/c/src/lib/libbsp/sparc/shared/include/grspw_router.h
+++ b/c/src/lib/libbsp/sparc/shared/include/grspw_router.h
@@ -328,7 +328,7 @@ extern int router_port_maxplen_set(void *d, int port, uint32_t length);
 #define PSTS_PE_BIT 0
 
 /* Check Port Status register and clear errors if there are */
-extern int router_port_status(void *d, int port, uint32_t *sts);
+extern int router_port_status(void *d, int port, uint32_t *sts, uint32_t clrmsk);
 
 #define ROUTER_LINK_STATUS_ERROR_RESET 0
 #define ROUTER_LINK_STATUS_ERROR_WAIT 1
diff --git a/c/src/lib/libbsp/sparc/shared/spw/grspw_router.c b/c/src/lib/libbsp/sparc/shared/spw/grspw_router.c
index c65a2fb..d95c351 100644
--- a/c/src/lib/libbsp/sparc/shared/spw/grspw_router.c
+++ b/c/src/lib/libbsp/sparc/shared/spw/grspw_router.c
@@ -1331,7 +1331,7 @@ int router_port_ctrl_get(void *d, int port, uint32_t *ctrl)
 }
 
 /* Read Port Status register and clear errors if there are */
-int router_port_status(void *d, int port, uint32_t *sts, uint32_t clrmsk) /* review clrmsks */
+int router_port_status(void *d, int port, uint32_t *sts, uint32_t clrmsk)
 {
 	struct router_priv *priv = d;
 	int error = router_check_port(d, port);
@@ -1350,7 +1350,7 @@ int router_port_status(void *d, int port, uint32_t *sts, uint32_t clrmsk) /* rev
 	if (port == 0) {
 		REG_WRITE(&priv->regs->psts[port], ((*sts) & (PSTSCFG_WCLEAR & clrmsk)) | (PSTSCFG_WCLEAR2 & clrmsk));
 	}else{
-		REG_WRITE(&priv->regs->psts[port], (*sts) & PSTS_WCLEAR);
+		REG_WRITE(&priv->regs->psts[port], (*sts) & (PSTS_WCLEAR & clrmsk));
 	}
 	SPIN_UNLOCK_IRQ(&priv->plock[port], irqflags);
 	return ROUTER_ERR_OK;



More information about the vc mailing list