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

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

revision 4 by dpavlin, Mon Oct 8 16:18:00 2007 UTC revision 30 by dpavlin, Mon Oct 8 16:20:40 2007 UTC
# Line 1  Line 1 
1  /*  /*
2   *  Copyright (C) 2003-2005  Anders Gavare.  All rights reserved.   *  Copyright (C) 2003-2006  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_scc.c,v 1.27 2005/02/25 06:14:30 debug Exp $   *  $Id: dev_scc.c,v 1.34 2006/07/23 14:37:34 debug Exp $
29   *     *  
30   *  Serial controller on some DECsystems and SGI machines. (Z8530 ?)   *  Serial controller on some DECsystems and SGI machines. (Z8530 ?)
31   *  Most of the code in here is written for DECsystem emulation, though.   *  Most of the code in here is written for DECsystem emulation, though.
# Line 40  Line 40 
40   *              emulate the same lk201 behaviour as when using the dc device)   *              emulate the same lk201 behaviour as when using the dc device)
41   *      DMA   *      DMA
42   *      More correct interrupt support.   *      More correct interrupt support.
43     *
44     ******************************************************************************
45     *       _____ ___  ____   ___  _
46     *      |_   _/ _ \|  _ \ / _ \| |
47     *        | || | | | | | | | | | |
48     *        | || |_| | |_| | |_| |_|
49     *        |_| \___/|____/ \___/(_)
50     *
51     *      Since this is actually a Z8530, it should be merged with dev_z8530.c!
52   */   */
53    
54  #include <stdio.h>  #include <stdio.h>
# Line 138  static unsigned char rx_nextchar(struct Line 147  static unsigned char rx_nextchar(struct
147  }  }
148    
149    
150  /*  DEVICE_TICK(scc)
  *  dev_scc_tick():  
  */  
 void dev_scc_tick(struct cpu *cpu, void *extra)  
151  {  {
152          int i;          int i;
153          struct scc_data *d = (struct scc_data *) extra;          struct scc_data *d = (struct scc_data *) extra;
# Line 289  int dev_scc_dma_func(struct cpu *cpu, vo Line 295  int dev_scc_dma_func(struct cpu *cpu, vo
295  }  }
296    
297    
298  /*  DEVICE_ACCESS(scc)
  *  dev_scc_access():  
  */  
 int dev_scc_access(struct cpu *cpu, struct memory *mem,  
         uint64_t relative_addr, unsigned char *data, size_t len,  
         int writeflag, void *extra)  
299  {  {
300          struct scc_data *d = (struct scc_data *) extra;          struct scc_data *d = (struct scc_data *) extra;
301          uint64_t idata = 0, odata = 0;          uint64_t idata = 0, odata = 0;
302          int port;          int port;
303          int ultrix_mode = 0;          int ultrix_mode = 0;
304    
305          idata = memory_readmax64(cpu, data, len);          if (writeflag == MEM_WRITE)
306                    idata = memory_readmax64(cpu, data, len);
307    
308          /*  relative_addr /= d->addrmul;  */          /*  relative_addr /= d->addrmul;  */
309                  /*  See SGI comment below instead.  */                  /*  See SGI comment below instead.  */
# Line 468  void *dev_scc_init(struct machine *machi Line 470  void *dev_scc_init(struct machine *machi
470          d->scc_nr  = scc_nr;          d->scc_nr  = scc_nr;
471          d->use_fb  = use_fb;          d->use_fb  = use_fb;
472          d->addrmul = addrmul;          d->addrmul = addrmul;
473          d->console_handle = console_start_slave(machine, "SCC");          d->console_handle = console_start_slave(machine, "SCC", 1);
474    
475          lk201_init(&d->lk201, use_fb, dev_scc_add_to_rx_queue,          lk201_init(&d->lk201, use_fb, dev_scc_add_to_rx_queue,
476              d->console_handle, d);              d->console_handle, d);
477    
478          memory_device_register(mem, "scc", baseaddr, DEV_SCC_LENGTH,          memory_device_register(mem, "scc", baseaddr, DEV_SCC_LENGTH,
479              dev_scc_access, d, MEM_DEFAULT, NULL);              dev_scc_access, d, DM_DEFAULT, NULL);
480          machine_add_tickfunction(machine, dev_scc_tick, d, SCC_TICK_SHIFT);          machine_add_tickfunction(machine, dev_scc_tick, d, SCC_TICK_SHIFT, 0.0);
481    
482          return (void *) d;          return (void *) d;
483  }  }

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

  ViewVC Help
Powered by ViewVC 1.1.26