diff options
author | Martin Braun <martin.braun@ettus.com> | 2016-10-31 14:30:52 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2016-11-08 08:02:22 -0800 |
commit | 99c2730bc9db270560671f2d7d173768465ed51f (patch) | |
tree | bc4df495734a075ebe2f7917cf67dec6fb7d8177 /host/lib/rfnoc/ctrl_iface.cpp | |
parent | 218f4b0b63927110df9dbbaa8353c346eee2d98a (diff) | |
download | uhd-99c2730bc9db270560671f2d7d173768465ed51f.tar.gz uhd-99c2730bc9db270560671f2d7d173768465ed51f.tar.bz2 uhd-99c2730bc9db270560671f2d7d173768465ed51f.zip |
Remove all boost:: namespace prefix for uint32_t, int32_t etc. (fixed-width types)
- Also removes all references to boost/cstdint.hpp and replaces it with
stdint.h (The 'correct' replacement would be <cstdint>, but not all of our
compilers support that).
Diffstat (limited to 'host/lib/rfnoc/ctrl_iface.cpp')
-rw-r--r-- | host/lib/rfnoc/ctrl_iface.cpp | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/host/lib/rfnoc/ctrl_iface.cpp b/host/lib/rfnoc/ctrl_iface.cpp index 83c3a2626..b2ac1778e 100644 --- a/host/lib/rfnoc/ctrl_iface.cpp +++ b/host/lib/rfnoc/ctrl_iface.cpp @@ -50,7 +50,7 @@ public: ctrl_iface_impl(const bool big_endian, uhd::transport::zero_copy_if::sptr ctrl_xport, uhd::transport::zero_copy_if::sptr resp_xport, - const boost::uint32_t sid, const std::string &name + const uint32_t sid, const std::string &name ) : _link_type(vrt::if_packet_info_t::LINK_TYPE_CHDR), _packet_type(vrt::if_packet_info_t::PACKET_TYPE_CONTEXT), @@ -83,24 +83,24 @@ public: /******************************************************************* * Peek and poke 32 bit implementation ******************************************************************/ - void poke32(const wb_addr_type addr, const boost::uint32_t data) + void poke32(const wb_addr_type addr, const uint32_t data) { boost::mutex::scoped_lock lock(_mutex); this->send_pkt(addr/4, data); this->wait_for_ack(false); } - boost::uint32_t peek32(const wb_addr_type addr) + uint32_t peek32(const wb_addr_type addr) { boost::mutex::scoped_lock lock(_mutex); this->send_pkt(_rb_address, addr/8); - const boost::uint64_t res = this->wait_for_ack(true); - const boost::uint32_t lo = boost::uint32_t(res & 0xffffffff); - const boost::uint32_t hi = boost::uint32_t(res >> 32); + const uint64_t res = this->wait_for_ack(true); + const uint32_t lo = uint32_t(res & 0xffffffff); + const uint32_t hi = uint32_t(res >> 32); return ((addr/4) & 0x1)? hi : lo; } - boost::uint64_t peek64(const wb_addr_type addr) + uint64_t peek64(const wb_addr_type addr) { boost::mutex::scoped_lock lock(_mutex); this->send_pkt(_rb_address, addr/8); @@ -134,26 +134,26 @@ private: // This is the buffer type for response messages struct resp_buff_type { - boost::uint32_t data[8]; + uint32_t data[8]; }; /******************************************************************* * Primary control and interaction private methods ******************************************************************/ - inline void send_pkt(const boost::uint32_t addr, const boost::uint32_t data = 0) + inline void send_pkt(const uint32_t addr, const uint32_t data = 0) { managed_send_buffer::sptr buff = _ctrl_xport->get_send_buff(0.0); if (not buff) { throw uhd::runtime_error("fifo ctrl timed out getting a send buffer"); } - boost::uint32_t *pkt = buff->cast<boost::uint32_t *>(); + uint32_t *pkt = buff->cast<uint32_t *>(); //load packet info vrt::if_packet_info_t packet_info; packet_info.link_type = _link_type; packet_info.packet_type = _packet_type; packet_info.num_payload_words32 = 2; - packet_info.num_payload_bytes = packet_info.num_payload_words32*sizeof(boost::uint32_t); + packet_info.num_payload_bytes = packet_info.num_payload_words32*sizeof(uint32_t); packet_info.packet_count = _seq_out; packet_info.tsf = _time.to_ticks(_tick_rate); packet_info.sob = false; @@ -175,12 +175,12 @@ private: //UHD_MSG(status) << boost::format("0x%08x, 0x%08x\n") % addr % data; //send the buffer over the interface _outstanding_seqs.push(_seq_out); - buff->commit(sizeof(boost::uint32_t)*(packet_info.num_packet_words32)); + buff->commit(sizeof(uint32_t)*(packet_info.num_packet_words32)); _seq_out++;//inc seq for next call } - UHD_INLINE boost::uint64_t wait_for_ack(const bool readback) + UHD_INLINE uint64_t wait_for_ack(const bool readback) { while (readback or (_outstanding_seqs.size() >= _resp_queue_size)) { @@ -193,7 +193,7 @@ private: vrt::if_packet_info_t packet_info; resp_buff_type resp_buff; memset(&resp_buff, 0x00, sizeof(resp_buff)); - boost::uint32_t const *pkt = NULL; + uint32_t const *pkt = NULL; managed_recv_buffer::sptr buff; //get buffer from response endpoint - or die in timeout @@ -209,8 +209,8 @@ private: { throw uhd::io_error(str(boost::format("Block ctrl (%s) no response packet - %s") % _name % ex.what())); } - pkt = buff->cast<const boost::uint32_t *>(); - packet_info.num_packet_words32 = buff->size()/sizeof(boost::uint32_t); + pkt = buff->cast<const uint32_t *>(); + packet_info.num_packet_words32 = buff->size()/sizeof(uint32_t); } //get buffer from response endpoint - or die in timeout @@ -238,7 +238,7 @@ private: } pkt = resp_buff.data; - packet_info.num_packet_words32 = sizeof(resp_buff)/sizeof(boost::uint32_t); + packet_info.num_packet_words32 = sizeof(resp_buff)/sizeof(uint32_t); } //parse the buffer @@ -266,7 +266,7 @@ private: try { UHD_ASSERT_THROW(packet_info.has_sid); - if (packet_info.sid != boost::uint32_t((_sid >> 16) | (_sid << 16))) { + if (packet_info.sid != uint32_t((_sid >> 16) | (_sid << 16))) { throw uhd::io_error( str( boost::format("Expected SID: %s Received SID: %s") @@ -297,8 +297,8 @@ private: //return the readback value if (readback and _outstanding_seqs.empty()) { - const boost::uint64_t hi = (_bige)? uhd::ntohx(pkt[packet_info.num_header_words32+0]) : uhd::wtohx(pkt[packet_info.num_header_words32+0]); - const boost::uint64_t lo = (_bige)? uhd::ntohx(pkt[packet_info.num_header_words32+1]) : uhd::wtohx(pkt[packet_info.num_header_words32+1]); + const uint64_t hi = (_bige)? uhd::ntohx(pkt[packet_info.num_header_words32+0]) : uhd::wtohx(pkt[packet_info.num_header_words32+0]); + const uint64_t lo = (_bige)? uhd::ntohx(pkt[packet_info.num_header_words32+1]) : uhd::wtohx(pkt[packet_info.num_header_words32+1]); return ((hi << 32) | lo); } } @@ -316,7 +316,7 @@ private: */ bool check_dump_queue(resp_buff_type& b) { const size_t min_buff_size = 8; // Same value as in b200_io_impl->handle_async_task - boost::uint32_t recv_sid = (((_sid)<<16)|((_sid)>>16)); + uint32_t recv_sid = (((_sid)<<16)|((_sid)>>16)); uhd::msg_task::msg_payload_t msg; do{ msg = _async_task->get_msg_from_dump_queue(recv_sid); @@ -330,7 +330,7 @@ private: return false; } - void push_response(const boost::uint32_t *buff) + void push_response(const uint32_t *buff) { resp_buff_type resp_buff; std::memcpy(resp_buff.data, buff, sizeof(resp_buff)); @@ -348,7 +348,7 @@ private: const uhd::transport::zero_copy_if::sptr _ctrl_xport; const uhd::transport::zero_copy_if::sptr _resp_xport; uhd::msg_task::sptr _async_task; - const boost::uint32_t _sid; + const uint32_t _sid; const std::string _name; boost::mutex _mutex; size_t _seq_out; @@ -367,7 +367,7 @@ ctrl_iface::sptr ctrl_iface::make( const bool big_endian, zero_copy_if::sptr ctrl_xport, zero_copy_if::sptr resp_xport, - const boost::uint32_t sid, + const uint32_t sid, const std::string &name ) { return sptr(new ctrl_iface_impl( |