/[qemu]/qemu/hw/cuda.c
ViewVC logotype

Diff of /qemu/hw/cuda.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.6 by bellard, Wed Feb 9 00:07:08 2005 UTC revision 1.7 by bellard, Sat Apr 23 18:16:54 2005 UTC
# Line 178  static int64_t get_next_irq_time(CUDATim Line 178  static int64_t get_next_irq_time(CUDATim
178      /* current counter value */      /* current counter value */
179      d = muldiv64(current_time - s->load_time,      d = muldiv64(current_time - s->load_time,
180                   CUDA_TIMER_FREQ, ticks_per_sec);                   CUDA_TIMER_FREQ, ticks_per_sec);
181      if (d <= s->counter_value) {      if (d < s->counter_value) {
182          next_time = s->counter_value + 1;          next_time = s->counter_value + 1;
183      } else {      } else
184          base = ((d - s->counter_value) / s->latch);      {
185            base = ((d - s->counter_value + 1) / s->latch);
186          base = (base * s->latch) + s->counter_value;          base = (base * s->latch) + s->counter_value;
187          next_time = base + s->latch;          next_time = base + s->latch;
188      }      }
189    #if 0
190  #ifdef DEBUG_CUDA  #ifdef DEBUG_CUDA
191      printf("latch=%d counter=%lld delta_next=%lld\n",      printf("latch=%d counter=%lld delta_next=%lld\n",
192             s->latch, d, next_time - d);             s->latch, d, next_time - d);
193  #endif  #endif
194    #endif
195      next_time = muldiv64(next_time, ticks_per_sec, CUDA_TIMER_FREQ) +      next_time = muldiv64(next_time, ticks_per_sec, CUDA_TIMER_FREQ) +
196          s->load_time;          s->load_time;
197      if (next_time <= current_time)      if (next_time <= current_time)
# Line 505  static void cuda_receive_packet(CUDAStat Line 508  static void cuda_receive_packet(CUDAStat
508          cuda_send_packet_to_host(s, obuf, 2);          cuda_send_packet_to_host(s, obuf, 2);
509          break;          break;
510      case CUDA_GET_TIME:      case CUDA_GET_TIME:
511        case CUDA_SET_TIME:
512          /* XXX: add time support ? */          /* XXX: add time support ? */
513          ti = time(NULL) + RTC_OFFSET;          ti = time(NULL) + RTC_OFFSET;
514          obuf[0] = CUDA_PACKET;          obuf[0] = CUDA_PACKET;
# Line 516  static void cuda_receive_packet(CUDAStat Line 520  static void cuda_receive_packet(CUDAStat
520          obuf[6] = ti;          obuf[6] = ti;
521          cuda_send_packet_to_host(s, obuf, 7);          cuda_send_packet_to_host(s, obuf, 7);
522          break;          break;
     case CUDA_SET_TIME:  
523      case CUDA_FILE_SERVER_FLAG:      case CUDA_FILE_SERVER_FLAG:
524      case CUDA_SET_DEVICE_LIST:      case CUDA_SET_DEVICE_LIST:
525      case CUDA_SET_AUTO_RATE:      case CUDA_SET_AUTO_RATE:

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26