1
0
mirror of https://github.com/prirun/p50em.git synced 2026-02-12 10:27:16 +00:00

Check if Prime RAM allocation succeeded instead of seg faulting

This commit is contained in:
Jim Wilcoxson
2020-04-13 22:00:00 +00:00
parent 932224bf0f
commit f9f77c3c99

4
em.c
View File

@@ -4695,6 +4695,10 @@ int main (int argc, char **argv) {
for (i=0; i < IOTLBENTS; i++)
gv.iotlb[i].valid = 0;
physmem = malloc(gv.memlimit * sizeof(*physmem));
if (physmem == NULL) {
perror("Error allocating Prime memory block");
fatal("Can't allocate Prime memory block");
}
bzero(MEM, 64*1024*2); /* zero first 64K words */
/* if no maps were specified on the command line, look for ring0.map and