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

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

revision 28 by dpavlin, Mon Oct 8 16:20:26 2007 UTC revision 34 by dpavlin, Mon Oct 8 16:21:17 2007 UTC
# Line 1  Line 1 
1  /*  /*
2   *  Copyright (C) 2003-2006  Anders Gavare.  All rights reserved.   *  Copyright (C) 2003-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_le.c,v 1.51 2006/07/14 16:33:28 debug Exp $   *  $Id: dev_le.c,v 1.54 2006/12/31 21:35:26 debug Exp $
29   *     *  
30   *  LANCE ethernet, as used in DECstations.   *  LANCE ethernet, as used in DECstations.
31   *   *
# Line 85  extern int quiet_mode; Line 85  extern int quiet_mode;
85    
86    
87  struct le_data {  struct le_data {
88          int             irq_nr;          struct interrupt irq;
89            int             irq_asserted;
90    
91          uint64_t        buf_start;          uint64_t        buf_start;
92          uint64_t        buf_end;          uint64_t        buf_end;
# Line 537  static void le_register_fix(struct net * Line 538  static void le_register_fix(struct net *
538  void dev_le_tick(struct cpu *cpu, void *extra)  void dev_le_tick(struct cpu *cpu, void *extra)
539  {  {
540          struct le_data *d = (struct le_data *) extra;          struct le_data *d = (struct le_data *) extra;
541            int new_assert;
542    
543          le_register_fix(cpu->machine->emul->net, d);          le_register_fix(cpu->machine->emul->net, d);
544    
545          if (d->reg[0] & LE_INTR && d->reg[0] & LE_INEA)          new_assert = (d->reg[0] & LE_INTR) && (d->reg[0] & LE_INEA);
546                  cpu_interrupt(cpu, d->irq_nr);          if (new_assert && !d->irq_asserted)
547          else                  INTERRUPT_ASSERT(d->irq);
548                  cpu_interrupt_ack(cpu, d->irq_nr);          if (d->irq_asserted && !new_assert)
549                    INTERRUPT_DEASSERT(d->irq);
550    
551            d->irq_asserted = new_assert;
552  }  }
553    
554    
# Line 765  do_return: Line 770  do_return:
770   *  dev_le_init():   *  dev_le_init():
771   */   */
772  void dev_le_init(struct machine *machine, struct memory *mem, uint64_t baseaddr,  void dev_le_init(struct machine *machine, struct memory *mem, uint64_t baseaddr,
773          uint64_t buf_start, uint64_t buf_end, int irq_nr, int len)          uint64_t buf_start, uint64_t buf_end, char *irq_path, int len)
774  {  {
775          char *name2;          char *name2;
776          size_t nlen = 55;          size_t nlen = 55;
# Line 777  void dev_le_init(struct machine *machine Line 782  void dev_le_init(struct machine *machine
782          }          }
783    
784          memset(d, 0, sizeof(struct le_data));          memset(d, 0, sizeof(struct le_data));
785          d->irq_nr    = irq_nr;  
786            INTERRUPT_CONNECT(irq_path, d->irq);
787    
788          d->sram = malloc(SRAM_SIZE);          d->sram = malloc(SRAM_SIZE);
789          if (d->sram == NULL) {          if (d->sram == NULL) {

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

  ViewVC Help
Powered by ViewVC 1.1.26