1/* 2 * Copyright (c) 2008 Mark D. Hill and David A. Wood 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 35 unchanged lines hidden (view full) --- 44 RubyPort::init(); 45 m_is_busy = false; 46 m_data_block_mask = ~ (~0 << RubySystem::getBlockSizeBits()); 47} 48 49RequestStatus 50DMASequencer::makeRequest(const RubyRequest &request) 51{ |
52 if (m_is_busy) { 53 return RequestStatus_BufferFull; 54 } 55 |
56 uint64_t paddr = request.paddr; 57 uint8_t* data = request.data; 58 int len = request.len; 59 bool write = false; 60 switch(request.type) { 61 case RubyRequestType_LD: 62 write = false; 63 break; --- 43 unchanged lines hidden (view full) --- 107} 108 109void 110DMASequencer::issueNext() 111{ 112 assert(m_is_busy == true); 113 active_request.bytes_completed = active_request.bytes_issued; 114 if (active_request.len == active_request.bytes_completed) { |
115 DPRINTF(RubyDma, "DMA request completed\n"); |
116 ruby_hit_callback(active_request.pkt); 117 m_is_busy = false; 118 return; 119 } 120 121 SequencerMsg *msg = new SequencerMsg; 122 msg->getPhysicalAddress() = Address(active_request.start_paddr + 123 active_request.bytes_completed); --- 17 unchanged lines hidden (view full) --- 141 msg->getType() = SequencerRequestType_ST; 142 } else { 143 msg->getType() = SequencerRequestType_LD; 144 } 145 146 assert(m_mandatory_q_ptr != NULL); 147 m_mandatory_q_ptr->enqueue(msg); 148 active_request.bytes_issued += msg->getLen(); |
149 DPRINTF(RubyDma, "Next DMA segment issued to the DMA cntrl\n"); |
150} 151 152void 153DMASequencer::dataCallback(const DataBlock & dblk) 154{ 155 assert(m_is_busy == true); 156 int len = active_request.bytes_issued - active_request.bytes_completed; 157 int offset = 0; --- 24 unchanged lines hidden --- |