/[gxemul]/trunk/src/devices/dev_z8530.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_z8530.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) 2004-2006  Anders Gavare.  All rights reserved.   *  Copyright (C) 2004-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_z8530.c,v 1.9 2006/10/07 02:05:21 debug Exp $   *  $Id: dev_z8530.c,v 1.13 2007/01/28 14:31:43 debug Exp $
29   *     *  
30   *  Zilog "zs" serial controller (Z8530).   *  Zilog "zs" serial controller (Z8530).
31   *   *
# Line 46  Line 46 
46  #include "console.h"  #include "console.h"
47  #include "cpu.h"  #include "cpu.h"
48  #include "device.h"  #include "device.h"
49    #include "interrupt.h"
50  #include "machine.h"  #include "machine.h"
51  #include "memory.h"  #include "memory.h"
52  #include "misc.h"  #include "misc.h"
# Line 61  Line 62 
62  #define DEV_Z8530_LENGTH        4  #define DEV_Z8530_LENGTH        4
63    
64  struct z8530_data {  struct z8530_data {
65          int             irq_nr;          struct interrupt irq;
         int             dma_irq_nr;  
66          int             irq_asserted;          int             irq_asserted;
67          int             addr_mult;          int             addr_mult;
68    
# Line 116  DEVICE_TICK(z8530) Line 116  DEVICE_TICK(z8530)
116                  asserted = 0;                  asserted = 0;
117    
118          if (asserted)          if (asserted)
119                  cpu_interrupt(cpu, d->irq_nr);                  INTERRUPT_ASSERT(d->irq);
120    
121          if (d->irq_asserted && !asserted)          if (d->irq_asserted && !asserted)
122                  cpu_interrupt_ack(cpu, d->irq_nr);                  INTERRUPT_DEASSERT(d->irq);
123    
124          d->irq_asserted = asserted;          d->irq_asserted = asserted;
125  }  }
# Line 211  DEVINIT(z8530) Line 211  DEVINIT(z8530)
211                  exit(1);                  exit(1);
212          }          }
213          memset(d, 0, sizeof(struct z8530_data));          memset(d, 0, sizeof(struct z8530_data));
214          d->irq_nr     = devinit->irq_nr;  
         d->dma_irq_nr = devinit->dma_irq_nr;  
215          d->addr_mult  = devinit->addr_mult;          d->addr_mult  = devinit->addr_mult;
216    
217            INTERRUPT_CONNECT(devinit->interrupt_path, d->irq);
218    
219          snprintf(tmp, sizeof(tmp), "%s [ch-b]", devinit->name);          snprintf(tmp, sizeof(tmp), "%s [ch-b]", devinit->name);
220          d->console_handle[0] = console_start_slave(devinit->machine, tmp,          d->console_handle[0] = console_start_slave(devinit->machine, tmp,
221              devinit->in_use);              devinit->in_use);

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

  ViewVC Help
Powered by ViewVC 1.1.26