/[gxemul]/trunk/src/devices/dev_sgi_ip32.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/src/devices/dev_sgi_ip32.c

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

revision 9 by dpavlin, Mon Oct 8 16:18:00 2007 UTC revision 10 by dpavlin, Mon Oct 8 16:18:27 2007 UTC
# Line 25  Line 25 
25   *  SUCH DAMAGE.   *  SUCH DAMAGE.
26   *     *  
27   *   *
28   *  $Id: dev_sgi_ip32.c,v 1.24 2005/03/18 23:20:52 debug Exp $   *  $Id: dev_sgi_ip32.c,v 1.27 2005/06/26 11:43:48 debug Exp $
29   *     *  
30   *  SGI IP32 devices.   *  SGI IP32 devices.
31   *   *
# Line 154  int dev_crime_access(struct cpu *cpu, st Line 154  int dev_crime_access(struct cpu *cpu, st
154          else          else
155                  memcpy(data, &d->reg[relative_addr], len);                  memcpy(data, &d->reg[relative_addr], len);
156    
157          if (relative_addr == 0x18 || relative_addr == 0x1c) {          if ((relative_addr >= 0x18 && relative_addr <= 0x1f) ||
158                (relative_addr+len-1 >= 0x18 && relative_addr+len-1 <= 0x1f)) {
159                  /*                  /*
160                   *  Force interrupt re-assertion:                   *  Force interrupt re-assertion:
161                   *                   *
162                   *  NOTE: Ugly hack. Hopefully CRMERR is never used.                   *  NOTE: Ugly hack. Hopefully CRMERR is never used.
163                   */                   */
164  #if 0  #if 0
165    /*
166  No. If this is enabled, the mec bugs out on either NetBSD or OpenBSD.  No. If this is enabled, the mec bugs out on either NetBSD or OpenBSD.
167  TODO.  TODO.
168    */
169                  cpu_interrupt_ack(cpu, 8); /* CRM_INT_CRMERR); */                  cpu_interrupt_ack(cpu, 8); /* CRM_INT_CRMERR); */
170  #endif  #endif
171          }          }
# Line 195  TODO. Line 196  TODO.
196                                      "control 0x%016llx ]\n", (long long)idata);                                      "control 0x%016llx ]\n", (long long)idata);
197                  }                  }
198                  break;                  break;
199  #if 1  #if 0
200          case CRIME_INTSTAT:     /*  0x010, Current interrupt status  */          case CRIME_INTSTAT:     /*  0x010, Current interrupt status  */
201          case 0x14:          case 0x14:
202          case CRIME_INTMASK:     /*  0x018,  Current interrupt mask  */          case CRIME_INTMASK:     /*  0x018,  Current interrupt mask  */
203          case 0x1c:          case 0x1c:
204          case 0x34:          case 0x34:
 #endif  
