Commit ea0f49a74dc18b063c7fd5076dcfa3a402c48e92
1 parent
55e8b85e
ETRAX-FS: Fix DMA warnings.
Signed-off-by: Jan Kiszka <jan.kiszka@web.de> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5621 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
11 additions
and
8 deletions
hw/etraxfs_dma.c
@@ -406,7 +406,8 @@ static void channel_out_run(struct fs_dma_ctrl *ctrl, int c) | @@ -406,7 +406,8 @@ static void channel_out_run(struct fs_dma_ctrl *ctrl, int c) | ||
406 | (uint32_t)ctrl->channels[c].current_d.after, | 406 | (uint32_t)ctrl->channels[c].current_d.after, |
407 | saved_data_buf)); | 407 | saved_data_buf)); |
408 | 408 | ||
409 | - len = (uint32_t)ctrl->channels[c].current_d.after; | 409 | + len = (uint32_t)(unsigned long) |
410 | + ctrl->channels[c].current_d.after; | ||
410 | len -= saved_data_buf; | 411 | len -= saved_data_buf; |
411 | 412 | ||
412 | if (len > sizeof buf) | 413 | if (len > sizeof buf) |
@@ -426,8 +427,8 @@ static void channel_out_run(struct fs_dma_ctrl *ctrl, int c) | @@ -426,8 +427,8 @@ static void channel_out_run(struct fs_dma_ctrl *ctrl, int c) | ||
426 | 427 | ||
427 | saved_data_buf += len; | 428 | saved_data_buf += len; |
428 | 429 | ||
429 | - if (saved_data_buf == | ||
430 | - (uint32_t)ctrl->channels[c].current_d.after) { | 430 | + if (saved_data_buf == (uint32_t)(unsigned long) |
431 | + ctrl->channels[c].current_d.after) { | ||
431 | /* Done. Step to next. */ | 432 | /* Done. Step to next. */ |
432 | if (ctrl->channels[c].current_d.out_eop) { | 433 | if (ctrl->channels[c].current_d.out_eop) { |
433 | /* TODO: signal eop to the client. */ | 434 | /* TODO: signal eop to the client. */ |
@@ -451,7 +452,8 @@ static void channel_out_run(struct fs_dma_ctrl *ctrl, int c) | @@ -451,7 +452,8 @@ static void channel_out_run(struct fs_dma_ctrl *ctrl, int c) | ||
451 | channel_stop(ctrl, c); | 452 | channel_stop(ctrl, c); |
452 | } else { | 453 | } else { |
453 | ctrl->channels[c].regs[RW_SAVED_DATA] = | 454 | ctrl->channels[c].regs[RW_SAVED_DATA] = |
454 | - (uint32_t)ctrl->channels[c].current_d.next; | 455 | + (uint32_t)(unsigned long)ctrl-> |
456 | + channels[c].current_d.next; | ||
455 | /* Load new descriptor. */ | 457 | /* Load new descriptor. */ |
456 | channel_load_d(ctrl, c); | 458 | channel_load_d(ctrl, c); |
457 | saved_data_buf = (uint32_t)(unsigned long) | 459 | saved_data_buf = (uint32_t)(unsigned long) |
@@ -477,7 +479,7 @@ static int channel_in_process(struct fs_dma_ctrl *ctrl, int c, | @@ -477,7 +479,7 @@ static int channel_in_process(struct fs_dma_ctrl *ctrl, int c, | ||
477 | return 0; | 479 | return 0; |
478 | 480 | ||
479 | saved_data_buf = channel_reg(ctrl, c, RW_SAVED_DATA_BUF); | 481 | saved_data_buf = channel_reg(ctrl, c, RW_SAVED_DATA_BUF); |
480 | - len = (uint32_t)ctrl->channels[c].current_d.after; | 482 | + len = (uint32_t)(unsigned long)ctrl->channels[c].current_d.after; |
481 | len -= saved_data_buf; | 483 | len -= saved_data_buf; |
482 | 484 | ||
483 | if (len > buflen) | 485 | if (len > buflen) |
@@ -487,7 +489,7 @@ static int channel_in_process(struct fs_dma_ctrl *ctrl, int c, | @@ -487,7 +489,7 @@ static int channel_in_process(struct fs_dma_ctrl *ctrl, int c, | ||
487 | saved_data_buf += len; | 489 | saved_data_buf += len; |
488 | 490 | ||
489 | if (saved_data_buf == | 491 | if (saved_data_buf == |
490 | - (uint32_t)ctrl->channels[c].current_d.after | 492 | + (uint32_t)(unsigned long)ctrl->channels[c].current_d.after |
491 | || eop) { | 493 | || eop) { |
492 | uint32_t r_intr = ctrl->channels[c].regs[R_INTR]; | 494 | uint32_t r_intr = ctrl->channels[c].regs[R_INTR]; |
493 | 495 | ||
@@ -524,10 +526,11 @@ static int channel_in_process(struct fs_dma_ctrl *ctrl, int c, | @@ -524,10 +526,11 @@ static int channel_in_process(struct fs_dma_ctrl *ctrl, int c, | ||
524 | channel_stop(ctrl, c); | 526 | channel_stop(ctrl, c); |
525 | } else { | 527 | } else { |
526 | ctrl->channels[c].regs[RW_SAVED_DATA] = | 528 | ctrl->channels[c].regs[RW_SAVED_DATA] = |
527 | - (uint32_t)ctrl->channels[c].current_d.next; | 529 | + (uint32_t)(unsigned long)ctrl-> |
530 | + channels[c].current_d.next; | ||
528 | /* Load new descriptor. */ | 531 | /* Load new descriptor. */ |
529 | channel_load_d(ctrl, c); | 532 | channel_load_d(ctrl, c); |
530 | - saved_data_buf = (uint32_t) | 533 | + saved_data_buf = (uint32_t)(unsigned long) |
531 | ctrl->channels[c].current_d.buf; | 534 | ctrl->channels[c].current_d.buf; |
532 | } | 535 | } |
533 | } | 536 | } |