/[gxemul]/trunk/src/promemul/dec_prom.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/promemul/dec_prom.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: dec_prom.c,v 1.11 2006/12/30 13:31:02 debug Exp $   *  $Id: dec_prom.c,v 1.13 2007/06/15 17:02:40 debug Exp $
29   *   *
30   *  DECstation PROM emulation.   *  DECstation PROM emulation.
31   *   *
# Line 45  Line 45 
45  #include "cpu_mips.h"  #include "cpu_mips.h"
46  #include "diskimage.h"  #include "diskimage.h"
47  #include "machine.h"  #include "machine.h"
48    #include "machine_pmax.h"
49  #include "memory.h"  #include "memory.h"
50  #include "misc.h"  #include "misc.h"
51    
# Line 137  int dec_jumptable_func(struct cpu *cpu, Line 138  int dec_jumptable_func(struct cpu *cpu,
138                          int res;                          int res;
139                          unsigned char *tmp_buf;                          unsigned char *tmp_buf;
140    
141                          tmp_buf = malloc(cpu->cd.mips.gpr[MIPS_GPR_A2]);                          CHECK_ALLOCATION(tmp_buf =
142                          if (tmp_buf == NULL) {                              malloc(cpu->cd.mips.gpr[MIPS_GPR_A2]));
                                 fprintf(stderr, "[ ***  Out of memory in "  
                                     "dec_prom.c, allocating %i bytes ]\n",  
                                     (int)cpu->cd.mips.gpr[MIPS_GPR_A2]);  
                                 break;  
                         }  
143    
144                          res = diskimage_access(cpu->machine, disk_id,                          res = diskimage_access(cpu->machine, disk_id,
145                              DISKIMAGE_SCSI, 0, current_file_offset, tmp_buf,                              DISKIMAGE_SCSI, 0, current_file_offset, tmp_buf,
# Line 476  int decstation_prom_emul(struct cpu *cpu Line 472  int decstation_prom_emul(struct cpu *cpu
472                          int res;                          int res;
473                          unsigned char *tmp_buf;                          unsigned char *tmp_buf;
474    
475                          tmp_buf = malloc(cpu->cd.mips.gpr[MIPS_GPR_A2]);                          CHECK_ALLOCATION(tmp_buf =
476                          if (tmp_buf == NULL) {                              malloc(cpu->cd.mips.gpr[MIPS_GPR_A2]));
                                 fprintf(stderr, "[ ***  Out of memory in "  
                                     "dec_prom.c, allocating %i bytes ]\n",  
                                     (int)cpu->cd.mips.gpr[MIPS_GPR_A2]);  
                                 break;  
                         }  
477    
478                          res = diskimage_access(cpu->machine, disk_id,                          res = diskimage_access(cpu->machine, disk_id,
479                              DISKIMAGE_SCSI, 0,                              DISKIMAGE_SCSI, 0,
# Line 592  int decstation_prom_emul(struct cpu *cpu Line 583  int decstation_prom_emul(struct cpu *cpu
583                  debug("[ DEC PROM getbitmap(0x%08x) ]\n",                  debug("[ DEC PROM getbitmap(0x%08x) ]\n",
584                      (int)cpu->cd.mips.gpr[MIPS_GPR_A0]);                      (int)cpu->cd.mips.gpr[MIPS_GPR_A0]);
585                  store_buf(cpu, cpu->cd.mips.gpr[MIPS_GPR_A0],                  store_buf(cpu, cpu->cd.mips.gpr[MIPS_GPR_A0],
586                      (char *)cpu->machine->md.pmax.memmap,                      (char *)cpu->machine->md.pmax->memmap,
587                      sizeof(struct dec_memmap));                      sizeof(struct dec_memmap));
588                  cpu->cd.mips.gpr[MIPS_GPR_V0] =                  cpu->cd.mips.gpr[MIPS_GPR_V0] =
589                      sizeof(cpu->machine->md.pmax.memmap->bitmap);                      sizeof(cpu->machine->md.pmax->memmap->bitmap);
590                  break;                  break;
591          case 0x88:              /*  disableintr()  */          case 0x88:              /*  disableintr()  */
592                  debug("[ DEC PROM disableintr(): TODO ]\n");                  debug("[ DEC PROM disableintr(): TODO ]\n");

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

  ViewVC Help
Powered by ViewVC 1.1.26