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

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

revision 30 by dpavlin, Mon Oct 8 16:20:40 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_cons.c,v 1.37 2006/07/23 14:37:34 debug Exp $   *  $Id: dev_cons.c,v 1.40 2007/02/03 20:14:23 debug Exp $
29   *     *  
30   *  A simple console device, useful for simple tests.   *  A simple console device, useful for simple tests.
31   *   *
# Line 42  Line 42 
42  #include "console.h"  #include "console.h"
43  #include "cpu.h"  #include "cpu.h"
44  #include "device.h"  #include "device.h"
 #include "devices.h"  
45  #include "machine.h"  #include "machine.h"
46  #include "memory.h"  #include "memory.h"
47  #include "misc.h"  #include "misc.h"
48    
49  #include "testmachine/dev_cons.h"  #include "testmachine/dev_cons.h"
50    
   
51  #define CONS_TICK_SHIFT         14  #define CONS_TICK_SHIFT         14
52    
53    struct cons_data {
54            int                     console_handle;
55            int                     in_use;
56            struct interrupt        irq;
57    };
58    
59    
60  DEVICE_TICK(cons)  DEVICE_TICK(cons)
61  {  {
         struct cpu *c = cpu->machine->cpus[0];  
62          struct cons_data *d = extra;          struct cons_data *d = extra;
63    
64          cpu_interrupt_ack(c, d->irq_nr);          INTERRUPT_DEASSERT(d->irq);
65    
66          if (console_charavail(d->console_handle))          if (console_charavail(d->console_handle))
67                  cpu_interrupt(c, d->irq_nr);                  INTERRUPT_ASSERT(d->irq);
68  }  }
69    
70    
# Line 135  DEVINIT(cons) Line 138  DEVINIT(cons)
138          else          else
139                  snprintf(name3, nlen, "%s", devinit->name);                  snprintf(name3, nlen, "%s", devinit->name);
140    
141          d->irq_nr = devinit->irq_nr;          INTERRUPT_CONNECT(devinit->interrupt_path, d->irq);
142    
143          d->in_use = devinit->in_use;          d->in_use = devinit->in_use;
144          d->console_handle = console_start_slave(devinit->machine, name3,          d->console_handle = console_start_slave(devinit->machine, name3,
145              d->in_use);              d->in_use);

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

  ViewVC Help
Powered by ViewVC 1.1.26