From a69ead5a6ac813fc50d2f58fb437d9caa10b39ea Mon Sep 17 00:00:00 2001 From: "Guillermo J. Rozas" Date: Sat, 6 Feb 1993 05:46:32 +0000 Subject: [PATCH] Make it work under Utah BSD 4.3 --- v7/src/microcode/posixtyp.h | 12 ++++++-- v7/src/microcode/tparam.c | 4 ++- v7/src/microcode/ux.h | 19 +++++++++++-- v7/src/microcode/uxenv.c | 6 +++- v7/src/microcode/uxtop.c | 8 ++++-- v7/src/microcode/uxtrap.h | 55 ++++++++++++++++++++++--------------- 6 files changed, 74 insertions(+), 30 deletions(-) diff --git a/v7/src/microcode/posixtyp.h b/v7/src/microcode/posixtyp.h index 63290b059..52a3e3f7e 100644 --- a/v7/src/microcode/posixtyp.h +++ b/v7/src/microcode/posixtyp.h @@ -1,8 +1,8 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/posixtyp.h,v 1.5 1992/02/27 18:41:09 mhwu Exp $ +$Id: posixtyp.h,v 1.6 1993/02/06 05:37:01 gjr Exp $ -Copyright (c) 1990-91 Massachusetts Institute of Technology +Copyright (c) 1990-1993 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -59,6 +59,14 @@ MIT in each case. */ #define _OFF_T #endif +#ifdef _BSD4_3 +#define _MODE_T +#define _NLINK_T +#define _PID_T +#define _CLOCK_T +#define _TIME_T +#endif + #if defined(_SUNOS4) && defined(__sys_stdtypes_h) #define _MODE_T #define _NLINK_T diff --git a/v7/src/microcode/tparam.c b/v7/src/microcode/tparam.c index 4eb759c8d..be133bda9 100644 --- a/v7/src/microcode/tparam.c +++ b/v7/src/microcode/tparam.c @@ -111,7 +111,9 @@ what you give them. Help stamp out software-hoarding! */ #include "ansidecl.h" -extern char * EXFUN (tparam, (char *, char*, int, int, ...)); +#ifndef _BSD4_3 +extern char * EXFUN (tparam, (char *, char *, int, int, ...)); +#endif extern char * EXFUN (tgoto, (char *, int, int)); /* Assuming STRING is the value of a termcap string entry diff --git a/v7/src/microcode/ux.h b/v7/src/microcode/ux.h index 8206f8774..99c7e6f77 100644 --- a/v7/src/microcode/ux.h +++ b/v7/src/microcode/ux.h @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: ux.h,v 1.39 1993/01/12 19:47:49 gjr Exp $ +$Id: ux.h,v 1.40 1993/02/06 05:42:05 gjr Exp $ Copyright (c) 1988-1993 Massachusetts Institute of Technology @@ -52,7 +52,6 @@ MIT in each case. */ #include #include #include -#include #include "oscond.h" #include "ansidecl.h" @@ -197,6 +196,7 @@ extern void EXFUN (error_system_call, (int code, enum syscall_names name)); #include #include #include +#include #define DECL_GETLOGIN #define HAVE_APPEND @@ -205,11 +205,14 @@ extern void EXFUN (error_system_call, (int code, enum syscall_names name)); #define HAVE_FCNTL #define HAVE_GETCWD #define HAVE_MKDIR +/* MKTIME is really ANSI C, but POSIX has it too ? */ +#define HAVE_MKTIME #define HAVE_POSIX_SIGNALS #define HAVE_RENAME #define HAVE_RMDIR #define HAVE_TERMIOS #define HAVE_TIMES +#define HAVE_UTIME #define HAVE_WAITPID #define VOID_SIGNAL_HANDLERS @@ -548,6 +551,18 @@ struct sigcontext { long sc_sp, sc_pc; }; #define ENOSYS 0 #endif +#ifndef HAVE_UTIME +/* It's really there, but there may not be an include file. */ + +struct utimbuf +{ + time_t actime; + time_t modtime; +}; + +extern int EXFUN (utime, (CONST char *, struct utimbuf *)); +#endif /* HAVE_UTIME */ + #ifdef UNION_WAIT_STATUS typedef union wait wait_status_t; diff --git a/v7/src/microcode/uxenv.c b/v7/src/microcode/uxenv.c index 0823a9464..433b5ab23 100644 --- a/v7/src/microcode/uxenv.c +++ b/v7/src/microcode/uxenv.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: uxenv.c,v 1.9 1993/01/12 19:48:31 gjr Exp $ +$Id: uxenv.c,v 1.10 1993/02/06 05:42:47 gjr Exp $ Copyright (c) 1990-1993 Massachusetts Institute of Technology @@ -84,7 +84,11 @@ DEFUN (OS_encode_time ,(buffer), struct time_structure * buffer) #endif (ts -> tm_yday) = 0; (ts -> tm_isdst) = -1; /* Let mktime figure it out */ +#ifdef HAVE_MKTIME STD_UINT_SYSTEM_CALL (syscall_mktime, t, (UX_mktime (ts))); +#else + error_system_call (ENOSYS, syscall_mktime); +#endif return (t); } diff --git a/v7/src/microcode/uxtop.c b/v7/src/microcode/uxtop.c index 210feee77..7e4e983ac 100644 --- a/v7/src/microcode/uxtop.c +++ b/v7/src/microcode/uxtop.c @@ -1,8 +1,8 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/uxtop.c,v 1.9 1992/06/05 20:09:00 jinx Exp $ +$Id: uxtop.c,v 1.10 1993/02/06 05:45:28 gjr Exp $ -Copyright (c) 1990-1 Massachusetts Institute of Technology +Copyright (c) 1990-1993 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -220,7 +220,9 @@ DEFUN (error_code_to_syserr, (code), int code) case ENODEV: return (syserr_no_such_device); case ENOENT: return (syserr_no_such_file_or_directory); case ENOEXEC: return (syserr_exec_format_error); +#ifdef ENOLCK case ENOLCK: return (syserr_no_locks_available); +#endif case ENOMEM: return (syserr_not_enough_space); case ENOSPC: return (syserr_no_space_left_on_device); case ENOSYS: return (syserr_function_not_implemented); @@ -269,7 +271,9 @@ DEFUN (syserr_to_error_code, (syserr), enum syserr_names syserr) case syserr_io_error: return (EIO); case syserr_is_a_directory: return (EISDIR); case syserr_no_child_processes: return (ECHILD); +#ifdef ENOLCK case syserr_no_locks_available: return (ENOLCK); +#endif case syserr_no_space_left_on_device: return (ENOSPC); case syserr_no_such_device: return (ENODEV); case syserr_no_such_device_or_address: return (ENXIO); diff --git a/v7/src/microcode/uxtrap.h b/v7/src/microcode/uxtrap.h index ddd5bed3b..10801c5f8 100644 --- a/v7/src/microcode/uxtrap.h +++ b/v7/src/microcode/uxtrap.h @@ -1,8 +1,8 @@ /* -*-C-*- -$Id: uxtrap.h,v 1.16 1992/08/29 13:10:09 jinx Exp $ +$Id: uxtrap.h,v 1.17 1993/02/06 05:46:32 gjr Exp $ -Copyright (c) 1990-1992 Massachusetts Institute of Technology +Copyright (c) 1990-1993 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -90,11 +90,12 @@ MIT in each case. */ #ifdef hp9000s800 -#include +/* The bottom 2 bits of the PC are protection bits. + They should be masked away before looking at the PC. + */ -/* See included by */ +#define PC_VALUE_MASK ((~0) << 2) -#ifndef sc_pc /* pcoq is the offset (32 bit in 64 bit virtual address space) in the space included in the corresponding sc_pcsq. head is the current instruction, tail is the next instruction @@ -103,27 +104,29 @@ MIT in each case. */ Both queues need to be collected for some screw cases of debugging and if there is ever a hope to restart the code. */ -#define sc_pc sc_pcoq_head -#endif -#define ss_gr0 ss_flags /* not really true */ -#define ss_rfree ss_gr21 /* or some such */ -#define ss_schsp ss_gr22 +#ifdef _HPUX +# include -#define HAVE_FULL_SIGCONTEXT -#define FULL_SIGCONTEXT_RFREE(scp) ((scp)->sc_sl.sl_ss.ss_rfree) -#define FULL_SIGCONTEXT_SCHSP(scp) ((scp)->sc_sl.sl_ss.ss_schsp) -#define FULL_SIGCONTEXT_FIRST_REG(scp) (&((scp)->sc_sl.sl_ss.ss_gr0)) -#define FULL_SIGCONTEXT_NREGS 32 -#define PROCESSOR_NREGS 32 +/* See included by */ -/* The bottom 2 bits of the PC are protection bits. - They should be masked away before looking at the PC. - */ +# define HAVE_FULL_SIGCONTEXT -#define PC_VALUE_MASK ((~0) << 2) +# ifndef sc_pc +# define sc_pc sc_pcoq_head +# endif /* sc_pc */ -#define INITIALIZE_UX_SIGNAL_CODES() \ +# define ss_gr0 ss_flags /* not really true */ +# define ss_rfree ss_gr21 /* or some such */ +# define ss_schsp ss_gr22 + +# define FULL_SIGCONTEXT_RFREE(scp) ((scp)->sc_sl.sl_ss.ss_rfree) +# define FULL_SIGCONTEXT_SCHSP(scp) ((scp)->sc_sl.sl_ss.ss_schsp) +# define FULL_SIGCONTEXT_FIRST_REG(scp) (&((scp)->sc_sl.sl_ss.ss_gr0)) +# define FULL_SIGCONTEXT_NREGS 32 +# define PROCESSOR_NREGS 32 + +# define INITIALIZE_UX_SIGNAL_CODES() \ { \ DECLARE_UX_SIGNAL_CODE \ (SIGILL, (~ 0L), 8, "illegal instruction trap"); \ @@ -143,7 +146,7 @@ MIT in each case. */ (SIGFPE, (~ 0L), 22, "assist emulation trap"); \ } -#define SPECIAL_SIGNAL_CODE_NAMES() \ +# define SPECIAL_SIGNAL_CODE_NAMES() \ { \ if ((signo == SIGFPE) && (code == 14)) \ switch ((((*scp) . sc_sl . sl_ss . ss_frexcp1) >> 26) & 0x3f) \ @@ -178,6 +181,14 @@ MIT in each case. */ } \ } +#else /* not _HPUX, BSD ? */ + +# ifndef sc_pc +# define sc_pc sc_pcoqh +# endif /* sc_pc */ + +#endif /* _HPUX */ + #endif /* hp9000s800 */ #ifdef sun3 -- 2.25.1