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

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

revision 41 by dpavlin, Mon Oct 8 16:21:17 2007 UTC revision 42 by dpavlin, Mon Oct 8 16:22:32 2007 UTC
# Line 25  Line 25 
25   *  SUCH DAMAGE.   *  SUCH DAMAGE.
26   *     *  
27   *   *
28   *  $Id: dev_ssc.c,v 1.29 2007/01/28 00:41:17 debug Exp $   *  $Id: dev_ssc.c,v 1.31 2007/06/15 19:57:34 debug Exp $
29   *     *
30     *  COMMENT: System Support Chip serial controller
31     *
32   *  Serial controller on DECsystem 5400 and 5800.   *  Serial controller on DECsystem 5400 and 5800.
33   *  Known as System Support Chip on VAX 3600 (KA650).   *  Known as System Support Chip on VAX 3600 (KA650).
34   *   *
# Line 50  Line 52 
52  #define TX_INT_ENABLE   0x40  #define TX_INT_ENABLE   0x40
53  #define TX_READY        0x80  #define TX_READY        0x80
54    
55    #define SSC_TICK_SHIFT  14
56    
57  /*  /*
58   *  _TXRX is for debugging putchar/getchar. The other   *  _TXRX is for debugging putchar/getchar. The other
# Line 69  struct ssc_data { Line 72  struct ssc_data {
72  };  };
73    
74    
75  /*  DEVICE_TICK(ssc)
  *  dev_ssc_tick():  
  */  
 void dev_ssc_tick(struct cpu *cpu, void *extra)  
76  {  {
77          struct ssc_data *d = extra;          struct ssc_data *d = extra;
78    
# Line 224  DEVICE_ACCESS(ssc) Line 224  DEVICE_ACCESS(ssc)
224  }  }
225    
226    
 /*  
  *  dev_ssc_init():  
  */  
227  void dev_ssc_init(struct machine *machine, struct memory *mem,  void dev_ssc_init(struct machine *machine, struct memory *mem,
228          uint64_t baseaddr, char *irq_path, int use_fb)          uint64_t baseaddr, char *irq_path, int use_fb)
229  {  {
230          struct ssc_data *d;          struct ssc_data *d;
231    
232          d = malloc(sizeof(struct ssc_data));          CHECK_ALLOCATION(d = malloc(sizeof(struct ssc_data)));
         if (d == NULL) {  
                 fprintf(stderr, "out of memory\n");  
                 exit(1);  
         }  
233          memset(d, 0, sizeof(struct ssc_data));          memset(d, 0, sizeof(struct ssc_data));
234    
235          d->use_fb = use_fb;          d->use_fb = use_fb;
236          d->console_handle = console_start_slave(machine, "SSC", 1);          d->console_handle = console_start_slave(machine, "SSC", 1);
237    
# Line 246  void dev_ssc_init(struct machine *machin Line 240  void dev_ssc_init(struct machine *machin
240          memory_device_register(mem, "ssc", baseaddr, DEV_SSC_LENGTH,          memory_device_register(mem, "ssc", baseaddr, DEV_SSC_LENGTH,
241              dev_ssc_access, d, DM_DEFAULT, NULL);              dev_ssc_access, d, DM_DEFAULT, NULL);
242    
243          machine_add_tickfunction(machine, dev_ssc_tick, d, 14, 0.0);          machine_add_tickfunction(machine, dev_ssc_tick, d, SSC_TICK_SHIFT);
244  }  }
245    

Legend:
Removed from v.41  
changed lines
  Added in v.42

  ViewVC Help
Powered by ViewVC 1.1.26