BSD 4_3 release
[unix-history] / usr / src / usr.lib / libF77 / trapov_.c
index 06e863c..4dc853a 100644 (file)
@@ -1,5 +1,9 @@
 /*
 /*
-char   id_trapov[] = "@(#)trapov_.c    1.2";
+ * Copyright (c) 1980 Regents of the University of California.
+ * All rights reserved.  The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ *
+ *     @(#)trapov_.c   5.2     6/7/85
  *
  *     Fortran/C floating-point overflow handler
  *
  *
  *     Fortran/C floating-point overflow handler
  *
@@ -274,7 +278,7 @@ got_illegal_instruction(signo, codeword, myaddr, trap_pc, ps)
                if (opnd == NULL) {
                        fprintf(units[STDERR].ufd, "Can't get operand address: 0x%x, %d\n",
                                pc, o_no);
                if (opnd == NULL) {
                        fprintf(units[STDERR].ufd, "Can't get operand address: 0x%x, %d\n",
                                pc, o_no);
-                       force_abort();
+                       f77_abort();
                }
                if (type == F && opnd->o_long == 0x00008000) {
                        /* found one */
                }
                if (type == F && opnd->o_long == 0x00008000) {
                        /* found one */
@@ -294,7 +298,7 @@ got_illegal_instruction(signo, codeword, myaddr, trap_pc, ps)
 
        if (no_reserved == 0) {
                fprintf(units[STDERR].ufd, "Can't find any reserved operand!\n");
 
        if (no_reserved == 0) {
                fprintf(units[STDERR].ufd, "Can't find any reserved operand!\n");
-               force_abort();
+               f77_abort();
        }
 }
 \f/*
        }
 }
 \f/*
@@ -331,7 +335,7 @@ is_floating_operation(opcode)
 got_illegal_poly(opcode)
 {
        fprintf(units[STDERR].ufd, "Can't do 'poly' instructions yet\n");
 got_illegal_poly(opcode)
 {
        fprintf(units[STDERR].ufd, "Can't do 'poly' instructions yet\n");
-       force_abort();
+       f77_abort();
 }
 
 
 }
 
 
@@ -346,7 +350,7 @@ got_illegal_poly(opcode)
 got_illegal_emod(opcode)
 {
        fprintf(units[STDERR].ufd, "Can't do 'emod' instructions yet\n");
 got_illegal_emod(opcode)
 {
        fprintf(units[STDERR].ufd, "Can't do 'emod' instructions yet\n");
-       force_abort();
+       f77_abort();
 }
 
 
 }
 
 
@@ -432,7 +436,7 @@ advance_pc(type)
                                } else {
                                        fprintf(units[STDERR].ufd, "Bad type %d in advance\n",
                                                type);
                                } else {
                                        fprintf(units[STDERR].ufd, "Bad type %d in advance\n",
                                                type);
-                                       force_abort();
+                                       f77_abort();
                                }
                        }
                        return;
                                }
                        }
                        return;
@@ -458,7 +462,7 @@ advance_pc(type)
                
                default:
                        fprintf(units[STDERR].ufd, "Bad mode 0x%x in op_length()\n", mode);
                
                default:
                        fprintf(units[STDERR].ufd, "Bad mode 0x%x in op_length()\n", mode);
-                       force_abort();
+                       f77_abort();
        }
 }
 
        }
 }
 
@@ -532,7 +536,7 @@ get_operand_address(type)
                
                default:
                        fprintf(units[STDERR].ufd, "Bad mode 0x%x in get_addr()\n", mode);
                
                default:
                        fprintf(units[STDERR].ufd, "Bad mode 0x%x in get_addr()\n", mode);
-                       force_abort();
+                       f77_abort();
        }
        return NULL;
 }
        }
        return NULL;
 }
@@ -551,7 +555,7 @@ contents_of_reg(reg)
        else if (reg >= 7 && reg <= 11) value = regs7t11[reg];
        else {
                fprintf(units[STDERR].ufd, "Bad register 0x%x to contents_of()\n", reg);
        else if (reg >= 7 && reg <= 11) value = regs7t11[reg];
        else {
                fprintf(units[STDERR].ufd, "Bad register 0x%x to contents_of()\n", reg);
-               force_abort();
+               f77_abort();
                value = -1;
        }
        return value;
                value = -1;
        }
        return value;
@@ -568,7 +572,7 @@ addr_of_reg(reg)
                return (anyval *) &regs7t11[reg];
        }
        fprintf(units[STDERR].ufd, "Bad reg 0x%x to addr_of()\n", reg);
                return (anyval *) &regs7t11[reg];
        }
        fprintf(units[STDERR].ufd, "Bad reg 0x%x to addr_of()\n", reg);
-       force_abort();
+       f77_abort();
        return NULL;
 }
 \f/*
        return NULL;
 }
 \f/*
@@ -606,26 +610,14 @@ fetch_long()
        pc += 4;
        return *old_pc;
 }
        pc += 4;
        return *old_pc;
 }
-\f/*
- *     force_abort - force us to abort.
- *
- *     We have to change the signal handler for illegal instructions back,
- *     or we'll end up calling 'got_illegal_instruction()' again when
- *     abort() does it's dirty work.
- */
-force_abort()
-{
-       signal(SIGILL, SIG_DFL);
-       abort();
-}
-
+\f
 
 type_length(type)
 {
        if (type == F) return 4;
        if (type == D) return 8;
        fprintf(units[STDERR].ufd, "Bad type 0x%x in type_length()\n", type);
 
 type_length(type)
 {
        if (type == F) return 4;
        if (type == D) return 8;
        fprintf(units[STDERR].ufd, "Bad type 0x%x in type_length()\n", type);
-       force_abort();
+       f77_abort();
        return -1;
 }
 
        return -1;
 }