205                  /*  don't dump debug info for these  */                  /*  don't dump debug info for these  */
206                  break;                  break;
207    #endif
208          default:          default:
209                  if (writeflag==MEM_READ) {                  if (writeflag==MEM_READ) {
210                          debug("[ crime: read from 0x%x, len=%i:",                          debug("[ crime: read from 0x%x, len=%i:",
# Line 266  int dev_mace_access(struct cpu *cpu, str Line 267  int dev_mace_access(struct cpu *cpu, str
267          else          else
268                  memcpy(data, &d->reg[relative_addr], len);                  memcpy(data, &d->reg[relative_addr], len);
269    
270            if ((relative_addr >= 0x18 && relative_addr <= 0x1f) ||
271                (relative_addr+len-1 >= 0x18 && relative_addr+len-1 <= 0x1f))
272                    cpu_interrupt_ack(cpu, 8); /* CRM_INT_CRMERR); */
273    
274          switch (relative_addr) {          switch (relative_addr) {
275  #if 0  #if 0
276          case 0x14:      /*  Current interrupt assertions  */          case 0x10:      /*  Current interrupt assertions  */
277          case 0x18:      /*  ???  */          case 0x14:
278          case 0x1c:      /*  Interrupt mask  */                  /*  don't dump debug info for these  */
279                    if (writeflag == MEM_WRITE) {
280                            fatal("[ NOTE/TODO: WRITE to mace intr: "
281                                "reladdr=0x%x data=", (int)relative_addr);
282                            for (i=0; i<len; i++)
283                                    fatal(" %02x", data[i]);
284                            fatal(" (len=%i) ]\n", len);
285                    }
286                    break;
287            case 0x18:      /*  Interrupt mask  */
288            case 0x1c:
289                  /*  don't dump debug info for these  */                  /*  don't dump debug info for these  */
290                  break;                  break;
291  #endif  #endif
292          default:          default:
293                  if (writeflag==MEM_READ) {                  if (writeflag == MEM_READ) {
294                          debug("[ mace: read from 0x%x, len=%i ]\n",                          debug("[ mace: read from 0x%x:", (int)relative_addr);
295                              (int)relative_addr, len);                          for (i=0; i<len; i++)
296                                    debug(" %02x", data[i]);
297                            debug(" (len=%i) ]\n", len);
298                  } else {                  } else {
299                          debug("[ mace: write to 0x%x:", (int)relative_addr);                          debug("[ mace: write to 0x%x:", (int)relative_addr);
300                          for (i=0; i<len; i++)                          for (i=0; i<len; i++)
# Line 519  static int mec_try_rx(struct cpu *cpu, s Line 536  static int mec_try_rx(struct cpu *cpu, s
536          }          }
537          /*  printf("\n");  */          /*  printf("\n");  */
538    
539  #if 1  #if 0
540          printf("RX: %i bytes, index %i, base = 0x%x\n",          printf("RX: %i bytes, index %i, base = 0x%x\n",
541              d->cur_rx_packet_len, d->cur_rx_addr_index, (int)base);              d->cur_rx_packet_len, d->cur_rx_addr_index, (int)base);
542  #endif  #endif
# Line 912  void dev_sgi_mec_init(struct machine *ma Line 929  void dev_sgi_mec_init(struct machine *ma
929          uint64_t baseaddr, int irq_nr, unsigned char *macaddr)          uint64_t baseaddr, int irq_nr, unsigned char *macaddr)
930  {  {
931          char *name2;          char *name2;
932            size_t nlen = 55;
933          struct sgi_mec_data *d = malloc(sizeof(struct sgi_mec_data));          struct sgi_mec_data *d = malloc(sizeof(struct sgi_mec_data));
934    
935          if (d == NULL) {          if (d == NULL) {
# Line 924  void dev_sgi_mec_init(struct machine *ma Line 942  void dev_sgi_mec_init(struct machine *ma
942    
943          mec_reset(d);          mec_reset(d);
944    
945          name2 = malloc(50);          name2 = malloc(nlen);
946          if (name2 == NULL) {          if (name2 == NULL) {
947                  fprintf(stderr, "out of memory in dev_sgi_mec_init()\n");                  fprintf(stderr, "out of memory in dev_sgi_mec_init()\n");
948                  exit(1);                  exit(1);
949          }          }
950          sprintf(name2, "mec [%02x:%02x:%02x:%02x:%02x:%02x]",          snprintf(name2, nlen, "mec [%02x:%02x:%02x:%02x:%02x:%02x]",
951              d->macaddr[0], d->macaddr[1], d->macaddr[2],              d->macaddr[0], d->macaddr[1], d->macaddr[2],
952              d->macaddr[3], d->macaddr[4], d->macaddr[5]);              d->macaddr[3], d->macaddr[4], d->macaddr[5]);
953    

Legend:
Removed from v.9  
changed lines
  Added in v.10

  ViewVC Help
Powered by ViewVC 1.1.26