1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-02-04 07:33:07 +00:00

Remove HP platform support. (#34)

This removes code related to HP9000, HPTIMERBUG, and HPUX defines.

It leaves KB_HP9000 for now as I'm not sure about renumbering
those constants.

This should not impact any of the core emulation code.
This commit is contained in:
Bruce Mitchener
2020-12-13 12:35:53 +07:00
committed by GitHub
parent 750d84c78c
commit 1c912ff57e
19 changed files with 19 additions and 277 deletions

View File

@@ -31,11 +31,9 @@ static char *id = "$Id: chardev.c,v 1.2 1999/01/03 02:06:50 sybalsky Exp $ Copyr
#include <sys/dir.h>
#endif /* FREEBSD */
#endif /* OS5 */
#ifndef HPUX
#ifndef OS5
#include <strings.h>
#endif /* OS5 */
#endif /* HPUX */
#include <sys/ioctl.h>
#else /* DOS */
#include <string.h>
@@ -96,8 +94,8 @@ LispPTR CHAR_openfile(LispPTR *args)
struct stat statbuf;
char pathname[MAXPATHLEN];
#if (defined(RS6000) || defined(HPUX))
static int one = 1; /* Used in charopenfile, etc. */
#if defined(RS6000)
static int one = 1; /* Used in ioctl, etc. */
#endif
Lisp_errno = (int *)(Addr68k_from_LADDR(args[2]));
@@ -125,15 +123,10 @@ LispPTR CHAR_openfile(LispPTR *args)
#ifdef RS6000
ioctl(fd, FIONBIO, &one);
fcntl(fd, F_SETOWN, getpid());
#else
#ifdef HPUX
ioctl(fd, FIOSNBIO, &one);
#else
rval = fcntl(fd, F_GETFL, 0);
rval |= FNDELAY;
rval = fcntl(fd, F_SETFL, rval);
#endif /* HPUX */
#endif /* RS6000 */
return (GetSmallp(fd));

View File

@@ -36,9 +36,6 @@ static char *id = "$Id: dsk.c,v 1.4 2001/12/24 01:09:01 sybalsky Exp $ Copyright
#ifdef sun
#include <sys/vfs.h>
#endif /* sun */
#ifdef HPUX
#include <sys/vfs.h>
#endif /* HPUX */
#else /* DOS */
@@ -119,13 +116,13 @@ static char *id = "$Id: dsk.c,v 1.4 2001/12/24 01:09:01 sybalsky Exp $ Copyright
#include <sys/mount.h>
#else
#ifdef AIX
#if (!defined(AIXPS2) && !defined(HPUX))
#if !defined(AIXPS2)
#ifdef LINUX
#include <sys/vfs.h>
#else
#include <sys/statfs.h>
#endif
#endif /* AIXPS2 | HPUX */
#endif /* AIXPS2 */
#define d_fileno d_ino
#endif /* AIX */
@@ -1961,7 +1958,7 @@ LispPTR COM_setfileinfo(register LispPTR *args)
TIMEOUT(rval = utime(file, time));
#else
TIMEOUT(rval = utimes(file, time));
#endif /* HPUX */
#endif /* USE_UTIME */
#endif /* DOS */
if (rval != 0) {
*Lisp_errno = errno;
@@ -2436,9 +2433,6 @@ LispPTR COM_getfreeblock(register LispPTR *args)
#elif defined(MACOSX) || defined(FREEBSD)
TIMEOUT(rval = statfs(dir, &sfsbuf));
if (rval != 0) {
#elif HPUX
TIMEOUT(rval = statfs(dir, &sfsbuf));
if (rval != 0) {
#elif defined(SYSVONLY)
TIMEOUT(rval = statfs(dir, &sfsbuf, sizeof(struct statfs), 0));
if (rval != 0) {

View File

@@ -51,10 +51,6 @@ static char *id = "$Id: inet.c,v 1.3 2001/12/24 01:09:03 sybalsky Exp $ Copyrigh
#include "commondefs.h"
#include "mkcelldefs.h"
#ifdef HPUX
#define FASYNC O_NONBLOCK
#endif /* NPUX */
#ifdef ISC
#define FASYNC O_NONBLOCK
#define SIGIO SIGPOLL
@@ -108,10 +104,7 @@ LispPTR subr_TCP_ops(int op, LispPTR nameConn, LispPTR proto, LispPTR length, Li
DLword *buffer;
int result;
#ifdef RS6000
static int one = 1; /* Used in TCPconnect */
#endif
#ifdef HPUX
static int one = 1; /* Used in TCPconnect */
static int one = 1; /* Used in ioctl */
#endif
switch (op & 0xFFFF) {
@@ -137,17 +130,12 @@ LispPTR subr_TCP_ops(int op, LispPTR nameConn, LispPTR proto, LispPTR length, Li
#ifdef RS6000
ioctl(result, FIONBIO, &one);
fcntl(result, F_SETOWN, getpid());
#else
#ifdef HPUX
ioctl(result, FIOSNBIO, &one);
#else
fcntl(result, F_SETFL, fcntl(result, F_GETFL, 0) | FNDELAY | FASYNC);
#ifndef ISC
fcntl(result, F_SETOWN, getpid());
#endif /* ISC */
#endif /* HPUX */
#endif /* RS6000 */
return (GetSmallp(result));
@@ -176,17 +164,12 @@ LispPTR subr_TCP_ops(int op, LispPTR nameConn, LispPTR proto, LispPTR length, Li
/* (don't know if FIONBIO alone is enough) */
ioctl(result, FIONBIO, &one);
fcntl(result, F_SETOWN, getpid());
#else
#ifdef HPUX
ioctl(result, FIOSNBIO, &one);
#else
fcntl(result, F_SETFL, fcntl(result, F_GETFL, 0) | FNDELAY);
#ifndef ISC
fcntl(result, F_SETOWN, getpid());
#endif /* ISC */
#endif /* HPUX */
#endif /* RS6000 */
return (GetSmallp(result));
@@ -262,17 +245,12 @@ LispPTR subr_TCP_ops(int op, LispPTR nameConn, LispPTR proto, LispPTR length, Li
#ifdef RS6000
ioctl(result, FIONBIO, &one);
fcntl(result, F_SETOWN, getpid());
#else
#ifdef HPUX
ioctl(result, FIOSNBIO, &one);
#else
fcntl(result, F_SETFL, fcntl(result, F_GETFL, 0) | FNDELAY | FASYNC);
#ifndef ISC
fcntl(result, F_SETOWN, getpid());
#endif /* ISC */
#endif /* HPUX */
#endif /* RS6000 */
if (listen(result, 5) == -1) {
@@ -308,17 +286,12 @@ LispPTR subr_TCP_ops(int op, LispPTR nameConn, LispPTR proto, LispPTR length, Li
#ifdef RS6000
ioctl(result, FIONBIO, &one);
fcntl(result, F_SETOWN, getpid());
#else
#ifdef HPUX
ioctl(result, FIOSNBIO, &one);
#else
fcntl(result, F_SETFL, fcntl(result, F_GETFL, 0) | FNDELAY);
#ifndef ISC
fcntl(result, F_SETOWN, getpid());
#endif /* ISC */
#endif /* HPUX */
#endif /* RS6000 */
return (GetSmallp(result));
@@ -359,17 +332,12 @@ LispPTR subr_TCP_ops(int op, LispPTR nameConn, LispPTR proto, LispPTR length, Li
#ifdef RS6000
ioctl(result, FIONBIO, &one);
fcntl(result, F_SETOWN, getpid());
#else
#ifdef HPUX
ioctl(result, FIOSNBIO, &one);
#else
fcntl(result, F_SETFL, fcntl(result, F_GETFL, 0) | FNDELAY | FASYNC);
#ifndef ISC
fcntl(result, F_SETOWN, getpid());
#endif /* ISC */
#endif /* HPUX */
#endif /* RS6000 */
FD_SET(result, &LispIOFds); /* so we get interrupts */

View File

@@ -288,25 +288,6 @@ u_char SUNLispKeyMap_DEC3100[256] = {
/* 247 */ 105, 255, 10, 58, 28, 255, 255, 255,
};
u_char SUNLispKeyMap_HP9000[135] = {
/* 7 */ 255, 255, 255, 93, 31, 60, 41, 36,
/* 15 */ 255, 255, 255, 255, 255, 255, 255, 255,
/* 23 */ 255, 255, 255, 255, 255, 255, 255, 255,
/* 31 */ 255, 39, 7, 37, 24, 40, 255, 255,
/* 39 */ 255, 255, 255, 255, 255, 255, 255, 255,
/* 47 */ 255, 52, 50, 35, 5, 20, 21, 255,
/* 55 */ 56, 6, 51, 49, 48, 3, 18, 19,
/* 63 */ 34, 4, 2, 0, 1, 16, 17, 32,
/* 71 */ 45, 255, 255, 255, 255, 255, 255, 255,
/* 79 */ 255, 68, 67, 100, 99, 97, 255, 255,
/* 87 */ 255, 68, 101, 66, 104, 80, 13, 255,
/* 95 */ 255, 53, 22, 8, 10, 59, 15, 255,
/* 103 */ 255, 23, 25, 11, 58, 29, 105, 255,
/* 111 */ 255, 38, 9, 26, 43, 28, 44, 255,
/* 119 */ 255, 55, 27, 42, 12, 255, 255, 255,
/* 127 */ 47, 54, 57, 255, 255, 255, 255, 255,
};
u_char *XGenericKeyMap; /* filled in with malloc if needed */
/* For the IBM-101 kbd FF marks exceptions */
@@ -470,7 +451,7 @@ char *getenv(); /* ---- external entry points --------*/
#define KB_AS3000J (7 + MIN_KEYTYPE)
#define KB_RS6000 (8 + MIN_KEYTYPE)
#define KB_DEC3100 (9 + MIN_KEYTYPE)
#define KB_HP9000 (10 + MIN_KEYTYPE)
#define KB_HP9000 (10 + MIN_KEYTYPE) // TODO: Can we remove this?
#define KB_X (11 + MIN_KEYTYPE)
#define KB_DOS (12 + MIN_KEYTYPE)
@@ -600,7 +581,6 @@ static u_char *make_X_keymap() {
/* type3 Sun type-3 keyboard */
/* type4 Sun type-4 keyboard */
/* rs6000 IBM RS/6000 */
/* hp9000 HP 9000 series 800 or 700 */
/* dec3100 DECstation 3100 or 5000 */
/* x generic X keyboard map */
/* */
@@ -646,9 +626,6 @@ void keyboardtype(int fd)
#ifdef RS6000
type = KB_RS6000;
#else
#ifdef HP9000
type = KB_HP9000;
#else
#ifdef XWINDOW
type = KB_X;
#elif DOS
@@ -659,7 +636,6 @@ void keyboardtype(int fd)
type = KB_SUN3;
} /* otherwise, type is set */
#endif /* XWINDOW */
#endif /* HP9000 */
#endif /* RS6000 */
@@ -685,8 +661,6 @@ void keyboardtype(int fd)
type = KB_RS6000;
else if (strcmp("dec3100", key) == 0)
type = KB_DEC3100;
else if (strcmp("hp9000", key) == 0)
type = KB_HP9000;
else if (strcmp("X", key) == 0)
type = KB_X;
else if (strcmp("x", key) == 0)
@@ -728,10 +702,6 @@ void keyboardtype(int fd)
SUNLispKeyMap = SUNLispKeyMap_DEC3100;
InterfacePage->devconfig |= KB_SUN3 - MIN_KEYTYPE; /* 9 */
break;
case KB_HP9000:
SUNLispKeyMap = SUNLispKeyMap_HP9000;
InterfacePage->devconfig |= KB_SUN3 - MIN_KEYTYPE; /* 10 */
break;
#ifdef XWINDOW
case KB_X:
XGenericKeyMap = (u_char *)make_X_keymap();

View File

@@ -28,11 +28,6 @@ static char *id = "$Id: keytst.c,v 1.3 1999/05/31 23:35:36 sybalsky Exp $ Copyri
#include "keylibdefs.h"
#ifdef HPUX
/* On HPUX, use the UNAME syscall to get hostid */
#include <sys/utsname.h>
#endif
#define GOLDEN_RATIO_HACK -478700649
#define floadbyte(number, pos) ((number >> pos) & 0xFFFF)
#define hash_unhash(number, hashkey) \
@@ -62,22 +57,14 @@ int keytester(char *keystring) {
unsigned long hostid; /* 32-bit unique identifier of the current host */
unsigned long hashedword;
int rc; /* return code */
#ifdef HPUX
struct utsname unameinfo;
#endif
/* check the keys and convert them from hexdecimal strings to numbers */
if (keystring == NULL) return FAILURE3;
if (read_hex(keystring, keyarray) == FAILURE3) return FAILURE3;
/* get machines host id */
#ifdef HPUX
uname(&unameinfo);
hostid = atol(unameinfo.idnumber);
#else
hostid = gethostid();
printf("hostid = 0x%x\n", hostid);
#endif
hostid = modify(hostid);
@@ -108,9 +95,7 @@ int read_hex(char *s1, long unsigned int *array) {
if ((strspn(ptr, hexdigits)) != strlen(ptr)) return FAILURE3;
/* convert key to numeric format*/
#ifdef HPUX
*(array + i) = strtoul(ptr, NULL, 16); /* On HP, must convert to unsigned */
#elif defined(RS6000)
#if defined(RS6000)
*(array + i) = strtoul(ptr, NULL, 16); /* On RS/6000, must convert to unsigned */
#elif defined(OSF1)
*(array + i) = strtoul(ptr, NULL, 16); /* On Alpha, must convert to unsigned */

View File

@@ -2820,9 +2820,7 @@ InitDsp(LispArgs args) /* arg[0] = LispPTR to MedleyScreen */
LispReadFds |= (1 << Xfd);
MNWReadFds |= (1 << Xfd);
#ifndef ISC
#ifndef HPUX
fcntl(Xfd, F_SETOWN, getpid());
#endif /* HPUX */
#endif /* ISC */
dspif->screen = args[0]; /* So we know which SCREEN this display is */

View File

@@ -21,9 +21,7 @@ static char *id = "$Id: socket.c,v 1.2 1999/01/03 02:07:34 sybalsky Exp $ Copyri
#include <sys/ioctl.h>
#include <netdb.h>
#include <sys/socket.h>
#ifndef hpux
#include <netinet/tcp.h>
#endif
extern int errno; /* Certain (broken) OS's don't have this */
/* decl in errno.h */

View File

@@ -492,9 +492,7 @@ extern u_int LispWindowFd;
/* */
/* i n t _ t i m e r _ s e r v i c e */
/* */
/* Handle the virtual-time alarm signal VTALRM. If running in */
/* HPUX, re-set the alarm ourselves, because the OS walks on */
/* your timer if you let IT do the resetting. */
/* Handle the virtual-time alarm signal VTALRM. */
/* */
/* */
/************************************************************************/
@@ -519,15 +517,6 @@ static int int_timer_service(int sig, int code, void *scp)
#ifdef XWINDOW
Event_Req = TRUE;
#endif
#ifdef HPTIMERBUG
{
struct itimerval timert, tmpt;
timert.it_interval.tv_sec = timert.it_value.tv_sec = 0;
timert.it_interval.tv_usec = 0;
timert.it_value.tv_usec = TIMER_INTERVAL;
setitimer(ITIMER_VIRTUAL, &timert, 0);
}
#endif /* HPTIMERBUG */
#ifdef SYSVSIGNALS
#ifndef ISC
@@ -581,17 +570,8 @@ static void int_timer_init()
#endif /* SYSVSIGNALS */
/* then attach a timer to it and turn it loose */
#ifdef HPTIMERBUG
/* HPUX on the series 700 trashes the timer if you use */
/* the auto-reset feature (interval != 0), so have to */
/* move the reset into the timer handler (above). */
timert.it_interval.tv_sec = timert.it_value.tv_sec = 0;
timert.it_interval.tv_usec = 0;
timert.it_value.tv_usec = TIMER_INTERVAL;
#else
timert.it_interval.tv_sec = timert.it_value.tv_sec = 0;
timert.it_interval.tv_usec = timert.it_value.tv_usec = TIMER_INTERVAL;
#endif /* HPTIMERBUG */
timerclear(&tmpt.it_value);
timerclear(&tmpt.it_interval);
@@ -732,10 +712,7 @@ void int_block() {
#endif /* SIGXFSZ */
#else
oldmask = sigblock(sigmask(SIGVTALRM) | sigmask(SIGIO) | sigmask(SIGALRM)
#ifndef HPUX
| sigmask(SIGXFSZ)
#endif /* HPUX */
#ifdef FLTINT
| sigmask(SIGFPE)
#endif

View File

@@ -21,12 +21,10 @@ static char *id = "$Id: ufs.c,v 1.2 1999/01/03 02:07:41 sybalsky Exp $ Copyright
#include <sys/file.h>
#ifndef OS5
#ifndef HPUX
#ifndef FREEBSD
#include <sys/dir.h>
#endif
#endif
#endif
#include <sys/stat.h>
#include <sys/time.h>

View File

@@ -62,7 +62,7 @@ Unix Interface Communications
#if defined(SYSVONLY) || defined(FREEBSD) || defined(OS5) || defined(MACOSX)
#include <unistd.h>
#endif /* HPUX */
#endif
#ifdef sun
/* to get S_IFIFO defn for creating fifos */
@@ -936,16 +936,16 @@ LispPTR Unix_handlecomm(LispPTR *args) {
case 10: /* Change window */
{
int rows, cols, pgrp, pty;
#if (!defined(HPUX) && !defined(RISCOS))
#if !defined(RISCOS)
struct winsize w;
#endif /* HPUX */
#endif /* !RISCOS */
/* Get job #, rows, columns */
N_GETNUMBER(args[1], slot, bad);
N_GETNUMBER(args[2], rows, bad);
N_GETNUMBER(args[3], cols, bad);
#if (!defined(HPUX) && !defined(RISCOS))
#if !defined(RISCOS)
if (valid_slot(slot) && (UJ[slot].type == UJSHELL) && (UJ[slot].status == -1)) {
w.ws_row = rows;
w.ws_col = cols;
@@ -970,7 +970,7 @@ LispPTR Unix_handlecomm(LispPTR *args) {
return (ATOM_T);
return (GetSmallp(errno));
}
#endif /* HPUX | RISCOS */
#endif /* !RISCOS */
return (NIL);
}

View File

@@ -49,11 +49,6 @@ typedef int clockid_t;
#include <sys/resource.h>
#endif /* OSF1 */
#ifdef HPUX
#include <sgtty.h>
#include <unistd.h>
#endif /* HPUX */
#if defined(SYSVONLY) || defined(OS5) || defined(FREEBSD) || defined(MACOSX)
#include <fcntl.h>
#include <unistd.h>
@@ -313,10 +308,7 @@ int fork_Unix() {
sighold(SIGFPE);
#else
sigblock(sigmask(SIGVTALRM) | sigmask(SIGIO) | sigmask(SIGALRM)
#ifndef HPUX
| sigmask(SIGXFSZ)
#endif /* HPUX */
| sigmask(SIGFPE));
#endif /* SYSVSIGNALS */
@@ -507,7 +499,7 @@ int fork_Unix() {
#else
/* Make sure everything else is closed */
for (i = 3; i < getdtablesize(); i++) close(i);
#endif /* HPUX */
#endif /* SYSVONLY */
/* Run the shell command and get the result */
status = system(cmdstring);

View File

@@ -220,8 +220,7 @@ LispPTR unix_username(LispPTR *args) {
* clear what use they are. RS/6000 systems use a PowerPC processor,
* and so did PowerBook Macintosh systems.
* "MACH" and "ARCH" both seem to be a mix of instruction set architecture and
* system types (rs/6000 used PowerPC, hp9000 had mc68000, PA-RISC,
* and later, IA-64 [Itanium]).
* system types (rs/6000 used PowerPC).
* The only usage seems to be checking "ARCH" == "dos" and for the existance
* of *any* result from the call, which indicates it's an emulated system.
*/
@@ -238,8 +237,6 @@ LispPTR unix_getparm(LispPTR *args) {
envvalue = "i386";
#elif defined(RS6000)
envvalue = "rs/6000";
#elif defined(HP9000)
envvalue = "hp9000";
#elif defined(ISC)
envvalue = "i386";
#elif defined(RISCOS)
@@ -259,8 +256,6 @@ LispPTR unix_getparm(LispPTR *args) {
envvalue = "sun386";
#elif defined(RS6000)
envvalue = "rs/6000";
#elif defined(HP9000)
envvalue = "hp9000";
#elif defined(ISC)
envvalue = "i386";
#elif defined(RISCOS)

View File

@@ -33,15 +33,10 @@ static char *id = "$Id: xinit.c,v 1.5 2001/12/26 22:17:06 sybalsky Exp $ Copyrig
#include "xwinmandefs.h"
#ifdef HPUX
#define FASYNC O_NONBLOCK
#endif /* HPUX */
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/select.h>
#ifndef HPUX
#ifndef LINUX
#ifndef MACOSX
#ifndef FREEBSD
@@ -49,7 +44,6 @@ static char *id = "$Id: xinit.c,v 1.5 2001/12/26 22:17:06 sybalsky Exp $ Copyrig
#endif /* FREEBSD */
#endif /* MACOSX */
#endif /* LINUX */
#endif /* HPUX */
#ifdef ISC
#define FASYNC O_NONBLOCK
@@ -202,9 +196,7 @@ void Open_Display(DspInterface dsp)
{
FD_SET(ConnectionNumber(dsp->display_id), &LispReadFds);
#ifndef ISC
#ifndef HPUX
fcntl(ConnectionNumber(dsp->display_id), F_SETOWN, getpid());
#endif /* HPUX */
#endif /* ISC */
/****************************************************/