/[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 33 by dpavlin, Mon Oct 8 16:20:26 2007 UTC revision 34 by dpavlin, Mon Oct 8 16:21:17 2007 UTC
# Line 1  Line 1 
1  /*  /*
2   *  Copyright (C) 2005-2006  Anders Gavare.  All rights reserved.   *  Copyright (C) 2005-2007  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.24 2006/07/11 04:44:09 debug Exp $   *  $Id: dev_pccmos.c,v 1.28 2007/02/10 14:04:51 debug Exp $
29   *     *  
30   *  PC CMOS/RTC device (ISA ports 0x70 and 0x71).   *  PC CMOS/RTC device (ISA ports 0x70 and 0x71).
31   *   *
# Line 56  struct pccmos_data { Line 56  struct pccmos_data {
56  };  };
57    
58    
 /*  
  *  dev_pccmos_access():  
  */  
59  DEVICE_ACCESS(pccmos)  DEVICE_ACCESS(pccmos)
60  {  {
61          struct pccmos_data *d = (struct pccmos_data *) extra;          struct pccmos_data *d = (struct pccmos_data *) extra;
# Line 117  DEVICE_ACCESS(pccmos) Line 114  DEVICE_ACCESS(pccmos)
114  DEVINIT(pccmos)  DEVINIT(pccmos)
115  {  {
116          struct pccmos_data *d = malloc(sizeof(struct pccmos_data));          struct pccmos_data *d = malloc(sizeof(struct pccmos_data));
117          int irq_nr, type = MC146818_PC_CMOS, len = DEV_PCCMOS_LENGTH;          int type = MC146818_PC_CMOS, len = DEV_PCCMOS_LENGTH;
118    
119          if (d == NULL) {          if (d == NULL) {
120                  fprintf(stderr, "out of memory\n");                  fprintf(stderr, "out of memory\n");
# Line 125  DEVINIT(pccmos) Line 122  DEVINIT(pccmos)
122          }          }
123          memset(d, 0, sizeof(struct pccmos_data));          memset(d, 0, sizeof(struct pccmos_data));
124    
         /*  
          *  Different machines use different IRQ schemes.  
          */  
125          switch (devinit->machine->machine_type) {          switch (devinit->machine->machine_type) {
126          case MACHINE_CATS:          case MACHINE_CATS:
127          case MACHINE_NETWINDER:          case MACHINE_NETWINDER:
                 irq_nr = 32 + 8;  
128                  type = MC146818_CATS;                  type = MC146818_CATS;
129                  d->ram[0x48] = 20;              /*  century  */                  d->ram[0x48] = 20;              /*  century  */
130                  len = DEV_PCCMOS_LENGTH * 2;                  len = DEV_PCCMOS_LENGTH * 2;
131                  break;                  break;
132          case MACHINE_ALGOR:          case MACHINE_ALGOR:
                 irq_nr = 8 + 8;  
133                  type = MC146818_ALGOR;                  type = MC146818_ALGOR;
134                  break;                  break;
135          case MACHINE_ARC:          case MACHINE_ARC:
136                  fatal("\nARC pccmos: TODO\n\n");                  fatal("\nARC pccmos: TODO\n\n");
                 irq_nr = 8 + 8; /*  TODO  */  
137                  type = MC146818_ALGOR;                  type = MC146818_ALGOR;
138                  break;                  break;
139          case MACHINE_EVBMIPS:          case MACHINE_EVBMIPS:
140                  /*  Malta etc.  */                  /*  Malta etc.  */
                 irq_nr = 8 + 8;  
141                  type = MC146818_ALGOR;                  type = MC146818_ALGOR;
142                  break;                  break;
143          case MACHINE_QEMU_MIPS:          case MACHINE_QEMU_MIPS:
144                  irq_nr = 8 + 8;         /*  TODO. Bogus so far.  */          case MACHINE_COBALT:
                 break;  
         case MACHINE_X86:  
                 irq_nr = 16;    /*  "No" irq  */  
                 break;  
145          case MACHINE_BEBOX:          case MACHINE_BEBOX:
146          case MACHINE_PREP:          case MACHINE_PREP:
147          case MACHINE_MVMEPPC:          case MACHINE_MVMEPPC:
                 irq_nr = 32 + 8;  
                 break;  
148          case MACHINE_SHARK:          case MACHINE_SHARK:
149          case MACHINE_IYONIX:          case MACHINE_IYONIX:
                 /*  TODO  */  
                 irq_nr = 32 + 8;  
                 break;  
150          case MACHINE_ALPHA:          case MACHINE_ALPHA:
                 /*  TODO  */  
                 irq_nr = 32 + 8;  
151                  break;                  break;
152          default:fatal("devinit_pccmos(): unimplemented machine type"          default:fatal("devinit_pccmos(): unimplemented machine type"
153                      " %i\n", devinit->machine->machine_type);                      " %i\n", devinit->machine->machine_type);
# Line 180  DEVINIT(pccmos) Line 159  DEVINIT(pccmos)
159              DM_DEFAULT, NULL);              DM_DEFAULT, NULL);
160    
161          dev_mc146818_init(devinit->machine, devinit->machine->memory,          dev_mc146818_init(devinit->machine, devinit->machine->memory,
162              PCCMOS_MC146818_FAKE_ADDR, irq_nr, type, 1);              PCCMOS_MC146818_FAKE_ADDR, devinit->interrupt_path, type, 1);
163    
164          return 1;          return 1;
165  }  }

Legend:
Removed from v.33  
changed lines
  Added in v.34

  ViewVC Help
Powered by ViewVC 1.1.26