/[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 41 by dpavlin, Mon Oct 8 16:21:17 2007 UTC revision 42 by dpavlin, Mon Oct 8 16:22:32 2007 UTC
# Line 25  Line 25 
25   *  SUCH DAMAGE.   *  SUCH DAMAGE.
26   *     *  
27   *   *
28   *  $Id: dev_pccmos.c,v 1.28 2007/02/10 14:04:51 debug Exp $   *  $Id: dev_pccmos.c,v 1.31 2007/06/15 19:57:33 debug Exp $
29   *     *  
30   *  PC CMOS/RTC device (ISA ports 0x70 and 0x71).   *  COMMENT: 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 58  struct pccmos_data { Line 58  struct pccmos_data {
58    
59  DEVICE_ACCESS(pccmos)  DEVICE_ACCESS(pccmos)
60  {  {
61          struct pccmos_data *d = (struct pccmos_data *) extra;          struct pccmos_data *d = extra;
62          uint64_t idata = 0, odata = 0;          uint64_t idata = 0, odata = 0;
63          unsigned char b = 0;          unsigned char b = 0;
64          int r = 1;          int r = 1;
# Line 113  DEVICE_ACCESS(pccmos) Line 113  DEVICE_ACCESS(pccmos)
113    
114  DEVINIT(pccmos)  DEVINIT(pccmos)
115  {  {
         struct pccmos_data *d = malloc(sizeof(struct pccmos_data));  
116          int type = MC146818_PC_CMOS, len = DEV_PCCMOS_LENGTH;          int type = MC146818_PC_CMOS, len = DEV_PCCMOS_LENGTH;
117            struct pccmos_data *d;
118    
119          if (d == NULL) {          CHECK_ALLOCATION(d = malloc(sizeof(struct pccmos_data)));
                 fprintf(stderr, "out of memory\n");  
                 exit(1);  
         }  
120          memset(d, 0, sizeof(struct pccmos_data));          memset(d, 0, sizeof(struct pccmos_data));
121    
122          switch (devinit->machine->machine_type) {          switch (devinit->machine->machine_type) {
# Line 145  DEVINIT(pccmos) Line 142  DEVINIT(pccmos)
142          case MACHINE_BEBOX:          case MACHINE_BEBOX:
143          case MACHINE_PREP:          case MACHINE_PREP:
144          case MACHINE_MVMEPPC:          case MACHINE_MVMEPPC:
         case MACHINE_SHARK:  
         case MACHINE_IYONIX:  
145          case MACHINE_ALPHA:          case MACHINE_ALPHA:
146                  break;                  break;
147          default:fatal("devinit_pccmos(): unimplemented machine type"          default:fatal("devinit_pccmos(): unimplemented machine type"

Legend:
Removed from v.41  
changed lines
  Added in v.42

  ViewVC Help
Powered by ViewVC 1.1.26