]> git.proxmox.com Git - qemu.git/blobdiff - hw/soc_dma.c
user: Restore debug usage message for '-d ?' in user mode emulation
[qemu.git] / hw / soc_dma.c
index 4c87c8b9bdeef05fc271a262c5dffaae3884ef98..3f0f4141004493e0b663d724af0a8b9590922cb0 100644 (file)
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 #include "qemu-common.h"
 #include "qemu-timer.h"
 #include "soc_dma.h"
 
-void transfer_mem2mem(struct soc_dma_ch_s *ch)
+static void transfer_mem2mem(struct soc_dma_ch_s *ch)
 {
     memcpy(ch->paddr[0], ch->paddr[1], ch->bytes);
     ch->paddr[0] += ch->bytes;
     ch->paddr[1] += ch->bytes;
 }
 
-void transfer_mem2fifo(struct soc_dma_ch_s *ch)
+static void transfer_mem2fifo(struct soc_dma_ch_s *ch)
 {
     ch->io_fn[1](ch->io_opaque[1], ch->paddr[0], ch->bytes);
     ch->paddr[0] += ch->bytes;
 }
 
-void transfer_fifo2mem(struct soc_dma_ch_s *ch)
+static void transfer_fifo2mem(struct soc_dma_ch_s *ch)
 {
     ch->io_fn[0](ch->io_opaque[0], ch->paddr[1], ch->bytes);
     ch->paddr[1] += ch->bytes;
@@ -47,7 +45,7 @@ void transfer_fifo2mem(struct soc_dma_ch_s *ch)
  * oprating systems may not need to use them.  */
 static void *fifo_buf;
 static int fifo_size;
-void transfer_fifo2fifo(struct soc_dma_ch_s *ch)
+static void transfer_fifo2fifo(struct soc_dma_ch_s *ch)
 {
     if (ch->bytes > fifo_size)
         fifo_buf = qemu_realloc(fifo_buf, fifo_size = ch->bytes);
@@ -86,7 +84,7 @@ struct dma_s {
 
 static void soc_dma_ch_schedule(struct soc_dma_ch_s *ch, int delay_bytes)
 {
-    int64_t now = qemu_get_clock(vm_clock);
+    int64_t now = qemu_get_clock_ns(vm_clock);
     struct dma_s *dma = (struct dma_s *) ch->dma;
 
     qemu_mod_timer(ch->timer, now + delay_bytes / dma->channel_freq);
@@ -194,12 +192,13 @@ static void soc_dma_ch_freq_update(struct dma_s *s)
     if (s->enabled_count)
         /* We completely ignore channel priorities and stuff */
         s->channel_freq = s->soc.freq / s->enabled_count;
-    else
+    else {
         /* TODO: Signal that we want to disable the functional clock and let
          * the platform code decide what to do with it, i.e. check that
          * auto-idle is enabled in the clock controller and if we are stopping
          * the clock, do the same with any parent clocks that had only one
-         * user keeping them on and auto-idle enabled.  */;
+         * user keeping them on and auto-idle enabled.  */
+    }
 }
 
 void soc_dma_set_request(struct soc_dma_ch_s *ch, int level)
@@ -247,7 +246,7 @@ struct soc_dma_s *soc_dma_init(int n)
     for (i = 0; i < n; i ++) {
         s->ch[i].dma = &s->soc;
         s->ch[i].num = i;
-        s->ch[i].timer = qemu_new_timer(vm_clock, soc_dma_ch_run, &s->ch[i]);
+        s->ch[i].timer = qemu_new_timer_ns(vm_clock, soc_dma_ch_run, &s->ch[i]);
     }
 
     soc_dma_reset(&s->soc);