aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/x300
diff options
context:
space:
mode:
authorAshish Chaudhari <ashish@ettus.com>2014-04-25 09:52:23 -0700
committerAshish Chaudhari <ashish@ettus.com>2014-04-25 09:52:23 -0700
commite85062880b02db9527f6aa0a86299c7bc95a731d (patch)
tree536f90952caa4bd588b5b6bac9098783393bf19f /host/lib/usrp/x300
parent09ca0f535ee953939a8317e2f685ae282d7fa9c6 (diff)
downloaduhd-e85062880b02db9527f6aa0a86299c7bc95a731d.tar.gz
uhd-e85062880b02db9527f6aa0a86299c7bc95a731d.tar.bz2
uhd-e85062880b02db9527f6aa0a86299c7bc95a731d.zip
x300: Addressed review feedback
- Fixed synchronization for unclaim - Removed stray RIO addr space set
Diffstat (limited to 'host/lib/usrp/x300')
-rw-r--r--host/lib/usrp/x300/x300_impl.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/host/lib/usrp/x300/x300_impl.cpp b/host/lib/usrp/x300/x300_impl.cpp
index 7cb5d9ad8..e931b7983 100644
--- a/host/lib/usrp/x300/x300_impl.cpp
+++ b/host/lib/usrp/x300/x300_impl.cpp
@@ -859,13 +859,14 @@ x300_impl::~x300_impl(void)
//kill the claimer task and unclaim the device
mb.claimer_task.reset();
- mb.zpu_ctrl->poke32(SR_ADDR(X300_FW_SHMEM_BASE, X300_FW_SHMEM_CLAIM_TIME), 0);
- mb.zpu_ctrl->poke32(SR_ADDR(X300_FW_SHMEM_BASE, X300_FW_SHMEM_CLAIM_SRC), 0);
-
- boost::mutex::scoped_lock(pcie_zpu_iface_registry_mutex);
- //If the process is killed, the entire registry will disappear so we
- //don't need to worry about unclean shutdowns here.
- get_pcie_zpu_iface_registry().pop(mb.addr);
+ { //Critical section
+ boost::mutex::scoped_lock(pcie_zpu_iface_registry_mutex);
+ mb.zpu_ctrl->poke32(SR_ADDR(X300_FW_SHMEM_BASE, X300_FW_SHMEM_CLAIM_TIME), 0);
+ mb.zpu_ctrl->poke32(SR_ADDR(X300_FW_SHMEM_BASE, X300_FW_SHMEM_CLAIM_SRC), 0);
+ //If the process is killed, the entire registry will disappear so we
+ //don't need to worry about unclean shutdowns here.
+ get_pcie_zpu_iface_registry().pop(mb.addr);
+ }
}
}
catch(...)
@@ -1491,10 +1492,11 @@ void x300_impl::set_fp_gpio(gpio_core_200::sptr gpio, const std::string &attr, c
void x300_impl::claimer_loop(wb_iface::sptr iface)
{
- boost::mutex::scoped_lock(claimer_mutex);
-
- iface->poke32(SR_ADDR(X300_FW_SHMEM_BASE, X300_FW_SHMEM_CLAIM_TIME), time(NULL));
- iface->poke32(SR_ADDR(X300_FW_SHMEM_BASE, X300_FW_SHMEM_CLAIM_SRC), get_process_hash());
+ { //Critical section
+ boost::mutex::scoped_lock(claimer_mutex);
+ iface->poke32(SR_ADDR(X300_FW_SHMEM_BASE, X300_FW_SHMEM_CLAIM_TIME), time(NULL));
+ iface->poke32(SR_ADDR(X300_FW_SHMEM_BASE, X300_FW_SHMEM_CLAIM_SRC), get_process_hash());
+ }
boost::this_thread::sleep(boost::posix_time::milliseconds(1000)); //1 second
}