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 |
* |
* |
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 |
|
|
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, |
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, |
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"); |