/[gxemul]/trunk/src/devices/dev_dec21143.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_dec21143.c

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

revision 32 by dpavlin, Mon Oct 8 16:20:58 2007 UTC revision 34 by dpavlin, Mon Oct 8 16:21:17 2007 UTC
# Line 1  Line 1 
1  /*  /*
2   *  Copyright (C) 2005-2006  Anders Gavare.  All rights reserved.   *  Copyright (C) 2005-2007  Anders Gavare.  All rights reserved.
3   *   *
4   *  Redistribution and use in source and binary forms, with or without   *  Redistribution and use in source and binary forms, with or without
5   *  modification, are permitted provided that the following conditions are met:   *  modification, are permitted provided that the following conditions are met:
# Line 25  Line 25 
25   *  SUCH DAMAGE.   *  SUCH DAMAGE.
26   *     *  
27   *   *
28   *  $Id: dev_dec21143.c,v 1.26 2006/08/21 14:44:22 debug Exp $   *  $Id: dev_dec21143.c,v 1.28 2007/01/05 15:20:06 debug Exp $
29   *   *
30   *  DEC 21143 ("Tulip") ethernet controller. Implemented from Intel document   *  DEC 21143 ("Tulip") ethernet controller. Implemented from Intel document
31   *  278074-001 ("21143 PC/CardBus 10/100Mb/s Ethernet LAN Controller") and by   *  278074-001 ("21143 PC/CardBus 10/100Mb/s Ethernet LAN Controller") and by
# Line 58  Line 58 
58  #include "device.h"  #include "device.h"
59  #include "devices.h"  #include "devices.h"
60  #include "emul.h"  #include "emul.h"
61    #include "interrupt.h"
62  #include "machine.h"  #include "machine.h"
63  #include "memory.h"  #include "memory.h"
64  #include "misc.h"  #include "misc.h"
# Line 75  Line 76 
76  #define ROM_WIDTH               6  #define ROM_WIDTH               6
77    
78  struct dec21143_data {  struct dec21143_data {
79          int             irq_nr;          struct interrupt irq;
80          int             irq_asserted;          int             irq_was_asserted;
81    
82          /*  PCI:  */          /*  PCI:  */
83          int             pci_little_endian;          int             pci_little_endian;
# Line 479  void dev_dec21143_tick(struct cpu *cpu, Line 480  void dev_dec21143_tick(struct cpu *cpu,
480                  d->reg[CSR_STATUS / 8] |= STATUS_AIS;                  d->reg[CSR_STATUS / 8] |= STATUS_AIS;
481    
482          asserted = d->reg[CSR_STATUS / 8] & d->reg[CSR_INTEN / 8] & 0x0c01ffff;          asserted = d->reg[CSR_STATUS / 8] & d->reg[CSR_INTEN / 8] & 0x0c01ffff;
483          if (asserted) {  
484                  cpu_interrupt(cpu, d->irq_nr);          if (asserted)
485          } else {                  INTERRUPT_ASSERT(d->irq);
486                  if (d->irq_asserted)          if (!asserted && d->irq_was_asserted)
487                          cpu_interrupt_ack(cpu, d->irq_nr);                  INTERRUPT_DEASSERT(d->irq);
         }  
488    
489          /*  Remember assertion flag:  */          /*  Remember assertion flag:  */
490          d->irq_asserted = asserted;          d->irq_was_asserted = asserted;
491  }  }
492    
493    
# Line 821  static void dec21143_reset(struct cpu *c Line 821  static void dec21143_reset(struct cpu *c
821  }  }
822    
823    
 /*  
  *  dev_dec21143_access():  
  */  
824  DEVICE_ACCESS(dec21143)  DEVICE_ACCESS(dec21143)
825  {  {
826          struct dec21143_data *d = extra;          struct dec21143_data *d = extra;
# Line 997  DEVINIT(dec21143) Line 994  DEVINIT(dec21143)
994          }          }
995          memset(d, 0, sizeof(struct dec21143_data));          memset(d, 0, sizeof(struct dec21143_data));
996    
997          d->irq_nr = devinit->irq_nr;          INTERRUPT_CONNECT(devinit->interrupt_path, d->irq);
998          d->pci_little_endian = devinit->pci_little_endian;          d->pci_little_endian = devinit->pci_little_endian;
999    
1000          net_generate_unique_mac(devinit->machine, d->mac);          net_generate_unique_mac(devinit->machine, d->mac);

Legend:
Removed from v.32  
changed lines
  Added in v.34

  ViewVC Help
Powered by ViewVC 1.1.26