/[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.7 by bellard, Sat Apr 23 18:16:54 2005 UTC revision 1.8 by bellard, Sun Jun 5 15:24:23 2005 UTC
# Line 120  typedef struct CUDAState { Line 120  typedef struct CUDAState {
120      int data_in_index;      int data_in_index;
121      int data_out_index;      int data_out_index;
122    
123        SetIRQFunc *set_irq;
124      int irq;      int irq;
125      openpic_t *openpic;      void *irq_opaque;
126      uint8_t autopoll;      uint8_t autopoll;
127      uint8_t data_in[128];      uint8_t data_in[128];
128      uint8_t data_out[16];      uint8_t data_out[16];
# Line 140  static void cuda_timer_update(CUDAState Line 141  static void cuda_timer_update(CUDAState
141  static void cuda_update_irq(CUDAState *s)  static void cuda_update_irq(CUDAState *s)
142  {  {
143      if (s->ifr & s->ier & (SR_INT | T1_INT)) {      if (s->ifr & s->ier & (SR_INT | T1_INT)) {
144          openpic_set_irq(s->openpic, s->irq, 1);          s->set_irq(s->irq_opaque, s->irq, 1);
145      } else {      } else {
146          openpic_set_irq(s->openpic, s->irq, 0);          s->set_irq(s->irq_opaque, s->irq, 0);
147      }      }
148  }  }
149    
# Line 356  static void cuda_writeb(void *opaque, ta Line 357  static void cuda_writeb(void *opaque, ta
357          cuda_update_irq(s);          cuda_update_irq(s);
358          break;          break;
359      case 14:      case 14:
360    #if 0
361          if (val & IER_SET) {          if (val & IER_SET) {
362              /* set bits */              /* set bits */
363              s->ier |= val & 0x7f;              s->ier |= val & 0x7f;
# Line 363  static void cuda_writeb(void *opaque, ta Line 365  static void cuda_writeb(void *opaque, ta
365              /* reset bits */              /* reset bits */
366              s->ier &= ~val;              s->ier &= ~val;
367          }          }
368    #else
369            /* XXX: please explain me why the SPEC is not correct ! */
370            s->ier = val;
371    #endif
372          cuda_update_irq(s);          cuda_update_irq(s);
373          break;          break;
374      default:      default:
# Line 545  static void cuda_receive_packet_from_hos Line 551  static void cuda_receive_packet_from_hos
551  #ifdef DEBUG_CUDA_PACKET  #ifdef DEBUG_CUDA_PACKET
552      {      {
553          int i;          int i;
554          printf("cuda_receive_packet_to_host:\n");          printf("cuda_receive_packet_from_host:\n");
555          for(i = 0; i < len; i++)          for(i = 0; i < len; i++)
556              printf(" %02x", data[i]);              printf(" %02x", data[i]);
557          printf("\n");          printf("\n");
# Line 605  static CPUReadMemoryFunc *cuda_read[] = Line 611  static CPUReadMemoryFunc *cuda_read[] =
611      &cuda_readl,      &cuda_readl,
612  };  };
613    
614  int cuda_init(openpic_t *openpic, int irq)  int cuda_init(SetIRQFunc *set_irq, void *irq_opaque, int irq)
615  {  {
616      CUDAState *s = &cuda_state;      CUDAState *s = &cuda_state;
617      int cuda_mem_index;      int cuda_mem_index;
618    
619      s->openpic = openpic;      s->set_irq = set_irq;
620        s->irq_opaque = irq_opaque;
621      s->irq = irq;      s->irq = irq;
622    
623      s->timers[0].timer = qemu_new_timer(vm_clock, cuda_timer1, s);      s->timers[0].timer = qemu_new_timer(vm_clock, cuda_timer1, s);
624      s->timers[0].latch = 0x10000;      s->timers[0].latch = 0x10000;
625      set_counter(s, &s->timers[0], 0xffff);      set_counter(s, &s->timers[0], 0xffff);
626      s->timers[1].latch = 0x10000;      s->timers[1].latch = 0x10000;
627      s->ier = T1_INT | SR_INT;      //    s->ier = T1_INT | SR_INT;
628        s->ier = 0;
629      set_counter(s, &s->timers[1], 0xffff);      set_counter(s, &s->timers[1], 0xffff);
630    
631      s->adb_poll_timer = qemu_new_timer(vm_clock, cuda_adb_poll, s);      s->adb_poll_timer = qemu_new_timer(vm_clock, cuda_adb_poll, s);

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

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