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

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

revision 21 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) 2005  Anders Gavare.  All rights reserved.   *  Copyright (C) 2005-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_pccmos.c,v 1.15 2005/11/21 22:27:18 debug Exp $   *  $Id: dev_pccmos.c,v 1.22 2006/02/09 20:02:59 debug Exp $
29   *     *  
30   *  PC CMOS/RTC device.   *  PC CMOS/RTC device (ISA ports 0x70 and 0x71).
31   *   *
32   *  The main point of this device is to be a "PC style wrapper" for accessing   *  The main point of this device is to be a "PC style wrapper" for accessing
33   *  the MC146818 (the RTC). In most other respects, this device is bogus, and   *  the MC146818 (the RTC). In most other respects, this device is bogus, and
# Line 59  struct pccmos_data { Line 59  struct pccmos_data {
59  /*  /*
60   *  dev_pccmos_access():   *  dev_pccmos_access():
61   */   */
62  int dev_pccmos_access(struct cpu *cpu, struct memory *mem,  DEVICE_ACCESS(pccmos)
         uint64_t relative_addr, unsigned char *data, size_t len,  
         int writeflag, void *extra)  
63  {  {
64          struct pccmos_data *d = (struct pccmos_data *) extra;          struct pccmos_data *d = (struct pccmos_data *) extra;
65          uint64_t idata = 0, odata = 0;          uint64_t idata = 0, odata = 0;
# Line 116  int dev_pccmos_access(struct cpu *cpu, s Line 114  int dev_pccmos_access(struct cpu *cpu, s
114  }  }
115    
116    
117  /*  DEVINIT(pccmos)
  *  devinit_pccmos():  
  */  
 int devinit_pccmos(struct devinit *devinit)  
118  {  {
119          struct pccmos_data *d = malloc(sizeof(struct pccmos_data));          struct pccmos_data *d = malloc(sizeof(struct pccmos_data));
120          int irq_nr, type = MC146818_PC_CMOS, len = DEV_PCCMOS_LENGTH;          int irq_nr, type = MC146818_PC_CMOS, len = DEV_PCCMOS_LENGTH;
# Line 145  int devinit_pccmos(struct devinit *devin Line 140  int devinit_pccmos(struct devinit *devin
140                  irq_nr = 8 + 8;                  irq_nr = 8 + 8;
141                  type = MC146818_ALGOR;                  type = MC146818_ALGOR;
142                  break;                  break;
143            case MACHINE_ARC:
144                    fatal("\nARC pccmos: TODO\n\n");
145                    irq_nr = 8 + 8; /*  TODO  */
146                    type = MC146818_ALGOR;
147                    break;
148          case MACHINE_EVBMIPS:          case MACHINE_EVBMIPS:
149                  /*  Malta etc.  */                  /*  Malta etc.  */
150                  irq_nr = 8 + 8;                  irq_nr = 8 + 8;
# Line 155  int devinit_pccmos(struct devinit *devin Line 155  int devinit_pccmos(struct devinit *devin
155                  break;                  break;
156          case MACHINE_BEBOX:          case MACHINE_BEBOX:
157          case MACHINE_PREP:          case MACHINE_PREP:
158            case MACHINE_MVMEPPC:
159                    irq_nr = 32 + 8;
160                    break;
161            case MACHINE_SHARK:
162            case MACHINE_IYONIX:
163                    /*  TODO  */
164                  irq_nr = 32 + 8;                  irq_nr = 32 + 8;
165                  break;                  break;
166          default:fatal("devinit_pccmos(): unimplemented machine type"          default:fatal("devinit_pccmos(): unimplemented machine type"

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

  ViewVC Help
Powered by ViewVC 1.1.26