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

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

revision 20 by dpavlin, Mon Oct 8 16:19:23 2007 UTC revision 22 by dpavlin, Mon Oct 8 16:19:37 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_asc.c,v 1.76 2005/11/13 00:14:08 debug Exp $   *  $Id: dev_asc.c,v 1.79 2006/01/01 13:17:16 debug Exp $
29   *   *
30   *  'asc' SCSI controller for some DECstation/DECsystem models, and   *  'asc' SCSI controller for some DECstation/DECsystem models and PICA-61.
  *  for PICA-61.  
31   *   *
32   *  Supposed to support SCSI-1 and SCSI-2. I've not yet found any docs   *  Supposed to support SCSI-1 and SCSI-2. I've not yet found any docs
33   *  on NCR53C9X, so I'll try to implement this device from LSI53CF92A docs   *  on NCR53C9X, so I'll try to implement this device from LSI53CF92A docs
# Line 50  Line 49 
49   *  TODO:  This module needs a clean-up, and some testing to see that   *  TODO:  This module needs a clean-up, and some testing to see that
50   *         it works will all OSes that might use it (NetBSD, OpenBSD,   *         it works will all OSes that might use it (NetBSD, OpenBSD,
51   *         Ultrix, Linux, Mach, OSF/1, Sprite, ...)   *         Ultrix, Linux, Mach, OSF/1, Sprite, ...)
52     *
53     *         Running Linux/DECstation 2.4.26 with no scsi disks attached causes
54     *         a warning message to be printed by Linux. (Whether this is a bug,
55     *         is is the way it works on real hardware, I don't know.)
56   */   */
57    
58  #include <stdio.h>  #include <stdio.h>
# Line 309  fatal("TODO..............\n"); Line 312  fatal("TODO..............\n");
312                                  fatal("no incoming DMA data?\n");                                  fatal("no incoming DMA data?\n");
313                                  res = 0;                                  res = 0;
314                          } else {                          } else {
315                                  int len = d->xferp->data_in_len;                                  size_t len = d->xferp->data_in_len;
316                                  int len2 = d->reg_wo[NCR_TCL] +                                  size_t len2 = d->reg_wo[NCR_TCL] +
317                                      d->reg_wo[NCR_TCM] * 256;                                      d->reg_wo[NCR_TCM] * 256;
318                                  if (len2 == 0)                                  if (len2 == 0)
319                                          len2 = 65536;                                          len2 = 65536;
# Line 751  static int dev_asc_select(struct cpu *cp Line 754  static int dev_asc_select(struct cpu *cp
754  /*  /*
755   *  dev_asc_address_reg_access():   *  dev_asc_address_reg_access():
756   */   */
757  int dev_asc_address_reg_access(struct cpu *cpu, struct memory *mem,  DEVICE_ACCESS(asc_address_reg)
         uint64_t relative_addr, unsigned char *data, size_t len,  
         int writeflag, void *extra)  
758  {  {
759          struct asc_data *d = extra;          struct asc_data *d = extra;
760    
# Line 773  int dev_asc_address_reg_access(struct cp Line 774  int dev_asc_address_reg_access(struct cp
774  /*  /*
775   *  dev_asc_dma_access():   *  dev_asc_dma_access():
776   */   */
777  int dev_asc_dma_access(struct cpu *cpu, struct memory *mem,  DEVICE_ACCESS(asc_dma)
         uint64_t relative_addr, unsigned char *data, size_t len,  
         int writeflag, void *extra)  
778  {  {
779          struct asc_data *d = extra;          struct asc_data *d = extra;
780    
# Line 816  int dev_asc_dma_access(struct cpu *cpu, Line 815  int dev_asc_dma_access(struct cpu *cpu,
815  /*  /*
816   *  dev_asc_access():   *  dev_asc_access():
817   */   */
818  int dev_asc_access(struct cpu *cpu, struct memory *mem,  DEVICE_ACCESS(asc)
         uint64_t relative_addr, unsigned char *data, size_t len,  
         int writeflag, void *extra)  
819  {  {
820          int regnr;          int regnr;
821          struct asc_data *d = extra;          struct asc_data *d = extra;
# Line 1277  void dev_asc_init(struct machine *machin Line 1274  void dev_asc_init(struct machine *machin
1274          d->dma_controller_data = dma_controller_data;          d->dma_controller_data = dma_controller_data;
1275    
1276          memory_device_register(mem, "asc", baseaddr,          memory_device_register(mem, "asc", baseaddr,
1277              mode == DEV_ASC_PICA?              mode == DEV_ASC_PICA? DEV_ASC_PICA_LENGTH : DEV_ASC_DEC_LENGTH,
                 DEV_ASC_PICA_LENGTH : DEV_ASC_DEC_LENGTH,  
1278              dev_asc_access, d, DM_DEFAULT, NULL);              dev_asc_access, d, DM_DEFAULT, NULL);
1279    
1280          if (mode == DEV_ASC_DEC) {          if (mode == DEV_ASC_DEC) {

Legend:
Removed from v.20  
changed lines
  Added in v.22

  ViewVC Help
Powered by ViewVC 1.1.26