/[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 24 by dpavlin, Mon Oct 8 16:19:56 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.33 2006/03/04 12:38:48 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 292  int dev_scc_dma_func(struct cpu *cpu, vo Line 301  int dev_scc_dma_func(struct cpu *cpu, vo
301  /*  /*
302   *  dev_scc_access():   *  dev_scc_access():
303   */   */
304  int dev_scc_access(struct cpu *cpu, struct memory *mem,  DEVICE_ACCESS(scc)
         uint64_t relative_addr, unsigned char *data, size_t len,  
         int writeflag, void *extra)  
305  {  {
306          struct scc_data *d = (struct scc_data *) extra;          struct scc_data *d = (struct scc_data *) extra;
307          uint64_t idata = 0, odata = 0;          uint64_t idata = 0, odata = 0;
308          int port;          int port;
309          int ultrix_mode = 0;          int ultrix_mode = 0;
310    
311          idata = memory_readmax64(cpu, data, len);          if (writeflag == MEM_WRITE)
312                    idata = memory_readmax64(cpu, data, len);
313    
314          /*  relative_addr /= d->addrmul;  */          /*  relative_addr /= d->addrmul;  */
315                  /*  See SGI comment below instead.  */                  /*  See SGI comment below instead.  */
# Line 468  void *dev_scc_init(struct machine *machi Line 476  void *dev_scc_init(struct machine *machi
476          d->scc_nr  = scc_nr;          d->scc_nr  = scc_nr;
477          d->use_fb  = use_fb;          d->use_fb  = use_fb;
478          d->addrmul = addrmul;          d->addrmul = addrmul;
479          d->console_handle = console_start_slave(machine, "SCC");          d->console_handle = console_start_slave(machine, "SCC", 1);
480    
481          lk201_init(&d->lk201, use_fb, dev_scc_add_to_rx_queue,          lk201_init(&d->lk201, use_fb, dev_scc_add_to_rx_queue,
482              d->console_handle, d);              d->console_handle, d);
483    
484          memory_device_register(mem, "scc", baseaddr, DEV_SCC_LENGTH,          memory_device_register(mem, "scc", baseaddr, DEV_SCC_LENGTH,
485              dev_scc_access, d, MEM_DEFAULT, NULL);              dev_scc_access, d, DM_DEFAULT, NULL);
486          machine_add_tickfunction(machine, dev_scc_tick, d, SCC_TICK_SHIFT);          machine_add_tickfunction(machine, dev_scc_tick, d, SCC_TICK_SHIFT, 0.0);
487    
488          return (void *) d;          return (void *) d;
489  }  }

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

  ViewVC Help
Powered by ViewVC 1.1.26