Subject: Netscape diffs
To: None <current-users@NetBSD.ORG>
From: Charles M. Hannum <mycroft@bikini.linnaean.org>
List: current-users
Date: 04/03/1998 18:47:47
Here are my diffs for Netscape 5 under NetBSD/i386. It works okay with
today's lesstif-current, though there's some empty space under the
toolbar.
The dynamic version (moz-export) doesn't yet work quite right, due to a
bug in ld(1) and ld.so(1) that should be fixed RSN.
Notes:
The patch to dialogs.c is needed for lesstif, probably not for Motif.
There are a few things that need to be changed for other (non-i386)
architectures:
OS_REL_CFLAGS: defines architecture-specific compiler options.
_PR_VMBASE _PR_STACK_VMBASE: define architecture-specific VM map
information.
_MD_GET_SP: defines architecture-specific sigcontext information.
Everything else should more or less `just work'.
*** t/ns/cmd/xfe/Makefile Mon Mar 30 21:05:35 1998
--- ns/cmd/xfe/Makefile Wed Apr 1 22:53:07 1998
***************
*** 486,489 ****
--- 486,495 ----
########################################
+ # NetBSD
+ ifeq ($(OS_ARCH),NetBSD)
+ OTHER_LIBS = -L/usr/X11R6/lib -lXm -lXt -lXmu -lXext -lX11 -lSM -lICE -lm $(OS_LIBS)
+ endif
+
+ ########################################
# BSDI
ifeq ($(OS_ARCH),BSD_OS)
*** t/ns/cmd/xfe/Microline3.0/XmL/Grid.c Mon Mar 30 21:05:42 1998
--- ns/cmd/xfe/Microline3.0/XmL/Grid.c Wed Apr 1 22:26:47 1998
***************
*** 31,34 ****
--- 31,35 ----
#include <Xm/DrawnB.h>
#include <Xm/CutPaste.h>
+ #include <Xm/DropSMgr.h>
#include <X11/StringDefs.h>
#include <X11/cursorfont.h>
*** t/ns/cmd/xfe/dialogs.c Mon Mar 30 21:05:37 1998
--- ns/cmd/xfe/dialogs.c Wed Apr 1 22:32:25 1998
***************
*** 240,245 ****
}
- #if !defined(__FreeBSD__) && !defined(MACLINUX) && !defined(LINUX_GLIBC_2)
#include <sys/errno.h>
extern char *sys_errlist[];
extern int sys_nerr;
--- 240,245 ----
}
#include <sys/errno.h>
+ #if !defined(__FreeBSD__) && !defined(MACLINUX) && !defined(LINUX_GLIBC_2) && !defined(__NetBSD__)
extern char *sys_errlist[];
extern int sys_nerr;
*** t/ns/cmd/xfe/mozilla.c Mon Mar 30 21:05:40 1998
--- ns/cmd/xfe/mozilla.c Wed Apr 1 22:31:36 1998
***************
*** 3476,3480 ****
#else /* !OLD_UNIX_FILES */
! #if !defined(__FreeBSD__) && !defined(MACLINUX) && !defined(LINUX_GLIBC_2)
extern char *sys_errlist[];
extern int sys_nerr;
--- 3476,3480 ----
#else /* !OLD_UNIX_FILES */
! #if !defined(__FreeBSD__) && !defined(MACLINUX) && !defined(LINUX_GLIBC_2) && !defined(__NetBSD__)
extern char *sys_errlist[];
extern int sys_nerr;
*** t/ns/cmd/xfe/prefdialogs.c Mon Mar 30 21:05:40 1998
--- ns/cmd/xfe/prefdialogs.c Wed Apr 1 22:32:20 1998
***************
*** 78,82 ****
/* For sys_errlist and sys_nerr */
#include <sys/errno.h>
! #if !defined(__FreeBSD__) && !defined(LINUX_GLIBC_2)
extern char *sys_errlist[];
extern int sys_nerr;
--- 78,82 ----
/* For sys_errlist and sys_nerr */
#include <sys/errno.h>
! #if !defined(__FreeBSD__) && !defined(LINUX_GLIBC_2) && !defined(__NetBSD__)
extern char *sys_errlist[];
extern int sys_nerr;
*** t/ns/config/rules.mk Mon Mar 30 21:07:28 1998
--- ns/config/rules.mk Fri Apr 3 17:44:03 1998
***************
*** 103,106 ****
--- 103,109 ----
SHARED_LIBRARY := $(LIBRARY:.a=.so.1.0)
else
+ ifeq ($(OS_ARCH),NetBSD)
+ SHARED_LIBRARY := $(LIBRARY:.a=.so.1.0)
+ else
ifeq ($(OS_ARCH)$(OS_RELEASE),SunOS4.1)
SHARED_LIBRARY := $(LIBRARY:.a=.so.1.0)
***************
*** 110,113 ****
--- 113,117 ----
else
SHARED_LIBRARY := $(LIBRARY:.a=.so)
+ endif
endif
endif
*** t/ns/js/src/prmjtime.c Mon Mar 30 21:04:03 1998
--- ns/js/src/prmjtime.c Wed Apr 1 17:56:51 1998
***************
*** 391,395 ****
PRInt64 maxtimet;
struct tm tm;
! #if defined( XP_PC ) || defined( FREEBSD )
struct tm *ptm;
#endif
--- 391,395 ----
PRInt64 maxtimet;
struct tm tm;
! #if defined( XP_PC ) || defined( FREEBSD ) || defined( NETBSD )
struct tm *ptm;
#endif
***************
*** 410,414 ****
LL_L2UI(local,time);
PRMJ_basetime(time,&prtm);
! #if defined( XP_PC ) || defined( FREEBSD )
ptm = localtime(&local);
if(!ptm){
--- 410,414 ----
LL_L2UI(local,time);
PRMJ_basetime(time,&prtm);
! #if defined( XP_PC ) || defined( FREEBSD ) || defined( NETBSD )
ptm = localtime(&local);
if(!ptm){
***************
*** 845,849 ****
#endif
! #if defined(XP_PC) || defined(XP_MAC) || defined( FREEBSD )
lt = *localtime(&seconds);
#else
--- 845,849 ----
#endif
! #if defined(XP_PC) || defined(XP_MAC) || defined( FREEBSD ) || defined( NETBSD )
lt = *localtime(&seconds);
#else
*** t/ns/modules/schedulr/src/Makefile Mon Mar 30 21:05:31 1998
--- ns/modules/schedulr/src/Makefile Fri Apr 3 17:55:57 1998
***************
*** 18,23 ****
DEPTH = ../../..
! MODULE = schedulr
! LIBRARY_NAME = sched
REQUIRES = nspr util
--- 18,23 ----
DEPTH = ../../..
! MODULE = schedulr
! LIBRARY_NAME = sched
REQUIRES = nspr util
*** t/ns/nsprpub/pr/include/md/Makefile Mon Mar 30 21:05:25 1998
--- ns/nsprpub/pr/include/md/Makefile Wed Apr 1 17:53:13 1998
***************
*** 56,59 ****
--- 56,63 ----
endif
+ ifeq ($(OS_ARCH),NetBSD)
+ MDCPUCFG_H = _netbsd.cfg
+ endif
+
ifeq ($(OS_ARCH),HP-UX)
MDCPUCFG_H = _hpux.cfg
*** t/ns/nsprpub/pr/include/md/_unixos.h Mon Mar 30 21:05:25 1998
--- ns/nsprpub/pr/include/md/_unixos.h Wed Apr 1 18:01:03 1998
***************
*** 50,54 ****
|| defined(BSDI) || defined(SONY)
#include <sys/select.h>
! #elif defined(SUNOS4) || defined(SCO) || defined(FREEBSD)
#include <sys/types.h>
#elif defined(LINUX)
--- 50,54 ----
|| defined(BSDI) || defined(SONY)
#include <sys/select.h>
! #elif defined(SUNOS4) || defined(SCO) || defined(FREEBSD) || defined(NETBSD)
#include <sys/types.h>
#elif defined(LINUX)
*** t/ns/nsprpub/pr/include/md/prosdep.h Mon Mar 30 21:05:25 1998
--- ns/nsprpub/pr/include/md/prosdep.h Wed Apr 1 18:01:14 1998
***************
*** 60,63 ****
--- 60,66 ----
#include "md/_freebsd.h"
+ #elif defined(NETBSD)
+ #include "md/_netbsd.h"
+
#elif defined(BSDI)
#include "md/_bsdi.h"
*** t/ns/nsprpub/pr/include/prinet.h Mon Mar 30 21:05:24 1998
--- ns/nsprpub/pr/include/prinet.h Wed Apr 1 18:36:21 1998
***************
*** 53,57 ****
#include <netdb.h>
! #if defined(FREEBSD) || defined(BSDI)
#include <rpc/types.h> /* the only place that defines INADDR_LOOPBACK */
#endif
--- 53,57 ----
#include <netdb.h>
! #if (defined(FREEBSD) || defined(BSDI)) && !defined(NETBSD)
#include <rpc/types.h> /* the only place that defines INADDR_LOOPBACK */
#endif
*** t/ns/nsprpub/pr/src/md/prosdep.c Mon Mar 30 21:05:25 1998
--- ns/nsprpub/pr/src/md/prosdep.c Wed Apr 1 18:01:34 1998
***************
*** 43,47 ****
#ifdef XP_UNIX
#if defined SUNOS4 || defined LINUX || defined BSDI || defined AIX \
! || defined FREEBSD
_pr_pageSize = getpagesize();
#elif defined(HPUX)
--- 43,47 ----
#ifdef XP_UNIX
#if defined SUNOS4 || defined LINUX || defined BSDI || defined AIX \
! || defined FREEBSD || defined NETBSD
_pr_pageSize = getpagesize();
#elif defined(HPUX)
*** t/ns/nsprpub/pr/src/md/unix/Makefile Mon Mar 30 21:05:26 1998
--- ns/nsprpub/pr/src/md/unix/Makefile Wed Apr 1 18:05:23 1998
***************
*** 58,61 ****
--- 58,65 ----
$(NULL)
+ NETBSD_CSRCS = \
+ netbsd.c \
+ $(NULL)
+
BSDI_CSRCS = \
bsdi.c \
***************
*** 119,122 ****
--- 123,129 ----
ifeq ($(OS_ARCH),FreeBSD)
CSRCS += $(FREEBSD_CSRCS)
+ endif
+ ifeq ($(OS_ARCH),NetBSD)
+ CSRCS += $(NETBSD_CSRCS)
endif
ifeq ($(OS_ARCH),BSD_386)
*** t/ns/nsprpub/pr/src/md/unix/objs.mk Mon Mar 30 21:05:26 1998
--- ns/nsprpub/pr/src/md/unix/objs.mk Wed Apr 1 18:05:37 1998
***************
*** 50,53 ****
--- 50,57 ----
$(NULL)
+ NETBSD_CSRCS = \
+ netbsd.c \
+ $(NULL)
+
BSDI_CSRCS = \
bsdi.c \
***************
*** 112,115 ****
--- 116,122 ----
ifeq ($(OS_ARCH),FreeBSD)
CSRCS += $(FREEBSD_CSRCS)
+ endif
+ ifeq ($(OS_ARCH),NetBSD)
+ CSRCS += $(NETBSD_CSRCS)
endif
ifeq ($(OS_ARCH),BSD_386)
*** t/ns/nsprpub/pr/src/md/unix/unix.c Mon Mar 30 21:05:26 1998
--- ns/nsprpub/pr/src/md/unix/unix.c Wed Apr 1 18:05:53 1998
***************
*** 44,48 ****
|| defined(SUNOS4)
#define _PRSockLen_t int
! #elif (defined(AIX) && !defined(AIX4_1)) || defined(FREEBSD) \
|| defined(UNIXWARE)
#define _PRSockLen_t size_t
--- 44,48 ----
|| defined(SUNOS4)
#define _PRSockLen_t int
! #elif (defined(AIX) && !defined(AIX4_1)) || defined(FREEBSD) || defined(NETBSD) \
|| defined(UNIXWARE)
#define _PRSockLen_t size_t
*** t/ns/nsprpub/pr/src/md/unix/unix_errors.c Mon Mar 30 21:05:26 1998
--- ns/nsprpub/pr/src/md/unix/unix_errors.c Wed Apr 1 18:06:28 1998
***************
*** 161,165 ****
PR_SetError(PR_READ_ONLY_FILESYSTEM_ERROR, err);
break;
! #if !defined(OSF1) && !defined(FREEBSD) && !defined(BSDI)
case EMULTIHOP:
case ENOLINK:
--- 161,165 ----
PR_SetError(PR_READ_ONLY_FILESYSTEM_ERROR, err);
break;
! #if !defined(OSF1) && !defined(FREEBSD) && !defined(BSDI) && !defined(NETBSD)
case EMULTIHOP:
case ENOLINK:
***************
*** 186,190 ****
break;
case ETIMEDOUT:
! #if !defined(OSF1) && !defined(FREEBSD) && !defined(BSDI)
case EMULTIHOP:
case ENOLINK:
--- 186,190 ----
break;
case ETIMEDOUT:
! #if !defined(OSF1) && !defined(FREEBSD) && !defined(BSDI) && !defined(NETBSD)
case EMULTIHOP:
case ENOLINK:
***************
*** 279,283 ****
PR_SetError(PR_LOOP_ERROR, err);
break;
! #if !defined(OSF1) && !defined(FREEBSD) && !defined(BSDI)
case EMULTIHOP:
case ENOLINK:
--- 279,283 ----
PR_SetError(PR_LOOP_ERROR, err);
break;
! #if !defined(OSF1) && !defined(FREEBSD) && !defined(BSDI) && !defined(NETBSD)
case EMULTIHOP:
case ENOLINK:
***************
*** 330,334 ****
PR_SetError(PR_LOOP_ERROR, err);
break;
! #if !defined(OSF1) && !defined(FREEBSD) && !defined(BSDI)
case EMULTIHOP:
case ENOLINK:
--- 330,334 ----
PR_SetError(PR_LOOP_ERROR, err);
break;
! #if !defined(OSF1) && !defined(FREEBSD) && !defined(BSDI) && !defined(NETBSD)
case EMULTIHOP:
case ENOLINK:
***************
*** 396,400 ****
PR_SetError(PR_IO_ERROR, err);
break;
! #if !defined(OSF1) && !defined(FREEBSD) && !defined(BSDI)
case EMULTIHOP:
case ENOLINK:
--- 396,400 ----
PR_SetError(PR_IO_ERROR, err);
break;
! #if !defined(OSF1) && !defined(FREEBSD) && !defined(BSDI) && !defined(NETBSD)
case EMULTIHOP:
case ENOLINK:
***************
*** 433,437 ****
PR_SetError(PR_LOOP_ERROR, err);
break;
! #if !defined(OSF1) && !defined(FREEBSD) && !defined(BSDI)
case EMULTIHOP:
case ENOLINK:
--- 433,437 ----
PR_SetError(PR_LOOP_ERROR, err);
break;
! #if !defined(OSF1) && !defined(FREEBSD) && !defined(BSDI) && !defined(NETBSD)
case EMULTIHOP:
case ENOLINK:
***************
*** 1346,1350 ****
break;
case ETIMEDOUT:
! #if !defined(OSF1) && !defined(FREEBSD) && !defined(BSDI)
case EMULTIHOP:
case ENOLINK:
--- 1346,1350 ----
break;
case ETIMEDOUT:
! #if !defined(OSF1) && !defined(FREEBSD) && !defined(BSDI) && !defined(NETBSD)
case EMULTIHOP:
case ENOLINK:
*** t/ns/nsprpub/pr/src/md/unix/uxwrap.c Mon Mar 30 21:05:26 1998
--- ns/nsprpub/pr/src/md/unix/uxwrap.c Wed Apr 1 18:10:42 1998
***************
*** 327,330 ****
--- 327,332 ----
#elif defined(HPUX9)
int poll(struct pollfd filedes[], int nfds, int timeout)
+ #elif defined(NETBSD)
+ int poll(struct pollfd *filedes, nfds_t nfds, int timeout)
#else
int poll(struct pollfd *filedes, unsigned long nfds, int timeout)
*** t/ns/nsprpub/pr/src/pthreads/ptio.c Mon Mar 30 21:05:27 1998
--- ns/nsprpub/pr/src/pthreads/ptio.c Wed Apr 1 18:02:28 1998
***************
*** 72,76 ****
#define _PRSockOptVal_t char *
#elif defined(IRIX) || defined(OSF1) || defined(AIX) || defined(HPUX) \
! || defined(LINUX) || defined(FREEBSD)
#define _PRSockOptVal_t void *
#else
--- 72,76 ----
#define _PRSockOptVal_t char *
#elif defined(IRIX) || defined(OSF1) || defined(AIX) || defined(HPUX) \
! || defined(LINUX) || defined(FREEBSD) || defined(NETBSD)
#define _PRSockOptVal_t void *
#else
***************
*** 85,89 ****
|| defined(OSF1) || defined(SOLARIS) \
|| defined(HPUX10_30) || defined(HPUX11) || defined(LINUX) \
! || defined(FREEBSD)
#define _PRSelectFdSetArg_t fd_set *
#else
--- 85,89 ----
|| defined(OSF1) || defined(SOLARIS) \
|| defined(HPUX10_30) || defined(HPUX11) || defined(LINUX) \
! || defined(FREEBSD) || defined(NETBSD)
#define _PRSelectFdSetArg_t fd_set *
#else
***************
*** 2386,2390 ****
#if defined(HPUX) || defined(OSF1) || defined(SOLARIS) || defined (IRIX) \
! || defined(AIX) || defined(LINUX) || defined(FREEBSD)
#define _PR_FCNTL_FLAGS O_NONBLOCK
#else
--- 2386,2390 ----
#if defined(HPUX) || defined(OSF1) || defined(SOLARIS) || defined (IRIX) \
! || defined(AIX) || defined(LINUX) || defined(FREEBSD) || defined(NETBSD)
#define _PR_FCNTL_FLAGS O_NONBLOCK
#else
*** /dev/null Fri Apr 3 18:26:14 1998
--- ns/config/NetBSD.mk Wed Apr 1 17:58:51 1998
***************
*** 0 ****
--- 1,89 ----
+ #
+ # The contents of this file are subject to the Netscape Public License
+ # Version 1.0 (the "NPL"); you may not use this file except in
+ # compliance with the NPL. You may obtain a copy of the NPL at
+ # http://www.mozilla.org/NPL/
+ #
+ # Software distributed under the NPL is distributed on an "AS IS" basis,
+ # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+ # for the specific language governing rights and limitations under the
+ # NPL.
+ #
+ # The Initial Developer of this code under the NPL is Netscape
+ # Communications Corporation. Portions created by Netscape are
+ # Copyright (C) 1998 Netscape Communications Corporation. All Rights
+ # Reserved.
+ #
+
+ ######################################################################
+ # Config stuff for NetBSD
+ ######################################################################
+ #
+ ######################################################################
+ # Version-independent
+ ######################################################################
+
+ ARCH := netbsd
+ CPU_ARCH := x86
+ GFX_ARCH := x
+
+ OS_INCLUDES = -I/usr/X11R6/include
+ G++INCLUDES = -I/usr/include/g++
+ LOC_LIB_DIR =
+ MOTIF =
+ MOTIFLIB =
+ OS_LIBS =
+
+ # Don't define BSD, because it's already defined in /usr/include/sys/param.h.
+ PLATFORM_FLAGS = -DNETBSD -DBSDI -DBSDI_2 -D__386BSD__ -Di386 $(DSO_CFLAGS)
+ MOVEMAIL_FLAGS = -DHAVE_STRERROR
+ PORT_FLAGS = -DSW_THREADS -DNEED_UINT -DHAVE_LCHOWN -DNTOHL_ENDIAN_H -DHAVE_FILIO_H -DNEED_SYS_TIME_H -DNEED_UINT_T -DHAVE_BSD_FLOCK
+ PDJAVA_FLAGS = -mx128m
+ OS_GPROF_FLAGS = -pg
+ LD_FLAGS = -L/usr/X11R6/lib -lXm
+
+ OS_CFLAGS = $(PLATFORM_FLAGS) $(PORT_FLAGS) $(MOVEMAIL_FLAGS)
+
+ LOCALE_MAP = $(DEPTH)/cmd/xfe/intl/bsd386.lm
+ EN_LOCALE = C
+ DE_LOCALE = de_DE.ISO8859-1
+ FR_LOCALE = fr_FR.ISO8859-1
+ JP_LOCALE = ja
+ SJIS_LOCALE = ja_JP.SJIS
+ KR_LOCALE = ko_KR.EUC
+ CN_LOCALE = zh
+ TW_LOCALE = zh
+ I2_LOCALE = i2
+
+ ######################################################################
+ # Version-specific stuff
+ ######################################################################
+
+ ######################################################################
+ # Overrides for defaults in config.mk (or wherever)
+ ######################################################################
+
+ DLL_SUFFIX = so.1.0
+ EMACS = /usr/bin/true
+ JAVA_PROG = $(JAVA_BIN)java
+ RANLIB = /usr/bin/ranlib
+
+ ######################################################################
+ # Other
+ ######################################################################
+
+ ifeq ($(USE_PTHREADS),1)
+ OS_LIBS = -lc_r
+ PORT_FLAGS +=
+ else
+ OS_LIBS = -lc
+ PORT_FLAGS += -D_PR_LOCAL_THREADS_ONLY
+ endif
+
+ BUILD_UNIX_PLUGINS = 1
+
+ MKSHLIB = $(LD) $(DSO_LDOPTS)
+
+ DSO_CFLAGS = -fpic
+ DSO_LDFLAGS =
+ DSO_LDOPTS = -Bshareable
*** /dev/null Fri Apr 3 18:26:14 1998
--- ns/nsprpub/config/NetBSD1.3E.mk Wed Apr 1 17:59:00 1998
***************
*** 0 ****
--- 1,50 ----
+ #
+ # The contents of this file are subject to the Netscape Public License
+ # Version 1.0 (the "NPL"); you may not use this file except in
+ # compliance with the NPL. You may obtain a copy of the NPL at
+ # http://www.mozilla.org/NPL/
+ #
+ # Software distributed under the NPL is distributed on an "AS IS" basis,
+ # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+ # for the specific language governing rights and limitations under the
+ # NPL.
+ #
+ # The Initial Developer of this code under the NPL is Netscape
+ # Communications Corporation. Portions created by Netscape are
+ # Copyright (C) 1998 Netscape Communications Corporation. All Rights
+ # Reserved.
+ #
+
+ #
+ # Config stuff for NetBSD1.3E
+ #
+
+ include $(MOD_DEPTH)/config/UNIX.mk
+
+ CC = gcc
+ CCC = g++
+ RANLIB = ranlib
+
+ OS_REL_CFLAGS = -mno-486 -Di386
+ CPU_ARCH = x86
+
+ OS_CFLAGS = $(DSO_CFLAGS) $(OS_REL_CFLAGS) -ansi -Wall -pipe -DNETBSD -DHAVE_STRERROR -DHAVE_BSD_FLOCK
+
+ ifeq ($(USE_PTHREADS),1)
+ OS_LIBS = -lc_r
+ # XXX probably should define _THREAD_SAFE too.
+ DEFINES +=
+ else
+ OS_LIBS = -lc
+ DEFINES += -D_PR_LOCAL_THREADS_ONLY
+ endif
+
+ ARCH = netbsd
+
+ DSO_CFLAGS = -fPIC
+ DSO_LDOPTS = -Bshareable
+ DSO_LDFLAGS =
+
+ MKSHLIB = $(LD) $(DSO_LDOPTS)
+
+ G++INCLUDES = -I/usr/include/g++
*** /dev/null Fri Apr 3 18:26:14 1998
--- ns/nsprpub/pr/include/md/_netbsd.cfg Wed Apr 1 17:53:33 1998
***************
*** 0 ****
--- 1,119 ----
+ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+ /*
+ * The contents of this file are subject to the Netscape Public License
+ * Version 1.0 (the "NPL"); you may not use this file except in
+ * compliance with the NPL. You may obtain a copy of the NPL at
+ * http://www.mozilla.org/NPL/
+ *
+ * Software distributed under the NPL is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+ * for the specific language governing rights and limitations under the
+ * NPL.
+ *
+ * The Initial Developer of this code under the NPL is Netscape
+ * Communications Corporation. Portions created by Netscape are
+ * Copyright (C) 1998 Netscape Communications Corporation. All Rights
+ * Reserved.
+ */
+
+ #ifndef nspr_cpucfg___
+ #define nspr_cpucfg___
+
+ #ifndef XP_UNIX
+ #define XP_UNIX
+ #endif
+
+ #ifndef NETBSD
+ #define NETBSD
+ #endif
+
+ #define IS_LITTLE_ENDIAN 1
+ #undef IS_BIG_ENDIAN
+ #define HAVE_LONG_LONG
+ #undef HAVE_ALIGNED_DOUBLES
+ #undef HAVE_ALIGNED_LONGLONGS
+
+ #define PR_BYTES_PER_BYTE 1
+ #define PR_BYTES_PER_SHORT 2
+ #define PR_BYTES_PER_INT 4
+ #define PR_BYTES_PER_INT64 8
+ #define PR_BYTES_PER_LONG 4
+ #define PR_BYTES_PER_FLOAT 4
+ #define PR_BYTES_PER_DOUBLE 8
+ #define PR_BYTES_PER_WORD 4
+ #define PR_BYTES_PER_DWORD 8
+ #define PR_BYTES_PER_WORD_LOG2 2
+ #define PR_BYTES_PER_DWORD_LOG2 3
+
+ #define PR_BITS_PER_BYTE 8
+ #define PR_BITS_PER_SHORT 16
+ #define PR_BITS_PER_INT 32
+ #define PR_BITS_PER_INT64 64
+ #define PR_BITS_PER_LONG 32
+ #define PR_BITS_PER_FLOAT 32
+ #define PR_BITS_PER_DOUBLE 64
+ #define PR_BITS_PER_WORD 32
+
+ #define PR_BITS_PER_BYTE_LOG2 3
+ #define PR_BITS_PER_SHORT_LOG2 4
+ #define PR_BITS_PER_INT_LOG2 5
+ #define PR_BITS_PER_INT64_LOG2 6
+ #define PR_BITS_PER_LONG_LOG2 5
+ #define PR_BITS_PER_FLOAT_LOG2 5
+ #define PR_BITS_PER_DOUBLE_LOG2 6
+ #define PR_BITS_PER_WORD_LOG2 5
+
+ #define PR_ALIGN_OF_SHORT 2
+ #define PR_ALIGN_OF_INT 4
+ #define PR_ALIGN_OF_LONG 4
+ #define PR_ALIGN_OF_INT64 4
+ #define PR_ALIGN_OF_FLOAT 4
+ #define PR_ALIGN_OF_DOUBLE 4
+ #define PR_ALIGN_OF_POINTER 4
+
+ #ifndef NO_NSPR_10_SUPPORT
+
+ #define BYTES_PER_BYTE PR_BYTES_PER_BYTE
+ #define BYTES_PER_SHORT PR_BYTES_PER_SHORT
+ #define BYTES_PER_INT PR_BYTES_PER_INT
+ #define BYTES_PER_INT64 PR_BYTES_PER_INT64
+ #define BYTES_PER_LONG PR_BYTES_PER_LONG
+ #define BYTES_PER_FLOAT PR_BYTES_PER_FLOAT
+ #define BYTES_PER_DOUBLE PR_BYTES_PER_DOUBLE
+ #define BYTES_PER_WORD PR_BYTES_PER_WORD
+ #define BYTES_PER_DWORD PR_BYTES_PER_DWORD
+
+ #define BITS_PER_BYTE PR_BITS_PER_BYTE
+ #define BITS_PER_SHORT PR_BITS_PER_SHORT
+ #define BITS_PER_INT PR_BITS_PER_INT
+ #define BITS_PER_INT64 PR_BITS_PER_INT64
+ #define BITS_PER_LONG PR_BITS_PER_LONG
+ #define BITS_PER_FLOAT PR_BITS_PER_FLOAT
+ #define BITS_PER_DOUBLE PR_BITS_PER_DOUBLE
+ #define BITS_PER_WORD PR_BITS_PER_WORD
+
+ #define BITS_PER_BYTE_LOG2 PR_BITS_PER_BYTE_LOG2
+ #define BITS_PER_SHORT_LOG2 PR_BITS_PER_SHORT_LOG2
+ #define BITS_PER_INT_LOG2 PR_BITS_PER_INT_LOG2
+ #define BITS_PER_INT64_LOG2 PR_BITS_PER_INT64_LOG2
+ #define BITS_PER_LONG_LOG2 PR_BITS_PER_LONG_LOG2
+ #define BITS_PER_FLOAT_LOG2 PR_BITS_PER_FLOAT_LOG2
+ #define BITS_PER_DOUBLE_LOG2 PR_BITS_PER_DOUBLE_LOG2
+ #define BITS_PER_WORD_LOG2 PR_BITS_PER_WORD_LOG2
+
+ #define ALIGN_OF_SHORT PR_ALIGN_OF_SHORT
+ #define ALIGN_OF_INT PR_ALIGN_OF_INT
+ #define ALIGN_OF_LONG PR_ALIGN_OF_LONG
+ #define ALIGN_OF_INT64 PR_ALIGN_OF_INT64
+ #define ALIGN_OF_FLOAT PR_ALIGN_OF_FLOAT
+ #define ALIGN_OF_DOUBLE PR_ALIGN_OF_DOUBLE
+ #define ALIGN_OF_POINTER PR_ALIGN_OF_POINTER
+ #define ALIGN_OF_WORD PR_ALIGN_OF_WORD
+
+ #define BYTES_PER_WORD_LOG2 PR_BYTES_PER_WORD_LOG2
+ #define BYTES_PER_DWORD_LOG2 PR_BYTES_PER_DWORD_LOG2
+ #define WORDS_PER_DWORD_LOG2 PR_WORDS_PER_DWORD_LOG2
+
+ #endif /* NO_NSPR_10_SUPPORT */
+
+ #endif /* nspr_cpucfg___ */
*** /dev/null Fri Apr 3 18:26:14 1998
--- ns/nsprpub/pr/include/md/_netbsd.h Wed Apr 1 18:27:03 1998
***************
*** 0 ****
--- 1,140 ----
+ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+ /*
+ * The contents of this file are subject to the Netscape Public License
+ * Version 1.0 (the "NPL"); you may not use this file except in
+ * compliance with the NPL. You may obtain a copy of the NPL at
+ * http://www.mozilla.org/NPL/
+ *
+ * Software distributed under the NPL is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+ * for the specific language governing rights and limitations under the
+ * NPL.
+ *
+ * The Initial Developer of this code under the NPL is Netscape
+ * Communications Corporation. Portions created by Netscape are
+ * Copyright (C) 1998 Netscape Communications Corporation. All Rights
+ * Reserved.
+ */
+
+ #ifndef nspr_netbsd_defs_h___
+ #define nspr_netbsd_defs_h___
+
+ #include <sys/syscall.h>
+
+ #define PR_LINKER_ARCH "netbsd"
+ #define _PR_SI_SYSNAME "NETBSD"
+ #define _PR_SI_ARCHITECTURE "x86"
+ #define PR_DLL_SUFFIX ".so.1.0"
+
+ #define _PR_VMBASE 0x30000000
+ #define _PR_STACK_VMBASE 0x50000000
+ #define _MD_DEFAULT_STACK_SIZE 65536L
+ #define _MD_MMAP_FLAGS MAP_PRIVATE
+
+ #undef HAVE_STACK_GROWING_UP
+ #define HAVE_DLL
+ #define USE_DLFCN
+
+ #define USE_SETJMP
+
+ #ifndef _PR_PTHREADS
+ #include <setjmp.h>
+
+ #define PR_CONTEXT_TYPE sigjmp_buf
+
+ #define CONTEXT(_th) ((_th)->md.context)
+
+ #define _MD_GET_SP(_th) (_th)->md.context[2]
+ #define PR_NUM_GCREGS _JBLEN
+
+ /*
+ ** Initialize a thread context to run "_main()" when started
+ */
+ #define _MD_INIT_CONTEXT(_thread, _sp, _main, status) \
+ { \
+ *status = PR_TRUE; \
+ if (sigsetjmp(CONTEXT(_thread), 1)) { \
+ _main(); \
+ } \
+ _MD_GET_SP(_thread) = (unsigned char*) ((_sp) - 64); \
+ }
+
+ #define _MD_SWITCH_CONTEXT(_thread) \
+ if (!sigsetjmp(CONTEXT(_thread), 1)) { \
+ (_thread)->md.errcode = errno; \
+ _PR_Schedule(); \
+ }
+
+ /*
+ ** Restore a thread context, saved by _MD_SWITCH_CONTEXT
+ */
+ #define _MD_RESTORE_CONTEXT(_thread) \
+ { \
+ errno = (_thread)->md.errcode; \
+ _MD_SET_CURRENT_THREAD(_thread); \
+ siglongjmp(CONTEXT(_thread), 1); \
+ }
+
+ /* Machine-dependent (MD) data structures */
+
+ struct _MDThread {
+ PR_CONTEXT_TYPE context;
+ int id;
+ int errcode;
+ };
+
+ struct _MDThreadStack {
+ PRInt8 notused;
+ };
+
+ struct _MDLock {
+ PRInt8 notused;
+ };
+
+ struct _MDSemaphore {
+ PRInt8 notused;
+ };
+
+ struct _MDCVar {
+ PRInt8 notused;
+ };
+
+ struct _MDSegment {
+ PRInt8 notused;
+ };
+
+ struct _MDCPU {
+ struct _MDCPU_Unix md_unix;
+ };
+
+ #define _MD_INIT_LOCKS()
+ #define _MD_NEW_LOCK(lock) PR_SUCCESS
+ #define _MD_FREE_LOCK(lock)
+ #define _MD_LOCK(lock)
+ #define _MD_UNLOCK(lock)
+ #define _MD_INIT_IO()
+ #define _MD_IOQ_LOCK()
+ #define _MD_IOQ_UNLOCK()
+
+ #define _MD_INIT_RUNNING_CPU(cpu) _MD_unix_init_running_cpu(cpu)
+ #define _MD_INIT_THREAD _MD_InitializeThread
+ #define _MD_EXIT_THREAD(thread)
+ #define _MD_SUSPEND_THREAD(thread) _MD_suspend_thread
+ #define _MD_RESUME_THREAD(thread) _MD_resume_thread
+ #define _MD_CLEAN_THREAD(_thread)
+
+ #endif /* ! _PR_PTHREADS */
+
+ #define _MD_EARLY_INIT _MD_EarlyInit
+ #define _MD_FINAL_INIT _PR_UnixInit
+ #define _MD_GET_INTERVAL _PR_UNIX_GetInterval
+ #define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond
+
+ /*
+ * We wrapped the select() call. _MD_SELECT refers to the built-in,
+ * unwrapped version.
+ */
+ #define _MD_SELECT(nfds,r,w,e,tv) syscall(SYS_select,nfds,r,w,e,tv)
+ #define _MD_POLL(fds,nfds,timeout) syscall(SYS_poll,fds,nfds,timeout)
+
+ #endif /* nspr_netbsd_defs_h___ */
*** /dev/null Fri Apr 3 18:26:14 1998
--- ns/nsprpub/pr/src/md/unix/netbsd.c Wed Apr 1 18:07:38 1998
***************
*** 0 ****
--- 1,100 ----
+ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+ /*
+ * The contents of this file are subject to the Netscape Public License
+ * Version 1.0 (the "NPL"); you may not use this file except in
+ * compliance with the NPL. You may obtain a copy of the NPL at
+ * http://www.mozilla.org/NPL/
+ *
+ * Software distributed under the NPL is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+ * for the specific language governing rights and limitations under the
+ * NPL.
+ *
+ * The Initial Developer of this code under the NPL is Netscape
+ * Communications Corporation. Portions created by Netscape are
+ * Copyright (C) 1998 Netscape Communications Corporation. All Rights
+ * Reserved.
+ */
+
+ #include "primpl.h"
+
+ #include <signal.h>
+
+ void _MD_EarlyInit(void)
+ {
+ /*
+ * Ignore FPE because coercion of a NaN to an int causes SIGFPE
+ * to be raised.
+ */
+ struct sigaction act;
+
+ act.sa_handler = SIG_IGN;
+ sigemptyset(&act.sa_mask);
+ act.sa_flags = SA_RESTART;
+ sigaction(SIGFPE, &act, 0);
+ }
+
+ PRWord *_MD_HomeGCRegisters(PRThread *t, int isCurrent, int *np)
+ {
+ #ifndef _PR_PTHREADS
+ if (isCurrent) {
+ (void) sigsetjmp(CONTEXT(t), 1);
+ }
+ *np = sizeof(CONTEXT(t)) / sizeof(PRWord);
+ return (PRWord *) CONTEXT(t);
+ #else
+ *np = 0;
+ return NULL;
+ #endif
+ }
+
+ #ifndef _PR_PTHREADS
+ void
+ _MD_SET_PRIORITY(_MDThread *thread, PRUintn newPri)
+ {
+ return;
+ }
+
+ PRStatus
+ _MD_InitializeThread(PRThread *thread)
+ {
+ return PR_SUCCESS;
+ }
+
+ PRStatus
+ _MD_WAIT(PRThread *thread, PRIntervalTime ticks)
+ {
+ PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE));
+ _PR_MD_SWITCH_CONTEXT(thread);
+ return PR_SUCCESS;
+ }
+
+ PRStatus
+ _MD_WAKEUP_WAITER(PRThread *thread)
+ {
+ if (thread) {
+ PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE));
+ }
+ return PR_SUCCESS;
+ }
+
+ /* These functions should not be called for NetBSD */
+ void
+ _MD_YIELD(void)
+ {
+ PR_NOT_REACHED("_MD_YIELD should not be called for NetBSD.");
+ }
+
+ PRStatus
+ _MD_CREATE_THREAD(
+ PRThread *thread,
+ void (*start) (void *),
+ PRThreadPriority priority,
+ PRThreadScope scope,
+ PRThreadState state,
+ PRUint32 stackSize)
+ {
+ PR_NOT_REACHED("_MD_CREATE_THREAD should not be called for NetBSD.");
+ return PR_FAILURE;
+ }
+ #endif /* ! _PR_PTHREADS */