/[gxemul]/trunk/src/devices/dev_8253.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_8253.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_8253.c,v 1.16 2006/08/22 15:13:03 debug Exp $   *  $Id: dev_8253.c,v 1.18 2006/12/30 13:30:57 debug Exp $
29   *   *
30   *  Intel 8253/8254 Programmable Interval Timer   *  Intel 8253/8254 Programmable Interval Timer
31   *   *
# Line 44  Line 44 
44  #include "cpu.h"  #include "cpu.h"
45  #include "device.h"  #include "device.h"
46  #include "emul.h"  #include "emul.h"
47    #include "interrupt.h"
48  #include "machine.h"  #include "machine.h"
49  #include "memory.h"  #include "memory.h"
50  #include "misc.h"  #include "misc.h"
# Line 70  struct pit8253_data { Line 71  struct pit8253_data {
71          int             hz[3];          int             hz[3];
72    
73          struct timer    *timer0;          struct timer    *timer0;
74          int             irq0_nr;          struct interrupt irq;
75          int             pending_interrupts_timer0;          int             pending_interrupts_timer0;
76  };  };
77    
# Line 97  DEVICE_TICK(8253) Line 98  DEVICE_TICK(8253)
98    
99          case I8253_TIMER_INTTC:          case I8253_TIMER_INTTC:
100                  if (d->pending_interrupts_timer0 > 0)                  if (d->pending_interrupts_timer0 > 0)
101                          cpu_interrupt(cpu, d->irq0_nr);                          INTERRUPT_ASSERT(d->irq);
102                  break;                  break;
103    
104          case I8253_TIMER_SQWAVE:          case I8253_TIMER_SQWAVE:
# Line 247  DEVINIT(8253) Line 248  DEVINIT(8253)
248                  exit(1);                  exit(1);
249          }          }
250          memset(d, 0, sizeof(struct pit8253_data));          memset(d, 0, sizeof(struct pit8253_data));
251          d->irq0_nr = devinit->irq_nr;  
252          d->in_use = devinit->in_use;          d->in_use = devinit->in_use;
253    
254            INTERRUPT_CONNECT(devinit->interrupt_path, d->irq);
255    
256          /*  Don't cause interrupt, by default.  */          /*  Don't cause interrupt, by default.  */
257          d->mode[0] = I8253_TIMER_RATEGEN;          d->mode[0] = I8253_TIMER_RATEGEN;
258          d->mode[1] = I8253_TIMER_RATEGEN;          d->mode[1] = I8253_TIMER_RATEGEN;

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

  ViewVC Help
Powered by ViewVC 1.1.26