/[gxemul]/trunk/src/devices/dev_pmppc.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_pmppc.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_pmppc.c,v 1.8 2007/01/29 18:06:52 debug Exp $   *  $Id: dev_pmppc.c,v 1.9 2007/06/15 19:57:33 debug Exp $
29   *     *  
30   *  PM/PPC devices.   *  COMMENT: Artesyn PM/PPC motherboard registers
31   *   *
32   *  TODO   *  NOTE/TODO: Only enough to boot NetBSD/pmppc has been implemented.
33   */   */
34    
35  #include <stdio.h>  #include <stdio.h>
# Line 64  DEVICE_ACCESS(pmppc_board) Line 64  DEVICE_ACCESS(pmppc_board)
64          relative_addr += PMPPC_CONFIG0;          relative_addr += PMPPC_CONFIG0;
65    
66          switch (relative_addr) {          switch (relative_addr) {
67    
68          case PMPPC_CONFIG0:          case PMPPC_CONFIG0:
69                  if (writeflag==MEM_READ) {                  if (writeflag==MEM_READ) {
70                          odata = d->config0;                          odata = d->config0;
# Line 72  DEVICE_ACCESS(pmppc_board) Line 73  DEVICE_ACCESS(pmppc_board)
73                              " 0x%02x ]\n", (int)idata);                              " 0x%02x ]\n", (int)idata);
74                  }                  }
75                  break;                  break;
76    
77          case PMPPC_CONFIG1:          case PMPPC_CONFIG1:
78                  if (writeflag==MEM_READ) {                  if (writeflag==MEM_READ) {
79                          odata = d->config1;                          odata = d->config1;
# Line 80  DEVICE_ACCESS(pmppc_board) Line 82  DEVICE_ACCESS(pmppc_board)
82                              " 0x%02x ]\n", (int)idata);                              " 0x%02x ]\n", (int)idata);
83                  }                  }
84                  break;                  break;
85    
86          case PMPPC_RESET:          case PMPPC_RESET:
87                  if (writeflag==MEM_READ) {                  if (writeflag==MEM_READ) {
88                          odata = d->reset_reg;                          odata = d->reset_reg;
# Line 93  DEVICE_ACCESS(pmppc_board) Line 96  DEVICE_ACCESS(pmppc_board)
96                          d->reset_reg = idata;                          d->reset_reg = idata;
97                  }                  }
98                  break;                  break;
99    
100          default:          default:
101                  if (writeflag==MEM_READ) {                  if (writeflag==MEM_READ) {
102                          debug("[ pmppc: UNIMPLEMENTED read from 0x%08lx ]\n",                          debug("[ pmppc: UNIMPLEMENTED read from 0x%08lx ]\n",
# Line 115  DEVINIT(pmppc) Line 119  DEVINIT(pmppc)
119          struct pmppc_data *d;          struct pmppc_data *d;
120          struct memory *mem = devinit->machine->memory;          struct memory *mem = devinit->machine->memory;
121    
122          d = malloc(sizeof(struct pmppc_data));          CHECK_ALLOCATION(d = malloc(sizeof(struct pmppc_data)));
         if (d == NULL) {  
                 fprintf(stderr, "out of memory\n");  
                 exit(1);  
         }  
123          memset(d, 0, sizeof(struct pmppc_data));          memset(d, 0, sizeof(struct pmppc_data));
124    
125          /*          /*

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

  ViewVC Help
Powered by ViewVC 1.1.26