*** ./build/minclude/sun_security_x509.jmk.orig Fri Feb 7 19:57:08 1997
--- ./build/minclude/sun_security_x509.jmk Thu Aug 7 17:13:39 1997
***************
*** 2,8 ****
TOPDIR = ../../../../..
PACKAGE = sun.security.x509
! PLATFORM = solaris
PRODUCT = sun
#
--- 2,8 ----
TOPDIR = ../../../../..
PACKAGE = sun.security.x509
! PLATFORM = sunos
PRODUCT = sun
#
*** ./build/minclude/sunw.jmk.orig Fri Feb 7 19:57:06 1997
--- ./build/minclude/sunw.jmk Thu Aug 7 17:13:39 1997
***************
*** 2,8 ****
TOPDIR = ../../..
PACKAGE = sunw
! PLATFORM = solaris
PRODUCT = sun
#
--- 2,8 ----
TOPDIR = ../../..
PACKAGE = sunw
! PLATFORM = sunos
PRODUCT = sun
#
*** ./build/sunos/makefiles/Library.gmk.orig Fri Feb 7 19:56:04 1997
--- ./build/sunos/makefiles/Library.gmk Thu Aug 7 17:13:40 1997
***************
*** 19,24 ****
--- 19,28 ----
# in order to override the values defined inthat makefile.
#
LIB_LOCATION = $(LIBDIR)/$(ARCH)/$(TSOBJDIR)
+ ifeq ($(LIBRARY), java)
+ LIBRARY_SUFFIX=a
+ RANLIB=ranlib
+ endif
DEBUG = $(LIB_LOCATION)/lib$(LIBRARY)_g.$(LIBRARY_SUFFIX)
OPTIMIZED = $(LIB_LOCATION)/lib$(LIBRARY).$(LIBRARY_SUFFIX)
***************
*** 26,41 ****
FILES.o = $(patsubst %.c,$(OBJDIR)/%.o,$(FILES.c))
FILES.o += $(patsubst %.s,$(OBJDIR)/%.o,$(FILES.s))
$(DEBUG): $(INIT) $(OBJDIR)/.library.dirs.$(ARCH) classes \
.library.headers $(FILES.o)
@echo $(DEBUG)
@echo "OBJDIR=$(OBJDIR)"
! $(LD) -G -o $@ $(FILES.o) $(LDFLAGS) $(LDLIBS)
$(OPTIMIZED): $(INIT) $(OBJDIR)/.library.dirs.$(ARCH) classes \
.library.headers $(FILES.o)
@echo $(OPTIMIZED)
! $(LD) -G -o $@ $(FILES.o) $(LDFLAGS) $(LDLIBS)
ifneq ($(PRODUCT), java)
vpath %.c $(TOPDIR)/src/share/$(PKG)
--- 30,54 ----
FILES.o = $(patsubst %.c,$(OBJDIR)/%.o,$(FILES.c))
FILES.o += $(patsubst %.s,$(OBJDIR)/%.o,$(FILES.s))
+ ifneq ($(LIBRARY), java)
$(DEBUG): $(INIT) $(OBJDIR)/.library.dirs.$(ARCH) classes \
.library.headers $(FILES.o)
@echo $(DEBUG)
@echo "OBJDIR=$(OBJDIR)"
! ifeq ($(STRIP), true)
! $(LD) -x -o $@ $(FILES.o) $(LDFLAGS) $(LDLIBS)
! else
! $(LD) -o $@ $(FILES.o) $(LDFLAGS) $(LDLIBS)
! endif
$(OPTIMIZED): $(INIT) $(OBJDIR)/.library.dirs.$(ARCH) classes \
.library.headers $(FILES.o)
@echo $(OPTIMIZED)
! ifeq ($(STRIP), true)
! $(LD) -x -o $@ $(FILES.o) $(LDFLAGS) $(LDLIBS)
! else
! $(LD) -o $@ $(FILES.o) $(LDFLAGS) $(LDLIBS)
! endif
ifneq ($(PRODUCT), java)
vpath %.c $(TOPDIR)/src/share/$(PKG)
***************
*** 47,52 ****
--- 60,96 ----
-I$(TOPDIR)/src/$(PLATFORM)/$(PKG) \
-I$(JAVAHOME)/include \
-I$(JAVAHOME)/include/$(PLATFORM)
+ endif
+ CFLAGS += -fPIC
+ else
+ $(DEBUG): $(INIT) $(OBJDIR)/.library.dirs.$(ARCH) classes \
+ .library.headers $(FILES.o)
+ echo LDLIBS is $(LDLIBS)
+ @echo $(DEBUG)
+ @echo "OBJDIR=$(OBJDIR)"
+ rm -f $@
+ $(AR) rcv $@ $(FILES.o)
+ $(RANLIB) $@
+
+ $(OPTIMIZED): $(INIT) $(OBJDIR)/.library.dirs.$(ARCH) classes \
+ .library.headers $(FILES.o)
+ echo LDLIBS is $(LDLIBS)
+ @echo $(OPTIMIZED)
+ rm -f $@
+ $(AR) rcv $@ $(FILES.o)
+ $(RANLIB) $@
+
+ ifneq ($(PRODUCT), java)
+ vpath %.c $(TOPDIR)/src/share/$(PKG)
+ vpath %.c $(TOPDIR)/src/share/$(LIBRARY)
+ vpath %.c $(TOPDIR)/src/$(PLATFORM)/$(PKG)
+ vpath %.c $(TOPDIR)/src/$(PLATFORM)/$(LIBRARY)
+
+ CPPFLAGS += -I$(TOPDIR)/src/share/$(PKG) \
+ -I$(TOPDIR)/src/$(PLATFORM)/$(PKG) \
+ -I$(JAVAHOME)/include \
+ -I$(JAVAHOME)/include/$(PLATFORM)
+ endif
endif
CLASSES.export = $(shell echo $(FILES.export) $(FILES.export2) | \
*** ./build/sunos/makefiles/Rules.gmk.orig Fri Feb 7 19:56:04 1997
--- ./build/sunos/makefiles/Rules.gmk Thu Aug 7 17:13:40 1997
***************
*** 44,51 ****
--- 44,53 ----
$(OBJDIR)/%.o: %.c
ifdef VARIANT
$(COMPILE.c) -o $@ $<
+ ifneq ($(CC_VERSION), gcc)
@$(CC) -xM1 $(CPPFLAGS) $< 2> /dev/null | \
sed 's!$*\.o!$(dir $@)&!g' | sort | uniq > $(@:.o=.d)
+ endif
else
$(MAKE) $@ VARIANT=OPT
endif
***************
*** 53,60 ****
--- 55,70 ----
$(OBJDIR_NAME)$(DBG_SUFFIX)/$(ARCH)/$(TSOBJDIR)/%.o: %.c
ifdef VARIANT
$(COMPILE.c) -o $@ $<
+ ifeq ($(STRIP), true)
+ ifeq ($(LIBRARY), java)
+ $(LD) -r -x -o $@.new $@
+ mv $@.new $@
+ endif
+ endif
+ ifneq ($(CC_VERSION), gcc)
@$(CC) -xM1 $(CPPFLAGS) $< 2> /dev/null | \
sed 's!$*\.o!$(dir $@)&!g' | sort | uniq > $(@:.o=.d)
+ endif
else
$(MAKE) $@ VARIANT=DBG
endif
*** ./build/sunos/java/javah/GNUmakefile.orig Fri Feb 7 19:56:06 1997
--- ./build/sunos/java/javah/GNUmakefile Thu Aug 7 17:13:40 1997
***************
*** 1,7 ****
# @(#)GNUmakefile 1.10 95/10/19
PROGRAM = javah
! PLATFORM = solaris
PRODUCT = java
TOPDIR=../../../..
--- 1,7 ----
# @(#)GNUmakefile 1.10 95/10/19
PROGRAM = javah
! PLATFORM = sunos
PRODUCT = java
TOPDIR=../../../..
*** ./build/sunos/java/javap/GNUmakefile.orig Fri Feb 7 19:56:06 1997
--- ./build/sunos/java/javap/GNUmakefile Thu Aug 7 17:13:41 1997
***************
*** 1,7 ****
# @(#)GNUmakefile 1.10 97/01/24
PROGRAM = javap
! PLATFORM = solaris
PRODUCT = java
TOPDIR = ../../../..
--- 1,7 ----
# @(#)GNUmakefile 1.10 97/01/24
PROGRAM = javap
! PLATFORM = sunos
PRODUCT = java
TOPDIR = ../../../..
*** ./build/sunos/java/java/GNUmakefile.orig Fri Feb 7 19:56:06 1997
--- ./build/sunos/java/java/GNUmakefile Thu Aug 7 17:13:41 1997
***************
*** 5,11 ****
#
LIBRARY = java
! PLATFORM = solaris
PRODUCT = java
#
--- 5,11 ----
#
LIBRARY = java
! PLATFORM = sunos
PRODUCT = java
#
***************
*** 12,19 ****
# Directories
#
TOPDIR = ../../../..
! # We need ARCH *before* we do the include that gets us Defs-solaris.gmk
! ARCH = $(shell uname -p)
include $(TOPDIR)/build/$(PLATFORM)/makefiles/Defs.gmk
#
--- 12,19 ----
# Directories
#
TOPDIR = ../../../..
! # We need ARCH *before* we do the include that gets us Defs-sunos.gmk
! ARCH = `uname -p 2>/dev/null || arch`
include $(TOPDIR)/build/$(PLATFORM)/makefiles/Defs.gmk
#
***************
*** 34,41 ****
properties_md.c \
system_md.c
! ifeq ($(ARCH),sparc)
FILES.s += machgc_sparc.s
FILES.s += invokeNative_sparc.s
ifeq ($(VARIANT),OPT)
FILES.s += executeJava_sparc.s
--- 34,42 ----
properties_md.c \
system_md.c
! ifeq ($(ARCH),sun4)
FILES.s += machgc_sparc.s
+ # FILES.c += machgc_nonsparc.c
FILES.s += invokeNative_sparc.s
ifeq ($(VARIANT),OPT)
FILES.s += executeJava_sparc.s
***************
*** 97,108 ****
process_md.c
! ifeq ($(ARCH),sparc)
EXTRAFILES-green =
else
EXTRAFILES-green = edi.s
endif
! EXTRAFILES-native = solaris_regs.s
FILES.s += $(EXTRAFILES-$(THREADS_FLAG))
THREADFILES= $(THREADFILES-$(THREADS_FLAG))
--- 98,109 ----
process_md.c
! ifeq ($(ARCH),sun4)
EXTRAFILES-green =
else
EXTRAFILES-green = edi.s
endif
! EXTRAFILES-native = sunos_regs.s
FILES.s += $(EXTRAFILES-$(THREADS_FLAG))
THREADFILES= $(THREADFILES-$(THREADS_FLAG))
***************
*** 166,173 ****
sun/tools/debug
PKGPATH = $(PLATFORM_SRC)/java $(SHARE_SRC)/java
! LDLIBS += -lX11 -lsocket -lnsl -lresolv
#
# Now that the body of the runtime is in a shared object, it is built
--- 167,180 ----
sun/tools/debug
PKGPATH = $(PLATFORM_SRC)/java $(SHARE_SRC)/java
+ #
+ #LDLIBS += -lnsl -lresolv
! ifeq ($(USE_MOTIF),-DUSE_MOTIF)
! #LDLIBS += -L/usr/lib/X11 -lXm -lXt -lXext -lX11
! else
! #LDLIBS += -L/usr/X11R5/lib -lX11
! endif
#
# Now that the body of the runtime is in a shared object, it is built
***************
*** 219,236 ****
@echo $? >>.classes.list
# Rules for building SPARC-specific executeJava.
! obj/sparc/$(TSOBJDIR)/executeJava_sparc.o: $(PLATFORM_SRC)/java/runtime/executeJava_sparc.s ExecuteJavaPadding.include ExecuteJavaStructOffsets.include opcodes.wide
! as -m -o obj/$(ARCH)/$(TSOBJDIR)/executeJava_sparc.o $(PLATFORM_SRC)/java/runtime/executeJava_sparc.s
nawk -f check_offsets.nawk < $(SHARE_SRC)/java/include/opcodes.list | adb obj/$(ARCH)/$(TSOBJDIR)/executeJava_sparc.o -
! obj_g/sparc/$(TSOBJDIR)/executeJava_sparc.o: $(PLATFORM_SRC)/java/runtime/executeJava_sparc.s ExecuteJavaPadding.include ExecuteJavaStructOffsets.include
! as -m -o obj_g/$(ARCH)/$(TSOBJDIR)/executeJava_sparc.o $(PLATFORM_SRC)/java/runtime/executeJava_sparc.s
nawk -f check_offsets.nawk < $(SHARE_SRC)/java/include/opcodes.list | adb obj_g/$(ARCH)/$(TSOBJDIR)/executeJava_sparc.o -
ExecuteJavaPadding.include: $(PLATFORM_SRC)/java/runtime/executeJava_sparc.s ExecuteJavaStructOffsets.include opcodes.wide
! m4 -DEXTRACT_TABLE_PADDING $(PLATFORM_SRC)/java/runtime/executeJava_sparc.s > executeJava_sparc_no_padding.s
! as executeJava_sparc_no_padding.s
! nm -h executeJava_sparc_no_padding.o | egrep "pad[0-9]+" | sort "-t|" +7.3n | nawk -F "|" '/./{print "define( " $$8 ", " $$2")"}' > ExecuteJavaPadding.include
ExecuteJavaStructOffsets.include: $(OBJDIR)/make_struct_offsets.o
$(CC) $(CFLAGS_COMMON) -o make_struct_offsets $(OBJDIR)/make_struct_offsets.o
--- 226,243 ----
@echo $? >>.classes.list
# Rules for building SPARC-specific executeJava.
! obj/sun4/$(TSOBJDIR)/executeJava_sparc.o: $(PLATFORM_SRC)/java/runtime/executeJava_sparc.s ExecuteJavaPadding.include ExecuteJavaStructOffsets.include opcodes.wide
! /usr/5bin/m4 $(PLATFORM_SRC)/java/runtime/executeJava_sparc.s | sed -e 's/align 128/align 8/' -e 's/\.section/.text !&/' -e 's/align 16/align 8/' -e 's/\.size/!&/' -e 's/\.type/!&/' | as -o obj/$(ARCH)/$(TSOBJDIR)/executeJava_sparc.o -
nawk -f check_offsets.nawk < $(SHARE_SRC)/java/include/opcodes.list | adb obj/$(ARCH)/$(TSOBJDIR)/executeJava_sparc.o -
! obj_g/sun4/$(TSOBJDIR)/executeJava_sparc.o: $(PLATFORM_SRC)/java/runtime/executeJava_sparc.s ExecuteJavaPadding.include ExecuteJavaStructOffsets.include
! /usr/5bin/m4 $(PLATFORM_SRC)/java/runtime/executeJava_sparc.s | sed -e 's/align 128/align 8/' -e 's/\.section/.text !&/' -e 's/align 16/align 8/' -e 's/\.size/!&/' -e 's/\.type/!&/' | as -o obj_g/$(ARCH)/$(TSOBJDIR)/executeJava_sparc.o -
nawk -f check_offsets.nawk < $(SHARE_SRC)/java/include/opcodes.list | adb obj_g/$(ARCH)/$(TSOBJDIR)/executeJava_sparc.o -
ExecuteJavaPadding.include: $(PLATFORM_SRC)/java/runtime/executeJava_sparc.s ExecuteJavaStructOffsets.include opcodes.wide
! /usr/5bin/m4 -DEXTRACT_TABLE_PADDING $(PLATFORM_SRC)/java/runtime/executeJava_sparc.s > executeJava_sparc_no_padding.s
! sed -e 's/align 128/align 8/' -e 's/\.section/.text !&/' -e 's/align 16/align 8/' -e 's/\.size/!&/' -e 's/\.type/!&/' executeJava_sparc_no_padding.s | as -o executeJava_sparc_no_padding.o -
! nm executeJava_sparc_no_padding.o | egrep "pad[0-9]+" | sort +2.3n | perl -ne 'chop; split; $$_[0] = oct("0x$$_[0]"); print "define($$_[2],$$_[0])\n";' > ExecuteJavaPadding.include
ExecuteJavaStructOffsets.include: $(OBJDIR)/make_struct_offsets.o
$(CC) $(CFLAGS_COMMON) -o make_struct_offsets $(OBJDIR)/make_struct_offsets.o
***************
*** 239,245 ****
make_struct_offsets.c: $(PLATFORM_SRC)/java/runtime/executeJava_sparc.s
make_struct_offsets.c: extract_offsets.nawk opcodes.wide
! m4 -DEXTRACT_OFFSETS $(PLATFORM_SRC)/java/runtime/executeJava_sparc.s | sort -u | nawk -f extract_offsets.nawk > make_struct_offsets.c
opcodes.wide: $(SHARE_SRC)/java/include/opcodes.list
@echo "Creating $@ ... "
--- 246,252 ----
make_struct_offsets.c: $(PLATFORM_SRC)/java/runtime/executeJava_sparc.s
make_struct_offsets.c: extract_offsets.nawk opcodes.wide
! /usr/5bin/m4 -DEXTRACT_OFFSETS $(PLATFORM_SRC)/java/runtime/executeJava_sparc.s | sort -u | nawk -f extract_offsets.nawk > make_struct_offsets.c
opcodes.wide: $(SHARE_SRC)/java/include/opcodes.list
@echo "Creating $@ ... "
***************
*** 267,274 ****
rm -f fjtables.inc
rm -f executeJava_p5.asm
includes_p5 .
! m4 -DSOLARIS -DCPU=5 $(SHARE_SRC)/java/runtime/executeJava_p5.m4 > executeJava_p5.asm
! m4 -DSOLARIS -DCPU=6 $(SHARE_SRC)/java/runtime/executeJava_p5.m4 >> executeJava_p5.asm
chmod a=rx executeJava_p5.asm
chmod a=rx fjconst.inc
chmod a=rx fjtables.inc
--- 274,281 ----
rm -f fjtables.inc
rm -f executeJava_p5.asm
includes_p5 .
! /usr/5bin/m4 -DSOLARIS -DCPU=5 $(SHARE_SRC)/java/runtime/executeJava_p5.m4 > executeJava_p5.asm
! /usr/5bin/m4 -DSOLARIS -DCPU=6 $(SHARE_SRC)/java/runtime/executeJava_p5.m4 >> executeJava_p5.asm
chmod a=rx executeJava_p5.asm
chmod a=rx fjconst.inc
chmod a=rx fjtables.inc
*** ./build/sunos/java/java/check_offsets.nawk.orig Fri Feb 7 19:56:06 1997
--- ./build/sunos/java/java/check_offsets.nawk Thu Aug 7 17:13:42 1997
***************
*** 30,38 ****
BEGIN{ i = 0 }
/^[a-z]/{
print "0>a"
! print $1 "\\.0>a"
print "a"
! print "_" $1 "_0>a"
print "/dev/null 2>&1
J_HOME=`dirname $PRG`/..
if [ -z "$JAVA_HOME" ] ; then
--- 1,11 ----
! #!/bin/sh
#
# @(#)java_wrapper.sh 1.22 97/01/06
#
# Set up default variable values if not supplied by the user.
! PRG=`echo $0` >/dev/null 2>&1
J_HOME=`dirname $PRG`/..
if [ -z "$JAVA_HOME" ] ; then
***************
*** 16,21 ****
--- 13,30 ----
JAVA_HOME=$J_HOME
fi
+ # needed if you use the LessTif and X11R5 kit
+ if [ -d $JAVA_HOME/lib/nls -a -r $JAVA_HOME/lib/XKeysymDB ]; then
+ XNLSPATH=$JAVA_HOME/lib/nls
+ XKEYSYMDB=$JAVA_HOME/lib/XKeysymDB
+ export XNLSPATH XKEYSYMDB
+ fi
+
+ if [ -z "$LIBCPATH" ] ; then
+ LIBCPATH=`ls /usr/lib/libc.so.*[0-9] | tail -1`
+ export LIBCPATH
+ fi
+
CLASSPATH="${CLASSPATH-.}"
if [ -z "${CLASSPATH}" ] ; then
CLASSPATH="$JAVA_HOME/classes:$JAVA_HOME/lib/classes.zip"
***************
*** 33,39 ****
# seem all that bad.
THREADS_TYPE=green_threads
! if [[ $THREADS_FLAG = native ]] ;\
then THREADS_TYPE=native_threads;\
fi
export THREADS_TYPE
--- 42,48 ----
# seem all that bad.
THREADS_TYPE=green_threads
! if [ "$THREADS_FLAG" = "native" ] ;\
then THREADS_TYPE=native_threads;\
fi
export THREADS_TYPE
***************
*** 40,49 ****
#echo "Using executables built for $THREADS_TYPE"
export LD_LIBRARY_PATH
! LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$JAVA_HOME/lib/`uname -p`/$THREADS_TYPE"
progname=`basename $0`
! prog=$JAVA_HOME/bin/`uname -p`/${THREADS_TYPE}/${progname}
if [ -f $prog ]
then
--- 49,58 ----
#echo "Using executables built for $THREADS_TYPE"
export LD_LIBRARY_PATH
! LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$JAVA_HOME/lib/`uname -p 2>/dev/null || arch 2>/dev/null || uname -m`/$THREADS_TYPE"
progname=`basename $0`
! prog=$JAVA_HOME/bin/`uname -p 2>/dev/null || arch 2>/dev/null || uname -m`/${THREADS_TYPE}/${progname}
if [ -f $prog ]
then
*** ./src/sunos/bin/java_wrapper_local.sh.orig Fri Feb 7 20:05:50 1997
--- ./src/sunos/bin/java_wrapper_local.sh Thu Aug 7 17:13:58 1997
***************
*** 1,4 ****
! #! /bin/ksh
#
# @(#)java_wrapper_local.sh 1.3 97/01/06
#
--- 1,4 ----
! #!/bin/sh
#
# @(#)java_wrapper_local.sh 1.3 97/01/06
#
***************
*** 12,22 ****
# scripts which use the same name. See java_wrapper.sh for similar comments.
TSOBJDIR=green_threads
! if [[ $THREADS_FLAG = native ]] ;\
then TSOBJDIR=native_threads;\
fi
export TSOBJDIR
# Default OBJDIR_NAME is "obj".
# This also introduces a dependency of this wrapper on the policy used to do
# builds. In this case, the knowledge of the name "obj" used by the build
--- 12,27 ----
# scripts which use the same name. See java_wrapper.sh for similar comments.
TSOBJDIR=green_threads
! if [ "$THREADS_FLAG" = "native" ] ;\
then TSOBJDIR=native_threads;\
fi
export TSOBJDIR
+ if [ -z "$LIBCPATH" ] ; then
+ LIBCPATH=`ls /usr/lib/libc.so.*[0-9] | tail -1`
+ export LIBCPATH
+ fi
+
# Default OBJDIR_NAME is "obj".
# This also introduces a dependency of this wrapper on the policy used to do
# builds. In this case, the knowledge of the name "obj" used by the build
***************
*** 25,36 ****
OBJDIR_NAME=obj
export OBJDIR_NAME
progname=`basename $0`
! tprogname=${progname%_g}
! if [[ $progname != $tprogname ]] ;\
then OBJDIR_NAME="$OBJDIR_NAME"_g;\
fi
! prog=${OBJDIR_NAME}/`uname -p`/${TSOBJDIR}/${progname}
if [ -f $prog ]
then
--- 30,41 ----
OBJDIR_NAME=obj
export OBJDIR_NAME
progname=`basename $0`
! tprogname=`echo $progname | sed -e 's/_g$//'`_g
! if [ "$progname" = "$tprogname" ] ;\
then OBJDIR_NAME="$OBJDIR_NAME"_g;\
fi
! prog=${OBJDIR_NAME}/`uname -p 2>/dev/null || arch 2>/dev/null || uname -m`/${TSOBJDIR}/${progname}
if [ -f $prog ]
then
*** ./src/sunos/java/include/byteorder_md.h.orig Fri Feb 7 20:05:56 1997
--- ./src/sunos/java/include/byteorder_md.h Thu Aug 7 17:13:58 1997
***************
*** 27,32 ****
--- 27,34 ----
#ifndef _SOLARIS_BYTE_MD_H_
#define _SOLARIS_BYTE_MD_H_
+ #ifndef SUNOS4
#include
+ #endif
#endif /* !_SOLARIS_BYTE_MD_H_ */
*** ./src/sunos/java/include/typedefs_md.h.orig Fri Feb 7 20:05:56 1997
--- ./src/sunos/java/include/typedefs_md.h Thu Aug 7 17:13:59 1997
***************
*** 40,46 ****
--- 40,49 ----
typedef unsigned long long uint64_t;
#define _UINT32_T
typedef unsigned long uint32_t;
+ #ifdef SUNOS4
+ typedef unsigned int uint_t;
#endif
+ #endif
#ifndef _INT64_T
#define _INT64_T
***************
*** 47,54 ****
--- 50,64 ----
typedef long long int64_t;
#define _INT32_T
typedef long int32_t;
+ #ifdef SUNOS4
+ typedef long int_t;
#endif
+ #endif
+ #ifdef SUNOS4
+ typedef int ssize_t;
+ #endif
+
#endif /* !defined(_ILP32) && !defined(_LP64) */
/* use these macros when the compiler supports the long long type */
***************
*** 74,80 ****
--- 84,94 ----
#define INT_OP(x,op,y) ((x) op (y))
#define NAN_CHECK(l,r,x) x
+ #ifdef SUNOS4
+ #define IS_NAN(x) isnan(x)
+ #else
#define IS_NAN(x) isnand(x)
+ #endif
#define float2l(f) (f)
#define double2l(f) (f)
*** ./src/sunos/java/include/jmath_md.h.orig Fri Feb 7 20:05:56 1997
--- ./src/sunos/java/include/jmath_md.h Thu Aug 7 17:13:59 1997
***************
*** 1,3 ****
--- 1,4 ----
+
/*
* @(#)jmath_md.h 1.5 96/11/23
*
***************
*** 20,26 ****
--- 21,29 ----
*
*/
+ #ifndef SUNOS4
#include
+ #endif
#define DREM(a,b) fmod(a,b)
#define IEEEREM(a,b) remainder(a,b)
*** ./src/sunos/java/include/timeval_md.h.orig Fri Feb 7 20:05:56 1997
--- ./src/sunos/java/include/timeval_md.h Thu Aug 7 17:13:59 1997
***************
*** 22,27 ****
--- 22,30 ----
#ifndef _SOLARIS_TIMEVAL_H_
#define _SOLARIS_TIMEVAL_H_
+ #ifdef SUNOS4
+ #include
+ #endif
typedef struct {
long tv_sec; /* seconds */
*** ./src/sunos/java/runtime/linker_md.c.orig Fri Feb 7 20:05:58 1997
--- ./src/sunos/java/runtime/linker_md.c Thu Aug 7 17:13:59 1997
***************
*** 37,42 ****
--- 37,43 ----
static int linkerinitialized = 0;
static int useddlsegments = 0;
static int sizedlsegments = 0;
+ static char *wrap_dlopen(char *, int);
void out_of_memory(void);
int jio_snprintf(char *str, size_t count, const char *fmt, ...);
***************
*** 90,95 ****
--- 91,109 ----
{
char *ldpath = "";
+ #ifdef SUNOS4
+ #undef SUNOS4
+ #endif
+
+ #ifdef SUNOS4
+ if(!(ldpath = getenv("LD_LIBRARY_PATH"))) {
+ if(!ldpath) ldpath = "";
+ }
+ if((ldpath = strdup(ldpath)) == 0) {
+ out_of_memory();
+ }
+ #endif
+ #define SUNOS4
if (linkerinitialized) {
return(ldpath);
}
***************
*** 163,169 ****
}
}
! if ((dlsegment[useddlsegments].handle = dlopen(fn, 1)) == 0) {
char *err = (char *) dlerror();
if (err) {
jio_fprintf(stderr, "%s (%s)\n", err, fn);
--- 177,183 ----
}
}
! if ((dlsegment[useddlsegments].handle = wrap_dlopen(fn, 1)) == 0) {
char *err = (char *) dlerror();
if (err) {
jio_fprintf(stderr, "%s (%s)\n", err, fn);
***************
*** 195,207 ****
--- 209,265 ----
(void)sysInitializeLinker();
}
+ #ifndef SUNOS4
if ((f = dlsym(RTLD_NEXT, sym_p)) == 0) {
+ #endif
for (i = useddlsegments; --i >= 0;) {
if ((f = dlsym(dlsegment[i].handle, sym_p))) {
return((long)f);
}
}
+ #ifndef SUNOS4
}
+ #endif
return 0;
}
+ static char *
+ wrap_dlopen(char *fn, int mode)
+ {
+ char *ldpath = getenv("LD_LIBRARY_PATH");
+ char *dir;
+ char *handle;
+ char *curend;
+ char path[512];
+ char file[512];
+
+ if (ldpath == NULL) {
+ ldpath = "";
+ }
+ path[0] = '\0'; strncat(path, ldpath, sizeof(path)-1);
+ #if 0
+ jio_fprintf(stderr, "Trying to dlopen(\"%s\", %d) on \"%s\"\n", fn, mode, path);
+ #endif
+ curend = path;
+ do {
+ dir = curend;
+ if ((curend = index(dir, ':')) != NULL) {
+ *curend++ = '\0';
+ }
+ else {
+ curend = dir + strlen(dir);
+ }
+
+ file[0] = '\0';
+ strncat(file, *dir ? dir : ".", sizeof(file)-1);
+ strncat(file, "/", sizeof(file)-1-strlen(file)-1);
+ strncat(file, fn, sizeof(file)-1-strlen(file)-strlen(fn));
+ #if 0
+ jio_fprintf(stderr, " Check file: %s\n", file);
+ #endif
+ if (handle=dlopen(file, mode)) {
+ break;
+ }
+ } while (*curend);
+ return handle;
+ }
*** ./src/sunos/java/runtime/system_md.c.orig Fri Feb 7 20:05:58 1997
--- ./src/sunos/java/runtime/system_md.c Thu Aug 7 17:14:00 1997
***************
*** 23,28 ****
--- 23,31 ----
#include
#include
#include
+ #ifdef SUNOS4
+ #include
+ #endif
#include
#include "timeval.h"
***************
*** 31,37 ****
--- 34,42 ----
#include "jni.h"
/* Not in sys/time.h, for some reason */
+ #ifndef SUNOS4
int gettimeofday(struct timeval *, void *);
+ #endif
long
sysGetMilliTicks()
***************
*** 72,84 ****
--- 77,103 ----
struct tm *
sysLocaltime(time_t *t, struct tm *tm)
{
+ #ifdef SUNOS4
+ struct tm *ptm;
+ ptm = localtime(t);
+ *tm = *ptm;
+ return tm;
+ #else
return localtime_r(t, tm);
+ #endif
}
struct tm *
sysGmtime(time_t *t, struct tm *tm)
{
+ #ifdef SUNOS4
+ struct tm *ptm;
+ ptm = gmtime(t);
+ *tm = *ptm;
+ return tm;
+ #else
return gmtime_r(t, tm);
+ #endif
}
void
***************
*** 89,95 ****
--- 108,118 ----
time_t sysMktime(struct tm *t)
{
+ #ifdef SUNOS4
+ return timelocal(t);
+ #else
return mktime(t);
+ #endif
}
/*
***************
*** 211,214 ****
--- 234,243 ----
abort_procs = pAbort;
return 0;
}
+
+ #ifdef SUNOS4
+ void memmove(void *dest, const void *src, size_t len) {
+ bcopy(src, dest, len);
+ }
+ #endif
*** ./src/sunos/java/runtime/memory_md.c.orig Fri Feb 7 20:06:00 1997
--- ./src/sunos/java/runtime/memory_md.c Thu Aug 7 17:14:00 1997
***************
*** 58,63 ****
--- 58,70 ----
#endif /* !USE_MALLOC */
+ #ifdef SUNOS4
+ #include
+ #ifndef MAP_FAILED
+ #define MAP_FAILED ((caddr_t)-1)
+ #endif
+ #endif
+
static unsigned int memGrainSize; /* A page for Solaris */
/*
***************
*** 93,99 ****
* Set system-specific variables used by mem allocator
*/
if (memGrainSize == 0) {
! memGrainSize = sysconf(_SC_PAGESIZE);
}
#ifndef USE_MALLOC
--- 100,114 ----
* Set system-specific variables used by mem allocator
*/
if (memGrainSize == 0) {
! #ifdef SUNOS4
! #ifdef sun3
! memGrainSize = PAGESIZE;
! #else
! memGrainSize = getpagesize();
! #endif
! #else
! memGrainSize = sysconf(_SC_PAGESIZE);
! #endif
}
#ifndef USE_MALLOC
*** ./src/sunos/java/runtime/properties_md.c.orig Fri Feb 7 20:05:58 1997
--- ./src/sunos/java/runtime/properties_md.c Thu Aug 7 17:14:00 1997
***************
*** 26,32 ****
--- 26,34 ----
#include
#include
#include
+ #ifndef SUNOS4
#include
+ #endif
#include "timeval.h"
#include "sys_api.h"
***************
*** 78,83 ****
--- 80,94 ----
PUTPROP(props, "java.class.path", v ? v : "");
/* os properties */
+ #ifdef SUNOS4
+ PUTPROP(props, "os.name", "SunOS");
+ PUTPROP(props, "os.version", "4.1.x");
+ #ifdef sun3
+ PUTPROP(props, "os.arch", "sun3");
+ #else
+ PUTPROP(props, "os.arch", "sparc");
+ #endif
+ #else
PUTPROP(props, "os.name", "Solaris");
PUTPROP(props, "os.version", "2.x");
***************
*** 93,98 ****
--- 104,110 ----
} else {
PUTPROP(props, "os.arch", "Unknown");
}
+ #endif
/* file system properties */
***************
*** 190,196 ****
--- 202,217 ----
time_t clock = time(NULL);
tzset();
tmData = localtime(&clock);
+ #ifdef SUNOS4
+ /* convert "xDT" to "xST" */
+ if (tmData->tm_zone[1] == 'D' && tmData->tm_zone[2] == 'T') {
+ tmData->tm_zone[1] = 'S';
+ }
+ PUTPROP(props, "user.timezone", tmData->tm_zone);
+ #else
PUTPROP(props, "user.timezone", tzname[0]);
+ #endif
+
}
getcwd(buf, sizeof(buf));
*** ./src/sunos/java/runtime/invokeNative_sparc.s.orig Fri Feb 7 20:06:00 1997
--- ./src/sunos/java/runtime/invokeNative_sparc.s Thu Aug 7 17:14:01 1997
***************
*** 22,32 ****
* DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
*/
! .section ".text",#alloc,#execinstr
! .file "invokeNative_sparc.s"
! .section ".text",#alloc,#execinstr
! .align 4
!
! SUBROUTINE sysInvokeNative
!
--- 22,34 ----
* DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
*/
! ! .section ".text",#alloc,#execinstr
! ! .file "invokeNative_sparc.s"
! ! .section ".text",#alloc,#execinstr
! ! .align 4
! .text
! .align 4
!
! SUBROUTINE sysInvokeNative
!
***************
*** 78,84 ****
! method returns a word, or stk+2 if the native method returns a
! double word.
! .global sysInvokeNative
! Arguments:
!
--- 80,86 ----
! method returns a word, or stk+2 if the native method returns a
! double word.
! .global _sysInvokeNative
! Arguments:
!
***************
*** 93,99 ****
! o0 the adjusted Java stack top
!
! sysInvokeNative:
! Set up a big enough stack frame (and make sure it's 8-byte aligned):
--- 95,101 ----
! o0 the adjusted Java stack top
!
! _sysInvokeNative:
! Set up a big enough stack frame (and make sure it's 8-byte aligned):
***************
*** 235,239 ****
ret
restore %i2,0,%o0
! .type sysInvokeNative,2
! .size sysInvokeNative,(.-sysInvokeNative)
--- 237,241 ----
ret
restore %i2,0,%o0
! ! .type sysInvokeNative,2
! ! .size sysInvokeNative,(.-sysInvokeNative)
*** ./src/sunos/java/runtime/machgc_sparc.s.orig Fri Feb 7 20:05:58 1997
--- ./src/sunos/java/runtime/machgc_sparc.s Thu Aug 7 17:14:01 1997
***************
*** 21,37 ****
* For SPARC Solaris only: the one piece of GC that can't be in C.
*/
! #include
! .global gc_locked
! .global gc0_locked
/*
* Flush register windows, then enter the real garbage collector.
* Should only be executed when holding the heap lock.
*/
! gc_locked:
ta ST_FLUSH_WINDOWS
mov %o7, %g1 ! save value that "call" bashes
! call gc0_locked
mov %g1, %o7
--- 21,40 ----
* For SPARC Solaris only: the one piece of GC that can't be in C.
*/
! #include
! .text
! .align 4
! .global _gc_locked
! .proc 04
! ! .global _gc0_locked
/*
* Flush register windows, then enter the real garbage collector.
* Should only be executed when holding the heap lock.
*/
! _gc_locked:
ta ST_FLUSH_WINDOWS
mov %o7, %g1 ! save value that "call" bashes
! call _gc0_locked
mov %g1, %o7
*** ./src/sunos/java/runtime/executeJava_sparc.s.orig Fri Feb 7 20:06:00 1997
--- ./src/sunos/java/runtime/executeJava_sparc.s Thu Aug 7 17:14:02 1997
***************
*** 24,31 ****
* To replace executeJava.c on SPARC systems.
* This file uses m4 preprocessing.
*/
! .global ExecuteJava
! .type ExecuteJava,2
/*
* Important variables:
*
--- 24,31 ----
* To replace executeJava.c on SPARC systems.
* This file uses m4 preprocessing.
*/
! .global _ExecuteJava
! .type _ExecuteJava,2
/*
* Important variables:
*
***************
*** 240,246 ****
.section ".text",#alloc,#execinstr
! ExecuteJava:
save %sp,-FRAMESIZE,%sp
mov 0,Unhand ! Quickly get rid of random trash in reg
set TableBase,Dispatch
--- 240,246 ----
.section ".text",#alloc,#execinstr
! _ExecuteJava:
save %sp,-FRAMESIZE,%sp
mov 0,Unhand ! Quickly get rid of random trash in reg
set TableBase,Dispatch
***************
*** 292,300 ****
/* This macro makes it easy to find things in DBX */
define(MARK,
! `.global $1
! .type $1 `,'`2'
! $1`:'')
define(STARTVECTOR,
`divert(INLINE_DIVERSION)
--- 292,300 ----
/* This macro makes it easy to find things in DBX */
define(MARK,
! `.global _$1
! !.type $1 `,'`2'
! _$1`:'')
define(STARTVECTOR,
`divert(INLINE_DIVERSION)
***************
*** 338,344 ****
define( `INLINE_DIVERSION', `2')
define( `OUTLINE_DIVERSION', `3')
! define( `OUTLINE', `divert(OUTLINE_DIVERSION) .align 16')
define( `INLINE', `divert(INLINE_DIVERSION)')
')
--- 338,344 ----
define( `INLINE_DIVERSION', `2')
define( `OUTLINE_DIVERSION', `3')
! define( `OUTLINE', `divert(OUTLINE_DIVERSION) .align 8')
define( `INLINE', `divert(INLINE_DIVERSION)')
')
***************
*** 427,433 ****
/*
* And here is the opcode vector.
*/
! .align 128
STARTVECTOR(nop)
TableBase:
--- 427,433 ----
/*
* And here is the opcode vector.
*/
! .align 8
STARTVECTOR(nop)
TableBase:
***************
*** 600,606 ****
resolve_ldc:
! ResolveClassConstant(constant_pool, index, ee, bitset)!
mov ConstP,%o0
! call ResolveClassConstant,4
mov Ee,%o2
! We're back from ResolveClassConstant. See if it caused an exception.
--- 600,606 ----
resolve_ldc:
! ResolveClassConstant(constant_pool, index, ee, bitset)!
mov ConstP,%o0
! call _ResolveClassConstant,4
mov Ee,%o2
! We're back from ResolveClassConstant. See if it caused an exception.
***************
*** 1017,1023 ****
! is_instance_of(value, array[length], Ee)
mov TOSB,%o0 ! get proposed value
ld [Unhand+T1],%o1 ! get array classblock pointer
! call is_instance_of,3
mov Ee,%o2
! if is_instance_of returns True, then we do the store and
--- 1017,1023 ----
! is_instance_of(value, array[length], Ee)
mov TOSB,%o0 ! get proposed value
ld [Unhand+T1],%o1 ! get array classblock pointer
! call _is_instance_of,3
mov Ee,%o2
! if is_instance_of returns True, then we do the store and
***************
*** 1369,1375 ****
std %f0,[%fp-StackT]
std %f2,[%fp-StackT+8]
ldd [%fp-StackT],%o0
! call fmod,4
ldd [%fp-StackT+8],%o2
fdtos %f0,%f0
SCALENEXT
--- 1369,1375 ----
std %f0,[%fp-StackT]
std %f2,[%fp-StackT+8]
ldd [%fp-StackT],%o0
! call _fmod,4
ldd [%fp-StackT+8],%o2
fdtos %f0,%f0
SCALENEXT
***************
*** 1388,1394 ****
ld [SP-12],%o1
dec 8,SP
ld [SP],%o2
! call fmod,4
ld [SP+4],%o3
SCALENEXT
st %f0,[SP-8]
--- 1388,1394 ----
ld [SP-12],%o1
dec 8,SP
ld [SP],%o2
! call _fmod,4
ld [SP+4],%o3
SCALENEXT
st %f0,[SP-8]
***************
*** 1646,1652 ****
OP0(l2f)
ld [SP-8],%o0
dec 4,SP
! call lltof,2
ld [SP],%o1
st %f0,[SP-4]
--- 1646,1652 ----
OP0(l2f)
ld [SP-8],%o0
dec 4,SP
! call _lltof,2
ld [SP],%o1
st %f0,[SP-4]
***************
*** 1661,1667 ****
*/
OP0(l2d)
ld [SP-8],%o0
! call lltod,2
ld [SP-4],%o1
st %f0,[SP-8]
SCALENEXT
--- 1661,1667 ----
*/
OP0(l2d)
ld [SP-8],%o0
! call _lltod,2
ld [SP-4],%o1
st %f0,[SP-8]
SCALENEXT
***************
*** 1785,1792 ****
subcc T1, TOSA, T4 ! T4 == 0 iff top halves are the same
mov 1,TOSA ! possible result
orcc T3,T4,%g0 ! are both halves the same?
! skipnz
mov 0,TOSA
GO
st TOSA,[SP-4]
INLINE
--- 1785,1795 ----
subcc T1, TOSA, T4 ! T4 == 0 iff top halves are the same
mov 1,TOSA ! possible result
orcc T3,T4,%g0 ! are both halves the same?
! !skipnz
! ! not this: bnz,a 1f
! be,a .+8
mov 0,TOSA
+ 1:
GO
st TOSA,[SP-4]
INLINE
***************
*** 2080,2091 ****
ld [FP+STRUCT_OFFSET(javaframe,monitor)],%o0
! top of stack for previos frame
ld [ConstP+STRUCT_OFFSET(javaframe,optop)],T1
! sethi %hi(java_monitor),R3
st TOSA,[T1] ! store value into previous frame
inc 4,T1 ! increment previous frames top
st T1,[ConstP+STRUCT_OFFSET(javaframe,optop)]
b finish_return
! ld [R3+%lo(java_monitor)],R3 ! java_monitor in R3
')
/*
--- 2083,2094 ----
ld [FP+STRUCT_OFFSET(javaframe,monitor)],%o0
! top of stack for previos frame
ld [ConstP+STRUCT_OFFSET(javaframe,optop)],T1
! sethi %hi(_java_monitor),R3
st TOSA,[T1] ! store value into previous frame
inc 4,T1 ! increment previous frames top
st T1,[ConstP+STRUCT_OFFSET(javaframe,optop)]
b finish_return
! ld [R3+%lo(_java_monitor)],R3 ! java_monitor in R3
')
/*
***************
*** 2105,2111 ****
dec 8,SP
! top of stack for previous frame
ld [ConstP+STRUCT_OFFSET(javaframe,optop)],T1
! sethi %hi(java_monitor),R3
! store double value into previous frame
st TOSA,[T1]
st TOSB,[T1+4]
--- 2108,2114 ----
dec 8,SP
! top of stack for previous frame
ld [ConstP+STRUCT_OFFSET(javaframe,optop)],T1
! sethi %hi(_java_monitor),R3
! store double value into previous frame
st TOSA,[T1]
st TOSB,[T1+4]
***************
*** 2112,2118 ****
inc 8,T1 ! increment top of previous frame
st T1,[ConstP+STRUCT_OFFSET(javaframe,optop)]
b finish_return
! ld [R3+%lo(java_monitor)],R3 ! java_monitor in R3
')
WORDRETURN(ireturn)
DOUBLEWORDRETURN(lreturn)
--- 2115,2121 ----
inc 8,T1 ! increment top of previous frame
st T1,[ConstP+STRUCT_OFFSET(javaframe,optop)]
b finish_return
! ld [R3+%lo(_java_monitor)],R3 ! java_monitor in R3
')
WORDRETURN(ireturn)
DOUBLEWORDRETURN(lreturn)
***************
*** 2129,2137 ****
ld [FP+STRUCT_OFFSET(javaframe,prev)],ConstP
! cur_frame->monitor
ld [FP+STRUCT_OFFSET(javaframe,monitor)],%o0
! sethi %hi(java_monitor),R3
b finish_return
! ld [R3+%lo(java_monitor)],R3 ! java_monitor in R3
OUTLINE
--- 2132,2140 ----
ld [FP+STRUCT_OFFSET(javaframe,prev)],ConstP
! cur_frame->monitor
ld [FP+STRUCT_OFFSET(javaframe,monitor)],%o0
! sethi %hi(_java_monitor),R3
b finish_return
! ld [R3+%lo(_java_monitor)],R3 ! java_monitor in R3
OUTLINE
***************
*** 2189,2195 ****
returnExitMonitor:
! calling monitorExit( obj_monitor( frame->monitor) )
! CALL_AND_BRANCH(monitorExit, 1, 1b)
returnJavaMonitoring:
! Record how much time in this routine from the call site.
--- 2192,2198 ----
returnExitMonitor:
! calling monitorExit( obj_monitor( frame->monitor) )
! CALL_AND_BRANCH(_monitorExit, 1, 1b)
returnJavaMonitoring:
! Record how much time in this routine from the call site.
***************
*** 2200,2206 ****
be,a 2b + 4
cmp FP,Varbase
! int time = now() - frame->mon_starttime;
! call now,0
nop
ld [FP+STRUCT_OFFSET(javaframe,mon_starttime)],%o2
mov R3,%o1
--- 2203,2209 ----
be,a 2b + 4
cmp FP,Varbase
! int time = now() - frame->mon_starttime;
! call _now,0
nop
ld [FP+STRUCT_OFFSET(javaframe,mon_starttime)],%o2
mov R3,%o1
***************
*** 2207,2213 ****
sub %o0,%o2,%o2
! java_mon(frame->prev->current_method, mb, time);
ld [ConstP+STRUCT_OFFSET(javaframe,current_method)],%o0
! CALL_AND_BRANCH(java_mon, 3, 2b)
returnFixingQuickInvocation:
--- 2210,2216 ----
sub %o0,%o2,%o2
! java_mon(frame->prev->current_method, mb, time);
ld [ConstP+STRUCT_OFFSET(javaframe,current_method)],%o0
! CALL_AND_BRANCH(_java_mon, 3, 2b)
returnFixingQuickInvocation:
***************
*** 2229,2235 ****
ld [Unhand+STRUCT_OFFSET(Classjava_lang_Class,constantpool)],R3
! FixupQuickInvocation(lastpc, currentMethod, targetMethod);
st R3,[FP+STRUCT_OFFSET(javaframe,constant_pool)]
! CALL_AND_BRANCH(FixupQuickInvocation, 3, 3b)
returnInitialFrame:
! TOSA already contains exceptionKind(Ee)!
--- 2232,2238 ----
ld [Unhand+STRUCT_OFFSET(Classjava_lang_Class,constantpool)],R3
! FixupQuickInvocation(lastpc, currentMethod, targetMethod);
st R3,[FP+STRUCT_OFFSET(javaframe,constant_pool)]
! CALL_AND_BRANCH(_FixupQuickInvocation, 3, 3b)
returnInitialFrame:
! TOSA already contains exceptionKind(Ee)!
***************
*** 2259,2265 ****
mov DEFINED_CONSTANT($2),%o1
mov ConstP,%o2
mov Ee,%o3
! call ResolveClassConstantFromPC,5
mov 1<monitor
ld [FP+STRUCT_OFFSET(javaframe,prev)],ConstP
b finish_return
! ld [R3+%lo(java_monitor)],R3 ! java_monitor in R3
! FP contains frame
! ConstP contains fram->prev
! %o0 contains frame->monitor
--- 4076,4082 ----
ld [FP+STRUCT_OFFSET(javaframe,monitor)],%o0 ! cur_frame->monitor
ld [FP+STRUCT_OFFSET(javaframe,prev)],ConstP
b finish_return
! ld [R3+%lo(_java_monitor)],R3 ! java_monitor in R3
! FP contains frame
! ConstP contains fram->prev
! %o0 contains frame->monitor
***************
*** 4090,4096 ****
undivert(LITERAL_DIVERSION)
undivert(INLINE_DIVERSION)
')
! .size ExecuteJava,(.-ExecuteJava)
/*
--- 4093,4099 ----
undivert(LITERAL_DIVERSION)
undivert(INLINE_DIVERSION)
')
! .size _ExecuteJava,(.-_ExecuteJava)
/*
***************
*** 4100,4115 ****
* }
*/
noBreakpoints: .asciz "this interpreter doesn't support breakpoints"
! .global set_single_stepping
.type set_single_stepping,2
.align 8
! set_single_stepping:
save %fp,-96,%fp
! call EE,0
nop
set illegalAccessName,%o1
set noBreakpoints,%o2
! call SignalError,3
nop
ret
restore
--- 4103,4118 ----
* }
*/
noBreakpoints: .asciz "this interpreter doesn't support breakpoints"
! .global _set_single_stepping
.type set_single_stepping,2
.align 8
! _set_single_stepping:
save %fp,-96,%fp
! call _EE,0
nop
set illegalAccessName,%o1
set noBreakpoints,%o2
! call _SignalError,3
nop
ret
restore
*** ./src/sunos/java/runtime/runtimeHelper_sparc.c.orig Fri Feb 7 20:06:00 1997
--- ./src/sunos/java/runtime/runtimeHelper_sparc.c Thu Aug 7 17:14:03 1997
***************
*** 46,48 ****
--- 46,77 ----
}
#endif
+ long long
+ _mul64(long long a, long long b)
+ {
+ return a * b;
+ }
+
+ long long
+ _div64(long long a, long long b)
+ {
+ return a / b;
+ }
+
+ long long
+ _rem64(long long a, long long b)
+ {
+ return (a % b);
+ }
+
+ long long
+ _ftoll(float a)
+ {
+ return (long long) a;
+ }
+
+ long long
+ _dtoll(double a)
+ {
+ return (long long) a;
+ }
*** ./src/sunos/java/javai/javai.c.orig Fri Feb 7 20:06:06 1997
--- ./src/sunos/java/javai/javai.c Thu Aug 7 17:14:03 1997
***************
*** 271,277 ****
--- 271,286 ----
} else {
progname = argv[0];
}
+ #ifdef SUNOS4
+ #undef SUNOS4
+ #endif
+ #ifdef SUNOS4
+ if (JNI_OK != JNI_CreateJavaVM(&jvm, &env, &vm_args)) {
+ return 1;
+ }
+ #endif
+
while (--argc > 0)
if ((++argv)[0][0] == '-' && sourcefile == 0)
#ifndef trace
***************
*** 453,461 ****
--- 462,472 ----
}
classname[i] = 0;
+ #ifndef SUNOS4
if (JNI_OK != JNI_CreateJavaVM(&jvm, &env, &vm_args)) {
return 1;
}
+ #endif
ee = JNIEnv2EE(env);
*** ./src/sunos/java/green_threads/include/context_md.h.orig Fri Feb 7 20:06:06 1997
--- ./src/sunos/java/green_threads/include/context_md.h Thu Aug 7 17:14:03 1997
***************
*** 1,3 ****
--- 1,4 ----
+
/*
* @(#)context_md.h 1.20 96/12/16
*
***************
*** 28,35 ****
--- 29,40 ----
#define _SOLARIS_CONTEXT_MD_H_
#include
+ #ifndef SUNOS4
#include
#include
+ #else
+ #include
+ #endif
/*
* Routines that call getcontext have strange control flow graphs,
***************
*** 39,44 ****
--- 44,50 ----
*/
#pragma unknown_control_flow(getcontext)
+ #ifndef SUNOS4
/*
* A solaris2 context. Everything else is on the stack.
*/
***************
*** 46,56 ****
--- 52,75 ----
unsigned int unix_errno;
ucontext_t ucontext;
} context_t;
+ #else
+ typedef struct {
+ unsigned int unix_errno;
+ sigjmp_buf sigjmpbuf;
+ sigset_t oldMask, blockMask;
+ } context_t;
+ #endif
/* Save state of the current content and call rescheduler */
void reschedule(void);
+ #ifdef SUNOS4
+ #define switchContext(contextp) { \
+ errno = (contextp)->unix_errno; \
+ siglongjmp((contextp)->sigjmpbuf, 1); \
+ }
+ #else
#if defined(i386)
#define switchContext(contextp) { \
***************
*** 72,82 ****
--- 91,110 ----
#error Unsupported ISA
#endif
+ #endif SUNOS4
+ #ifdef SUNOS4
#define yieldContext(contextp) \
+ if(! sigsetjmp((contextp)->sigjmpbuf, -1)) { \
+ (contextp)->unix_errno = errno; \
+ reschedule(); \
+ }
+ #else
+ #define yieldContext(contextp) \
if (getcontext(&((contextp)->ucontext)) == 0) { \
(contextp)->unix_errno = errno; \
reschedule(); \
}
+ #endif
#endif /* !_SOLARIS_CONTEXT_MD_H_ */
*** ./src/sunos/java/green_threads/include/threads_md.h.orig Fri Feb 7 20:06:06 1997
--- ./src/sunos/java/green_threads/include/threads_md.h Thu Aug 7 17:14:03 1997
***************
*** 124,130 ****
--- 124,132 ----
extern void threadWakeup(sys_thread_t *);
extern int threadSetSchedulingPriority(sys_thread_t *, int priority);
+ #ifndef MAX
#define MAX(x, y) ((x) > (y) ? (x) : (y))
+ #endif
#define INVERSION_PRIORITY(tid) \
MAX((tid)->oldPriority, (tid)->inversion_queue->monitor_waitq->priority)
*** ./src/sunos/java/green_threads/include/iomgr.h.orig Fri Feb 7 20:06:06 1997
--- ./src/sunos/java/green_threads/include/iomgr.h Thu Aug 7 17:14:04 1997
***************
*** 53,60 ****
--- 53,65 ----
#define FD_NBINIT 0x1
#define FD_CLOSED 0x2
+ #ifdef SUNOS4
+ #define READ_TIMEOUT TIMEOUT_INFINITY /* should trip on sigio? */
+ #define WRITE_TIMEOUT 40 /* sigio doesn't trip on write avail */
+ #else
#define READ_TIMEOUT TIMEOUT_INFINITY
#define WRITE_TIMEOUT TIMEOUT_INFINITY
+ #endif
#define check_single_fd(fd) \
if ((fd_flags[fd] & FD_NBINIT) == 0) { \
***************
*** 88,92 ****
--- 93,100 ----
#define SYS_DUP 11
#define SYS_CREAT 12
#define SYS_ACCEPT 13
+ #ifdef SUNOS4
+ #define SYS_SELECT 14
+ #endif
#endif /* !_GREEN_IOMGR_H_ */
*** ./src/sunos/java/green_threads/src/context.c.orig Fri Feb 7 20:06:10 1997
--- ./src/sunos/java/green_threads/src/context.c Thu Aug 7 17:14:04 1997
***************
*** 40,45 ****
--- 40,48 ----
#include "schedule.h"
#include "sys_api.h"
+ #ifdef SUNOS4
+ #include
+ #endif
/*
* The list on which we put freed thread stacks pending reclamation.
***************
*** 152,158 ****
--- 155,169 ----
} else { /* Didn't get one */
SCHED_UNLOCK(); /* Can't allocate with SCHED_LOCKED() */
if (redZoneSize == 0) {
+ #ifdef SUNOS4
+ #ifdef sun3
+ redZoneSize = PAGESIZE;
+ #else
+ redZoneSize = getpagesize();
+ #endif
+ #else
redZoneSize = sysconf(_SC_PAGESIZE); /* one page */
+ #endif
}
size += redZoneSize; /* For redzone */
stack->base = (stackp_t) sysMapMem(size, &size);
***************
*** 183,188 ****
--- 194,200 ----
currentStackPointer(sys_thread_t *tp)
{
context_t *context = &tp->mdcontext;
+ #ifndef SUNOS4
ucontext_t *uc = &(context->ucontext);
#ifdef i386
return (void *) (uc->uc_mcontext.gregs[USP]);
***************
*** 191,199 ****
#else /* Presumed to be ppc */
return (void *) (uc->uc_mcontext.gregs[R_R1]);
#endif
!
}
#ifdef i386
/* Solaris/x86 version */
--- 203,251 ----
#else /* Presumed to be ppc */
return (void *) (uc->uc_mcontext.gregs[R_R1]);
#endif
! #else
! return (void *) (context->sigjmpbuf[3]);
! #endif
}
+ #ifdef SUNOS4
+ void
+ initContext(sys_thread_t *tid, unsigned int pc,
+ void (*death_func)(), unsigned int arg)
+ {
+ context_t *mdcontext = CONTEXT(tid);
+ machdep_t *machdepP = MACHDEP(tid);
+ unsigned char *sp;
+ int *p;
+
+ memset(mdcontext->sigjmpbuf, 0, sizeof(mdcontext->sigjmpbuf));
+ machdepP->intrLockCount = 0;
+
+ sp = (unsigned char *) tid->stack_base;
+ /* Note: WINDOWSIZE stuff is for SPARC, not really needed for m68k */
+ sp -= (sizeof(sys_thread_t) + WINDOWSIZE + SA(MINFRAME));
+ /* Force sp to be double aligned! */
+ sp = (unsigned char *)((unsigned long)(sp) & 0xfffffff8);
+ /* for m68k the args to death_func are passed on the stack */
+ p = (int *)sp;
+
+ *p-- = (int ) 0xdeadbeef; /* frame pointer */
+ p -= 4; /* no arguments 3, 4, 5 */
+
+ *p-- = (int ) pc;
+ *p-- = (int ) arg;
+ *p-- = (int ) 1; /* dummy arg - for compatibility with SPARC version */
+
+ p -= 8; /* saved locals */
+
+ /* sigjmpbuf[0] is -1 */
+ mdcontext->sigjmpbuf[0] = -1;
+ /* signal mask is 0 (at 2), not block anything */
+ mdcontext->sigjmpbuf[3] = (int)(char *)p;
+ mdcontext->sigjmpbuf[4] = (int)death_func;
+ mdcontext->sigjmpbuf[5] = (int)death_func+4;
+ }
+ #else
#ifdef i386
/* Solaris/x86 version */
***************
*** 359,364 ****
--- 411,417 ----
}
#endif
+ #endif
/*
* This routine allocates enought memory for the thread context
*** ./src/sunos/java/green_threads/src/interrupt_md.c.orig Fri Feb 7 20:06:08 1997
--- ./src/sunos/java/green_threads/src/interrupt_md.c Thu Aug 7 17:14:05 1997
***************
*** 30,37 ****
--- 30,39 ----
*/
#include
#include
+ #ifndef SUNOS4
#include
#include
+ #endif
#include
#include "sys_api.h"
***************
*** 64,69 ****
--- 66,89 ----
"SIGPIPE 13 write on a pipe or other socket with no one to read it",
"SIGALRM 14 alarm clock",
"SIGTERM 15 software termination signal",
+ #ifdef SUNOS4
+ "SIGURG 16@ urgent condition on IO channel",
+ "SIGSTOP 17 stop not from tty",
+ "SIGTSTP 18 stop from tty",
+ "SIGCONT 19@ continue after stop",
+ "SIGCHLD 20 child status change",
+ "SIGTTIN 21+ background read attempted from control terminal",
+ "SIGTTOU 22+ background write attempted to control terminal",
+ "SIGPOLL 23 pollable event occurred (also SIGIO)",
+ "SIGXCPU 24 cpu time limit exceeded (see getrlimit(2))",
+ "SIGXFSZ 25 file size limit exceeded (see getrlimit(2))",
+ "SIGVTALRM 26 virtual time alarm (see getitimer(2))",
+ "SIGPROF 27 profiling timer alarm (see getitimer(2))",
+ "SIGWINCH 28@ window changed (see termio(4) and win(4S))",
+ "SIGLOST 29 resource lost",
+ "SIGUSR1 30 user defined signal 1",
+ "SIGUSR2 31 user defined signal 2",
+ #else
"SIGUSR1 16 user defined signal 1",
"SIGUSR2 17 user defined signal 2",
"SIGCHLD 18@ child status change",
***************
*** 87,99 ****
--- 107,125 ----
"SIGTHAW 35 private to checkpoint/resume",
"SIGRTMIN 36 first (high-priority) realtime signal",
"SIGRTMAX 43 last (lowest-priority) realtime signal"
+ #endif
};
/*
* Local routine prototypes.
*/
+ #ifdef SUNOS4
+ static void signalHandlerPanic(int);
+ static void signalHandlerDispatch(int);
+ #else
static void signalHandlerPanic(int, siginfo_t *, void *);
static void signalHandlerDispatch(int, siginfo_t *, void *);
+ #endif
/*
* Exported routines.
***************
*** 174,184 ****
--- 200,218 ----
* Install the panic handler for the signals that should cause us
* to panic.
*/
+ #ifdef SUNOS4
+ sigAct.sa_handler = signalHandlerPanic;
+ #else
sigAct.sa_handler = NULL;
sigAct.sa_sigaction = signalHandlerPanic;
+ #endif
sigemptyset(&(sigAct.sa_mask));
sigaddset(&sigAct.sa_mask, SIGPIPE);
+ #ifdef SUNOS4
+ sigAct.sa_flags = 0; /* no SA_RESTART :( */
+ #else
sigAct.sa_flags = SA_SIGINFO | SA_RESTART;
+ #endif
sigaction(SIGABRT, &sigAct, (struct sigaction *)0);
sigaction(SIGBUS, &sigAct, (struct sigaction *)0);
***************
*** 193,199 ****
--- 227,237 ----
sigaction(SIGXCPU, &sigAct, (struct sigaction *)0);
sigaction(SIGXFSZ, &sigAct, (struct sigaction *)0);
+ #ifdef SUNOS4
+ signal(SIGPIPE, SIG_IGN);
+ #else
sigignore(SIGPIPE);
+ #endif
if (sigprocmask(SIG_SETMASK, &(sigAct.sa_mask), NULL))
perror("intrinitMD - 2");
***************
*** 227,235 ****
--- 265,278 ----
*/
sigfillset(&(sigAct.sa_mask));
+ #ifdef SUNOS4
+ sigAct.sa_handler = signalHandlerDispatch;
+ sigAct.sa_flags = 0; /* no SA_RESTART :( */
+ #else
sigAct.sa_handler = 0;
sigAct.sa_sigaction = signalHandlerDispatch;
sigAct.sa_flags = SA_SIGINFO | SA_RESTART;
+ #endif
sigaction(interrupt, &sigAct, (struct sigaction *)0);
}
***************
*** 247,255 ****
--- 290,303 ----
* Set to the panic handler in case we get one when we shouldn't
*/
sigfillset(&(sigAct.sa_mask));
+ #ifdef SUNOS4
+ sigAct.sa_handler = signalHandlerPanic;
+ sigAct.sa_flags = 0;
+ #else
sigAct.sa_handler = NULL;
sigAct.sa_sigaction = signalHandlerPanic;
sigAct.sa_flags = SA_SIGINFO;
+ #endif
sigaction(interrupt, &sigAct, (struct sigaction *)0);
}
***************
*** 257,262 ****
--- 305,311 ----
* Local routines.
*/
+ #ifndef SUNOS4
/*
* Decode a siginfo_t structure, and print out something interesting
* about it. Truncate and succeed if the buffer write overflows. It's
***************
*** 373,378 ****
--- 422,428 ----
return msg;
}
}
+ #endif
/*-
* signalHandlerPanic() -- Deal with unexpected signals by dumping
***************
*** 380,388 ****
--- 430,444 ----
* panicing.
*/
static void
+ #ifdef SUNOS4
+ signalHandlerPanic(int sig)
+ #else
signalHandlerPanic(int sig, siginfo_t *info, void *uc)
+ #endif
{
+ #ifndef SUNOS4
extern void CompiledCodeSignalHandler(int sig, siginfo_t *info, void *uc);
+ #endif
extern void DumpMonitors();
extern void DumpAlarmQ();
static int count = 0;
***************
*** 392,406 ****
--- 448,467 ----
sysAbort();
}
+ #ifndef SUNOS4
CompiledCodeSignalHandler(sig, info, uc);
count += 1;
if (sig > MAXSIG) {
+ #else
+ if (sig > NSIG) {
+ #endif
jio_fprintf(stderr, "Unknown signal: %d\n", sig);
} else {
jio_fprintf(stderr, "%s\n", signalNames[sig]);
}
+ #ifndef SUNOS4
if (info) {
/* print out signal info */
if (info->si_code != SI_NOINFO) {
***************
*** 418,423 ****
--- 479,485 ----
sysThreadStackPointer(greenThreadSelf()));
}
}
+ #endif
DumpThreads();
DumpMonitors();
***************
*** 432,438 ****
--- 494,504 ----
* signalHandlerDispatch() -- Turn our signal into an intrDispatch().
*/
static void
+ #ifdef SUNOS4
+ signalHandlerDispatch(int sig)
+ #else
signalHandlerDispatch(int sig, siginfo_t *info, void *uc)
+ #endif
{
int old_errno;
***************
*** 442,448 ****
--- 508,518 ----
Log1(1, "signalHandlerDispatch(sig=%d)\n", sig);
old_errno = errno;
+ #ifdef SUNOS4
+ intrDispatch(sig, NULL);
+ #else
intrDispatch(sig, (void *) info);
+ #endif
errno = old_errno;
*** ./src/sunos/java/green_threads/src/io_md.c.orig Fri Feb 7 20:06:08 1997
--- ./src/sunos/java/green_threads/src/io_md.c Thu Aug 7 17:14:05 1997
***************
*** 77,82 ****
--- 77,88 ----
#include "log.h"
#include "fd_md.h"
+ #ifdef SUNOS4
+ typedef unsigned boolean_t;
+ #define B_TRUE ((boolean_t)1)
+ #define B_FALSE ((boolean_t)0)
+ #endif
+
extern int pendingException();
extern boolean_t initialize_monitors(int);
extern int system_close(int);
***************
*** 111,121 ****
--- 117,135 ----
}
if (fd != -1) {
+ #ifdef SUNOS4
+ Log2(1, "Opened (%s) fd: %d\n", fname, fd);
+ #else
Log1(1, "Opened fd: %d\n", fd);
+ #endif
ret = initialize_monitors(fd);
fdobj->fd = fd+1;
} else {
+ #ifdef SUNOS4
+ Log2(1, "open (%s) error: %d\n", fname, errno);
+ #else
Log1(1, "open error: %d\n", errno);
+ #endif
}
IO_UNLOCK();
***************
*** 169,175 ****
--- 183,191 ----
* ready, 0 if it timed out, -1 on error (e.g., fd was closed or marked
* closed). Timeout in milliseconds.
*/
+ #ifndef SUNOS4
extern int _select (int width, fd_set *, fd_set *, fd_set *, struct timeval *);
+ #endif
#include "clock.h" /* timerCmp(), etc */
int
***************
*** 200,213 ****
limit.tv_usec = now.tv_usec + ((timeout % 1000) * 1000);
FD_ZERO(&fds);
FD_SET(fd, &fds);
!
ret = _select(fdobj->fd, &fds, 0, 0, &zt);
if (ret == 0) {
/* we have to wait */
while (1) {
sysMonitorWait(mon, timeout, FALSE);
FD_SET(fd, &fds);
ret = _select(fdobj->fd, &fds, 0, 0, &zt);
if (ret) {
break;
}
--- 216,237 ----
limit.tv_usec = now.tv_usec + ((timeout % 1000) * 1000);
FD_ZERO(&fds);
FD_SET(fd, &fds);
!
! #ifndef SUNOS4
ret = _select(fdobj->fd, &fds, 0, 0, &zt);
+ #else
+ ret = (*systable[SYS_SELECT].addr)(fdobj->fd, &fds, 0, 0, &zt);
+ #endif
if (ret == 0) {
/* we have to wait */
while (1) {
sysMonitorWait(mon, timeout, FALSE);
FD_SET(fd, &fds);
+ #ifndef SUNOS4
ret = _select(fdobj->fd, &fds, 0, 0, &zt);
+ #else
+ ret = (*systable[SYS_SELECT].addr)(fdobj->fd, &fds, 0, 0, &zt);
+ #endif
if (ret) {
break;
}
***************
*** 426,431 ****
--- 450,458 ----
static void
syncFailed(int err)
{
+ #ifdef SUNOS4
+ extern char *strerror(int);
+ #endif
SignalError(EE(), "java/io/SyncFailedException", strerror(err));
}
***************
*** 516,524 ****
--- 543,570 ----
sysMonitorEnter(mon);
fd = fdobj->fd - 1;
+ #ifndef SUNOS4
if (fd >= 0) {
ret = accept(fd, him, len);
}
+ #else
+ /* IO_LOCK(); */
+ while (1) {
+ ret = (*systable[SYS_ACCEPT].addr)(fd, him, len);
+ if ((ret != -1) || pendingException() ||
+ ((errno != EAGAIN) && (errno != EWOULDBLOCK) && (errno != EINTR)))
+ break;
+ sysMonitorWait(mon, SYS_TIMEOUT_INFINITY, FALSE);
+ }
+ if (ret != -1) {
+ Log1(1, "Accept ret: %d \n", ret);
+ } else {
+ Log1(1, "Accept error: %d\n", errno);
+ }
+
+ /* IO_UNLOCK(); */
+ #endif
+
sysMonitorExit(mon);
return ret;
}
***************
*** 532,539 ****
--- 578,587 ----
fd_set write_fds;
struct timeval poll;
sys_mon_t *mon;
+ #ifndef SUNOS4
extern int _select (int width, fd_set *, fd_set *, fd_set *,
struct timeval *);
+ #endif
int s = fdobj->fd-1;
if (s < 0) {
***************
*** 553,563 ****
--- 601,623 ----
result = connect(s, him, len);
while (result < 0 && !pendingException()) {
+ #ifndef SUNOS4
if (errno == EINPROGRESS) {
int cnt = _select(s+1, 0, &write_fds, 0, &poll);
+ #else
+ int cnt = (*systable[SYS_SELECT].addr)(s+1,0,&write_fds,0,&poll);
+ #endif
FD_SET(s, &write_fds);
if (cnt == 1) {
+ #ifdef SUNOS4
+ struct sockaddr rconn;
+ int rconnlen = sizeof(struct sockaddr);
+
+ if(!(getpeername(s, &rconn, &rconnlen))) {
+ errno = ECONNREFUSED; /* not necessarily, but likely */
+ }
+ #else
int bytes;
if (ioctl(s, FIONREAD, &bytes) == -1) {
***************
*** 572,584 ****
--- 632,647 ----
sysAssert(result < 0);
break;
}
+ #endif
result = 0;
break;
}
sysMonitorWait(mon, delay, FALSE);
+ #ifndef SUNOS4
} else {
break;
}
+ #endif
} /* end of while */
}
*** ./src/sunos/java/green_threads/src/process_md.c.orig Fri Feb 7 20:06:10 1997
--- ./src/sunos/java/green_threads/src/process_md.c Thu Aug 7 17:14:06 1997
***************
*** 24,30 ****
--- 24,35 ----
#include
#include
#include
+ #ifdef SUNOS4
+ #include
+ extern char *strerror(int);
+ #else
#include
+ #endif
#include
#include
***************
*** 63,69 ****
--- 68,79 ----
*/
void
java_lang_UNIXProcess_run(Hjava_lang_UNIXProcess *this) {
+ #ifndef SUNOS4
siginfo_t info;
+ #else
+ pid_t pid;
+ int status;
+ #endif
sys_mon_t *mon = asyncMon(SYS_ASYNC_MON_CHILD);
char *classname = JAVAPKG "UNIXProcess";
ClassClass *cb = FindClass(0, classname, TRUE);
***************
*** 75,87 ****
while (1) {
sysMonitorEnter(mon);
while (waitid(P_ALL, 0, &info, WEXITED|WNOHANG) != 0 || info.si_pid == 0) {
sysMonitorWait(mon, TIMEOUT_INFINITY, FALSE);
}
/* fprintf(stderr, "reaper reaped: pid %d status %d\n", info.si_pid, info.si_status); */
!
execute_java_static_method(EE(), cb, "deadChild", "(II)V",
info.si_pid, info.si_status);
sysMonitorExit(mon);
}
}
--- 85,109 ----
while (1) {
sysMonitorEnter(mon);
+ #ifdef SUNOS4
+ while ((pid = waitpid(0, &status, WNOHANG)) == 0) {
+ #else
while (waitid(P_ALL, 0, &info, WEXITED|WNOHANG) != 0 || info.si_pid == 0) {
+ #endif
sysMonitorWait(mon, TIMEOUT_INFINITY, FALSE);
}
/* fprintf(stderr, "reaper reaped: pid %d status %d\n", info.si_pid, info.si_status); */
! #ifdef SUNOS4
! if (-1 == pid) {
! sysMonitorWait(mon, TIMEOUT_INFINITY, FALSE);
! continue;
! }
! execute_java_static_method(EE(), cb, "deadChild", "(II)V",
! pid, status);
! #else
execute_java_static_method(EE(), cb, "deadChild", "(II)V",
info.si_pid, info.si_status);
+ #endif
sysMonitorExit(mon);
}
}
*** ./src/sunos/java/green_threads/src/iomgr.c.orig Fri Feb 7 20:06:10 1997
--- ./src/sunos/java/green_threads/src/iomgr.c Thu Aug 7 17:14:59 1997
***************
*** 61,66 ****
--- 61,73 ----
#include "log.h"
#include "sys_api.h"
+ #ifdef SUNOS4
+ typedef unsigned boolean_t;
+ #define B_TRUE ((boolean_t)1)
+ #define B_FALSE ((boolean_t)0)
+ #define OPEN_MAX FD_SETSIZE
+ #endif
+
/*
* Pavani's Async IO notes:
*
***************
*** 137,143 ****
--- 144,172 ----
#define IO_OPTIMIZE
+ #ifdef SUNOS4
+ int syscalldebug();
+
syscall_t systable[] = {
+ { "write", syscalldebug },
+ { "writev", syscalldebug },
+ { "read", syscalldebug },
+ { "readv", syscalldebug },
+ { "getmsg", syscalldebug },
+ { "putmsg", syscalldebug },
+ { "poll", syscalldebug },
+ { "open", syscalldebug },
+ { "close", syscalldebug },
+ { "pipe", syscalldebug },
+ { "fcntl", syscalldebug },
+ { "dup", syscalldebug },
+ { "creat", syscalldebug },
+ { "accept", syscalldebug },
+ { "select", syscalldebug },
+ { (char *) 0, 0 }
+ };
+ #else
+ syscall_t systable[] = {
{ "write", 0 },
{ "writev", 0 },
{ "read", 0 },
***************
*** 154,165 ****
--- 183,197 ----
{ "accept", 0 },
{ (char *) 0, 0 }
};
+ #endif
extern int errno;
/* This isn't in syscall.h, for some reason. */
int syscall (int, ...);
+ #ifndef SUNOS4
int _select (int width, fd_set *, fd_set *, fd_set *, struct timeval *);
+ #endif
/* macro to copy fd_set. fd_set is an array of fd_mask */
/* NFDBITS is defined in select.h to be bits per fd_mask */
***************
*** 173,183 ****
--- 205,245 ----
initSyscalls()
{
syscall_t *tp = systable;
+ #ifdef SUNOS4
+ /* alternative to this is to not redefine open() etc, but to
+ go through and patch open(), etc, to jmp to the C replacements,
+ and the systable stuff will be functions in 68k that set up
+ the traps. */
+
+ static void *dlMain = NULL;
+ char *libc;
+
+ if(!dlMain) {
+ if(!(libc=getenv("LIBCPATH"))) {
+ /* could do some funky stuff to try and find libc here */
+ /* sysWrite(2, "**Could not find libc, set LIBCPATH to filename\n", 48); */
+ sysAbort();
+ }
+
+ if(!(dlMain = dlopen(libc,1))) {
+ /* sysWrite(2, "**Could not open libc, check LIBCPATH\n", 38); */
+ sysAbort();
+ }
+ #endif
+
while (tp->sym != (char *) 0) {
+ #ifdef SUNOS4
+ tp->addr = (sysfunc_t) dlsym(dlMain, tp->sym);
+ #else
+
tp->addr = (sysfunc_t) dlsym(RTLD_NEXT, tp->sym);
+ #endif
tp++;
}
+ #ifdef SUNOS4
+ }
+ #endif
}
/*
***************
*** 278,283 ****
--- 340,348 ----
nonblock_io(int desc, int onoff)
{
long flgs;
+ #ifdef SUNOS4
+ pid_t pid;
+ #endif
sysAssert(desc < max_files);
sysAssert(fdmon[desc] != NULL);
***************
*** 297,304 ****
--- 362,377 ----
return -1;
}
+ #ifdef SUNOS4
+ fcntl(desc, F_SETFL, flgs | O_NONBLOCK | FASYNC );
+ pid=1;
+ ioctl(desc, FIONBIO, &pid);
+ pid = getpid ();
+ fcntl(desc, F_SETOWN, pid);
+ #else
fcntl(desc, F_SETFL, flgs | O_NONBLOCK);
ioctl(desc, I_SETSIG, S_INPUT | S_OUTPUT);
+ #endif
asyncIOActivateFD(desc);
fd_flags[desc] |= FD_NBINIT;
***************
*** 316,323 ****
--- 389,404 ----
return -1;
}
+ #ifdef SUNOS4
+ fcntl(desc, F_SETFL, flgs & ~(O_NONBLOCK | FASYNC));
+ {
+ int zero = 0;
+ ioctl(desc, FIONBIO, &zero);
+ }
+ #else
fcntl(desc, F_SETFL, flgs & ~O_NONBLOCK);
ioctl(desc, I_SETSIG, 0);
+ #endif
fd_flags[desc] &= ~FD_NBINIT;
***************
*** 367,372 ****
--- 448,459 ----
return ret;
}
+ #ifdef SUNOS4
+ if (fdmon == NULL) {
+ return (*systable[SYS_CLOSE].addr)(fd);
+ }
+ #endif
+
sysMonitorEnter(fdmon[fd]);
if (fd_ref[fd] == 0) {
***************
*** 530,537 ****
--- 617,629 ----
return newfd;
}
+ #ifdef SUNOS4
+ int
+ read(int fd, void *buf, __SIZE_TYPE__ nbytes)
+ #else
ssize_t
read(int fd, void *buf, unsigned int nbytes)
+ #endif
{
register int nread = -1;
sys_mon_t *mon = fdmon[fd];
***************
*** 579,592 ****
}
ssize_t
write(int fd, const void *buf, unsigned int nbytes)
{
register int nwrote;
register caddr_t next = (caddr_t)buf;
register int total_written = 0;
! sys_mon_t *mon = fdmon[fd];
sysAssert(mon != NULL);
check_single_fd(fd);
--- 671,698 ----
}
+ #ifdef SUNOS4
+ int
+ write(int fd, const void *buf, __SIZE_TYPE__ nbytes)
+ #else
ssize_t
write(int fd, const void *buf, unsigned int nbytes)
+ #endif
{
register int nwrote;
register caddr_t next = (caddr_t)buf;
register int total_written = 0;
! sys_mon_t *mon;
+ #ifdef SUNOS4
+ if ((fdmon == NULL) || (fd == 2)) { /* java not running yet? */
+ if (systable[SYS_WRITE].addr == syscalldebug) { /* system calls not initialized */
+ initSyscalls();
+ }
+ return (*systable[SYS_WRITE].addr)(fd, buf, nbytes);
+ }
+ #endif
+ mon = fdmon[fd];
sysAssert(mon != NULL);
check_single_fd(fd);
***************
*** 609,616 ****
--- 715,728 ----
if ((nwrote != -1 && (total_written == nbytes)) ||
((nwrote == -1) && (errno != EAGAIN && errno != EINTR)) ||
pendingException()) {
+ #if defined(SUNOS4) && defined(LOGGING) /* since Log*() calls write() we have a loop */
+ if (strncmp((char *)buf, "Write for ", 10) == 0) /* NOTE: hanging if...
+ */
+ #else
+
Log2(1, "Write for %d bytes finished (did not block) on fd: %d\n", \
nwrote, fd);
+ #endif
return ((nwrote!=-1)?total_written:-1);
}
/* else take the slow path */
***************
*** 657,663 ****
--- 769,779 ----
system_close(fd);
}
+ #if defined(SUNOS4) && defined(LOGGING) /* since Log*() calls write() we have a loop */
+ if (strncmp((char *)buf, "Write for ", 10) == 0) /* NOTE: hanging if... */
+ #else
Log2(1, "Write for %d bytes finished on fd: %d\n", nwrote, fd);
+ #endif
sysMonitorExit(mon);
return total_written;
}
***************
*** 873,879 ****
--- 989,997 ----
int delay = 50; /* sleep 50 ms and try again */
fd_set write_fds;
struct timeval poll;
+ #ifndef SUNOS4
extern int _select (int width, fd_set *, fd_set *, fd_set *, struct timeval *);
+ #endif
FD_ZERO(&write_fds);
FD_SET(s, &write_fds);
***************
*** 882,892 ****
--- 1000,1022 ----
sysMonitorEnter(asyncMon(SYS_ASYNC_MON_IO));
result = connect(s, him, len);
while (result < 0 && !pendingException()) {
+ #ifndef SUNOS4
if (errno == EINPROGRESS) {
int cnt = _select(s+1, 0, &write_fds, 0, &poll);
+ #else
+ int cnt = (*systable[SYS_SELECT].addr)(s+1,0,&write_fds,0,&poll);
+ #endif
FD_SET(s, &write_fds);
if (cnt == 1) {
+ #ifdef SUNOS4
+ struct sockaddr rconn;
+ int rconnlen = sizeof(struct sockaddr);
+
+ if(!(getpeername(s, &rconn, &rconnlen))) {
+ errno = ECONNREFUSED; /* not necessarily, but likely */
+ }
+ #else
int bytes;
if (ioctl(s, FIONREAD, &bytes) == -1) {
***************
*** 901,913 ****
--- 1031,1046 ----
sysAssert(result < 0);
break;
}
+ #endif
result = 0;
break;
}
sysMonitorWait(asyncMon(SYS_ASYNC_MON_IO), delay, FALSE);
+ #ifndef SUNOS4
} else {
break;
}
+ #endif
}
sysMonitorExit(asyncMon(SYS_ASYNC_MON_IO));
return result;
***************
*** 1051,1057 ****
--- 1184,1195 ----
timeval_t delay;
int timeout = SYS_TIMEOUT_INFINITY;
+ #ifdef SUNOS4
+ nfds = (*systable[SYS_SELECT].addr)(width, readfds, writefds, exceptfds,
+ &poll);
+ #else
nfds = _select(width, readfds, writefds, exceptfds, &poll);
+ #endif
if (nfds != 0) {
break;
***************
*** 1130,1136 ****
--- 1268,1278 ----
}
if (fd != -1) {
+ #ifdef SUNOS4
+ Log2(1, "Opened fd: %d (%s)\n", fd, fname);
+ #else
Log1(1, "Opened fd: %d\n", fd);
+ #endif
#ifndef GPROF
ret = initialize_monitors(fd);
#else
***************
*** 1139,1145 ****
--- 1281,1291 ----
}
#endif
} else {
+ #ifdef SUNOS4
+ Log2(1, "open error: %d (%s)\n", errno, fname);
+ #else
Log1(1, "open error: %d\n", errno);
+ #endif
}
IO_UNLOCK();
***************
*** 1207,1212 ****
--- 1353,1368 ----
va_start(ap, cmd);
arg = va_arg(ap, int);
IO_LOCK();
+ #ifdef SUNOS4
+ #ifdef FCNTL_HACK
+ if (cmd == F_SETFL && arg == FNONBLOCK) {
+ arg = FNONBLOCK|FASYNC;
+ }
+ #endif /* FCNTL_HACK */
+ if (cmd == F_SETFL && arg == O_NONBLOCK) {
+ arg = O_NONBLOCK|FASYNC;
+ }
+ #endif
while (1) {
fd = (*systable[SYS_FCNTL].addr)(fildes, cmd, arg);
if ((fd != -1) || pendingException() ||
***************
*** 1282,1285 ****
--- 1438,1527 ----
IO_UNLOCK();
return fd;
}
+
+ #ifdef SUNOS4
+ int syscalldebug(void) {
+ /* sysWrite(2, "**Attempt to call system call before initSyscalls\n", 50); */
+ sysAbort();
+ }
+ #endif
+
+ #ifdef SUNOS4
+ #include
+
+ struct hostent *
+ gethostbyaddr_r(const char *addr, int length, int type, struct hostent *resp, char *buffer, int buflen, int *h_errnop)
+ {
+ struct hostent *result;
+ int old_h_errno;
+ char *filp = buffer;
+ char **aliasp, **out_aliasp;
+ char **addrp, **out_addrp;
+ unsigned k;
+ unsigned len;
+
+ IO_LOCK();
+ old_h_errno = h_errno;
+ result = gethostbyaddr (addr, length, type);
+ if (result != 0)
+ {
+ *resp = *result;
+ /* copy h_name */
+ len = strlen (result->h_name)+1;
+ if (filp+len > buffer+buflen)
+ goto out_of_buffer_space;
+ memcpy (filp, result->h_name, len);
+ resp->h_name = filp;
+ filp += len;
+ /* need to align -- KSW */
+ filp = (char *)(((int) filp + 3) & ~3);
+ /* copy h_aliases */
+ resp->h_aliases = out_aliasp = (char **) filp;
+ len = sizeof (char *);
+ for (aliasp = result->h_aliases; *aliasp != 0; ++aliasp)
+ {
+ if (filp+len > buffer+buflen)
+ goto out_of_buffer_space;
+ filp += len;
+ }
+ for (aliasp = result->h_aliases; *aliasp != 0; ++aliasp)
+ {
+ len = strlen (*aliasp)+1;
+ if (filp+len > buffer+buflen)
+ goto out_of_buffer_space;
+ memcpy (filp, *aliasp, len);
+ *out_aliasp++ = filp;
+ filp += len;
+ }
+ /* copy h_addr_list */
+ len = sizeof (char *);
+ /* need to align -- KSW */
+ filp = (char *)(((int) filp + 3) & ~3);
+ resp->h_addr_list = out_addrp = (char **) filp;
+ for (addrp = result->h_addr_list; *addrp != 0; ++addrp)
+ {
+ if (filp+len > buffer+buflen)
+ goto out_of_buffer_space;
+ filp += len;
+ }
+ len = result->h_length;
+ for (addrp = result->h_addr_list; *addrp != 0; ++addrp)
+ {
+ if (filp+len > buffer+buflen)
+ goto out_of_buffer_space;
+ memcpy (filp, *addrp, len);
+ *out_addrp = filp;
+ filp += len;
+ }
+ }
+ *h_errnop = h_errno;
+ h_errno = old_h_errno;
+ IO_UNLOCK();
+ return resp;
+ out_of_buffer_space:
+ *h_errnop = 42; /* out of buffer space */
+ IO_UNLOCK();
+ return 0;
+ }
+ #endif
*** ./src/sunos/java/green_threads/src/signals.c.orig Fri Feb 7 20:06:10 1997
--- ./src/sunos/java/green_threads/src/signals.c Thu Aug 7 17:14:07 1997
***************
*** 27,33 ****
--- 27,35 ----
/*
* Header files.
*/
+ #ifndef SUNOS4
#include
+ #endif
#include
#include
#include
***************
*** 37,43 ****
--- 39,47 ----
#include "threads_md.h"
#include "monitor_md.h"
#include "interrupt.h"
+ #ifndef SUNOS4
#include "ucontext.h"
+ #endif
#include "log.h"
#include "itimer_md.h"
#include "schedule.h"
***************
*** 327,333 ****
--- 331,339 ----
Well just to be on safe side we grab SCHED_LOCK as well - pavani*/
SCHED_LOCK();
+ #ifndef SUNOS4
sighold(SIGIO);
+ #endif
entry = &fdMap[fd];
if ((slot = entry->pollOffset) == -1) {
***************
*** 340,346 ****
--- 346,354 ----
pollfd->fd = fd; /* may be redundant */
pollfd->events = entry->flags;
Log2(1, "Activating fd=%d onto slot=%d\n", fd, slot);
+ #ifndef SUNOS4
sigrelse(SIGIO);
+ #endif
SCHED_UNLOCK();
}
***************
*** 351,357 ****
--- 359,367 ----
int slot;
SCHED_LOCK();
+ #ifndef SUNOS4
sighold(SIGIO);
+ #endif
entry = &fdMap[fd];
if ((slot = entry->pollOffset) != -1) {
***************
*** 376,382 ****
--- 386,394 ----
pollTable[slot].events = entry->flags;
}
}
+ #ifndef SUNOS4
sigrelse(SIGIO);
+ #endif
SCHED_UNLOCK();
}
*** ./src/sunos/java/green_threads/src/synch.c.orig Fri Feb 7 20:06:10 1997
--- ./src/sunos/java/green_threads/src/synch.c Thu Aug 7 17:14:07 1997
***************
*** 26,36 ****
--- 26,41 ----
* instead of solaris threads, so we need a synchronization
* mechanism that works with our thread package.
*/
+ #ifndef SUNOS4
#include "monitor.h"
#include "synch.h"
#include "schedule.h"
#include "bool.h"
#include "sys_api.h"
+ #else
+ #include
+ #include
+ #endif
extern bool_t monitorsInitialized;
***************
*** 68,73 ****
--- 73,79 ----
* scheduling locked.
*/
+ #ifndef SUNOS4
_mutex_lock(mutex_t *mp)
{
sysAssert(_scheduling_lock == 0);
***************
*** 87,93 ****
--- 93,103 ----
}
return 0;
}
+ #endif
+ #ifdef SUNOS4
+ void InitializeSbrk() {}
+ #else
/*
* SPECIAL CASE: In Solaris, malloc() calls sbrk() for more memory,
* and both call _mutex_lock(), which we override to make them Green
***************
*** 129,132 ****
--- 139,143 ----
return ret;
}
+ #endif
#endif
*** ./src/sunos/java/green_threads/src/threads_md.c.orig Fri Feb 7 20:06:08 1997
--- ./src/sunos/java/green_threads/src/threads_md.c Thu Aug 7 17:14:07 1997
***************
*** 219,231 ****
static void start_func(int dummy, int arg, void (*func)()) {
SCHED_UNLOCK();
(*func)(arg);
panic("returned from start_func\n");
}
int
! sysThreadCreate(long stack_size, unsigned int flags,
void *(*start)(void *), sys_thread_t **ptid, void *cookie)
{
sysAssert(cookie != 0);
--- 219,236 ----
static void start_func(int dummy, int arg, void (*func)()) {
SCHED_UNLOCK();
+ #ifdef SUNOS4
+ /** fudgie stuff **/
+ __asm__("ld [%fp+44], %o1; ld [%fp+40], %o0; call %o1; nop");
+ #else
(*func)(arg);
+ #endif
panic("returned from start_func\n");
}
int
! sysThreadCreate(long stack_size, uint_t flags,
void *(*start)(void *), sys_thread_t **ptid, void *cookie)
{
sysAssert(cookie != 0);
*** ./src/sunos/sun/awt_p.h.orig Fri Feb 7 20:06:34 1997
--- ./src/sunos/sun/awt_p.h Thu Aug 7 17:14:08 1997
***************
*** 46,51 ****
--- 46,54 ----
#include
#include
#include
+ #ifdef SUNOS4
+ #include
+ #endif
#include
#include
#include
*** ./src/sunos/sun/tiny_Toolkit.c.orig Fri Feb 7 20:06:38 1997
--- ./src/sunos/sun/tiny_Toolkit.c Thu Aug 7 17:14:08 1997
***************
*** 22,28 ****
--- 22,30 ----
#include
#include
+ #ifndef SUNOS4
#include "thread.h"
+ #endif
#include "tiny.h"
#include "java_awt_Event.h"
#include "sun_awt_tiny_TinyToolkit.h"
***************
*** 187,193 ****
--- 189,197 ----
key = java_awt_Event_BACK_SPACE;
break;
case XK_Delete:
+ #ifndef SUNOS4
case XK_KP_Delete:
+ #endif
key = java_awt_Event_DELETE;
break;
case XK_Tab:
***************
*** 259,271 ****
--- 263,279 ----
javaMethod = actionKeyMethod;
break;
case XK_F29:
+ #ifndef SUNOS4
case XK_Page_Up:
+ #endif
/* PgUp */
key = java_awt_Event_PGUP;
javaMethod = actionKeyMethod;
break;
case XK_F35:
+ #ifndef SUNOS4
case XK_Page_Down:
+ #endif
/* PgDn */
key = java_awt_Event_PGDN;
javaMethod = actionKeyMethod;
*** ./src/sunos/sun/canvas.c.orig Fri Feb 7 20:06:34 1997
--- ./src/sunos/sun/canvas.c Thu Aug 7 17:14:09 1997
***************
*** 108,117 ****
--- 108,121 ----
{ java_awt_event_KeyEvent_VK_ESCAPE, XK_Escape, FALSE },
{ java_awt_event_KeyEvent_VK_SPACE, XK_space, TRUE },
+ #ifndef SUNOS4
{ java_awt_event_KeyEvent_VK_PAGE_UP, XK_Page_Up, FALSE },
+ #endif
{ java_awt_event_KeyEvent_VK_PAGE_UP, XK_R9, FALSE },
{ java_awt_event_KeyEvent_VK_PAGE_UP, XK_Prior, FALSE },
+ #ifndef SUNOS4
{ java_awt_event_KeyEvent_VK_PAGE_DOWN, XK_Page_Down, FALSE },
+ #endif
{ java_awt_event_KeyEvent_VK_PAGE_DOWN, XK_R15, FALSE },
{ java_awt_event_KeyEvent_VK_PAGE_DOWN, XK_Next, FALSE },
{ java_awt_event_KeyEvent_VK_END, XK_R13, FALSE },
***************
*** 164,170 ****
--- 168,176 ----
{ java_awt_event_KeyEvent_VK_DECIMAL, XK_KP_Decimal, TRUE },
{ java_awt_event_KeyEvent_VK_DIVIDE, XK_KP_Divide, TRUE },
{ java_awt_event_KeyEvent_VK_EQUALS, XK_KP_Equal, TRUE },
+ #ifndef SUNOS4
{ java_awt_event_KeyEvent_VK_INSERT, XK_KP_Insert, FALSE },
+ #endif
{ java_awt_event_KeyEvent_VK_ENTER, XK_KP_Enter, FALSE },
{ java_awt_event_KeyEvent_VK_F1, XK_F1, FALSE },
***************
*** 181,187 ****
--- 187,195 ----
{ java_awt_event_KeyEvent_VK_F12, XK_F12, FALSE },
{ java_awt_event_KeyEvent_VK_DELETE, XK_Delete, TRUE },
+ #ifndef SUNOS4
{ java_awt_event_KeyEvent_VK_DELETE, XK_KP_Delete, TRUE },
+ #endif
{ java_awt_event_KeyEvent_VK_NUM_LOCK, XK_Num_Lock, FALSE },
{ java_awt_event_KeyEvent_VK_SCROLL_LOCK, XK_Scroll_Lock, FALSE },
***************
*** 673,678 ****
--- 681,687 ----
case XK_R9:
keysym = XK_KP_9;
break;
+ #ifndef SUNOS4
case XK_KP_Insert:
keysym = XK_KP_0;
break;
***************
*** 679,684 ****
--- 688,694 ----
case XK_KP_Delete:
keysym = XK_KP_Decimal;
break;
+ #endif
case XK_R4:
keysym = XK_KP_Equal;
break;
*** ./src/sunos/net/socket.c.orig Fri Feb 7 20:06:44 1997
--- ./src/sunos/net/socket.c Thu Aug 7 17:14:09 1997
***************
*** 24,31 ****
--- 24,36 ----
#include
#include
#include
+ #ifndef SUNOS4
#include
#include
+ #else
+ extern char *strerror(int);
+ #define IP_MULTICAST_IF 0x10 /* SunOS has no multicast */
+ #endif
#ifndef TCP_NODELAY
#include
*** ./src/sunos/net/multicast.c.orig Fri Feb 7 20:06:42 1997
--- ./src/sunos/net/multicast.c Thu Aug 7 17:14:09 1997
***************
*** 24,30 ****
--- 24,34 ----
#include
#include
#include
+ #ifndef SUNOS4
#include
+ #else
+ extern char *strerror(int);
+ #endif
#include
#include
#include
***************
*** 45,51 ****
--- 49,57 ----
struct Hjava_net_InetAddress *mcast_address)
{
struct sockaddr_in name;
+ #ifndef SUNOS4
struct ip_mreq mname;
+ #endif
Classjava_net_InetAddress *addrptr;
Classjava_net_PlainDatagramSocketImpl *thisptr = unhand(this);
Classjava_io_FileDescriptor *fdptr = unhand(thisptr->fd);
***************
*** 60,65 ****
--- 66,74 ----
return;
}
+ #ifdef SUNOS4
+ SignalError(0, JAVANETPKG "SocketException", "multicast not supported");
+ #else
addrptr = unhand(mcast_address);
/* Set the multicast group address in the ip_mreq field */
***************
*** 82,87 ****
--- 91,97 ----
SignalError(0, JAVANETPKG "SocketException", strerror(errno));
}
}
+ #endif
return;
}
***************
*** 89,95 ****
--- 99,107 ----
struct Hjava_net_InetAddress *mcast_address)
{
struct sockaddr_in name;
+ #ifndef SUNOS4
struct ip_mreq mname;
+ #endif
Classjava_net_InetAddress *addrptr;
Classjava_net_PlainDatagramSocketImpl *thisptr = unhand(this);
Classjava_io_FileDescriptor *fdptr = unhand(thisptr->fd);
***************
*** 104,109 ****
--- 116,124 ----
return;
}
+ #ifdef SUNOS4
+ SignalError(0, JAVANETPKG "SocketException", "multicast not supported");
+ #else
addrptr = unhand(mcast_address);
/* Set the multicast group address in the ip_mreq field */
***************
*** 126,131 ****
--- 141,147 ----
SignalError(0, JAVANETPKG "SocketException", strerror(errno));
}
}
+ #endif
return;
}
***************
*** 139,144 ****
--- 155,163 ----
return;
}
+ #ifdef SUNOS4
+ SignalError(0, JAVANETPKG "SocketException", "multicast not supported");
+ #else
/* setsockopt to be correct ttl */
if (setsockopt(fdptr->fd -1, IPPROTO_IP, IP_MULTICAST_TTL, (char*)&ttl,
sizeof (ttl)) < 0) {
***************
*** 146,151 ****
--- 165,171 ----
if (!(ee && exceptionOccurred(ee)))
SignalError(0, JAVANETPKG "SocketException", strerror(errno));
}
+ #endif
}
char java_net_PlainDatagramSocketImpl_getTTL(struct Hjava_net_PlainDatagramSocketImpl *this)
***************
*** 158,164 ****
SignalError(0, JAVAPKG "NullPointerException", "null FileDescriptor");
return -1;
}
!
/* getsockopt of ttl */
if (getsockopt(fdptr->fd -1, IPPROTO_IP, IP_MULTICAST_TTL, (char*)&ttl,
&len) < 0) {
--- 178,187 ----
SignalError(0, JAVAPKG "NullPointerException", "null FileDescriptor");
return -1;
}
! #ifdef SUNOS4
! SignalError(0, JAVANETPKG "SocketException", "multicast not supported");
! return -1;
! #else
/* getsockopt of ttl */
if (getsockopt(fdptr->fd -1, IPPROTO_IP, IP_MULTICAST_TTL, (char*)&ttl,
&len) < 0) {
***************
*** 168,173 ****
--- 191,197 ----
return -1;
}
return ttl;
+ #endif
}
*** /dev/null Fri Aug 8 14:35:01 1997
--- build/sunos/makefiles/Defs-sunos.gmk Thu Aug 7 17:14:10 1997
***************
*** 0 ****
--- 1,123 ----
+ #
+ # @(#)Defs-solaris.gmk 1.24 96/07/09
+ #
+ # Makefile to specify compiler flags for programs and libraries
+ # targeted to Solaris. Should not contain any rules.
+ #
+
+ ARCH = $(shell uname -p 2>/dev/null || arch)
+
+ # This default is redefined during a release build.
+ RELEASE = $(shell echo jdk1.1-`whoami`:`date '+%y/%m/%d-%H:%M'`)
+
+ # If -Xa is in CFLAGS_COMMON it will end up ahead of $(POPT) for the
+ # optimized build, and that ordering of the flags completely freaks
+ # out cc. Hence, -Xa is instead in each CFLAGS variant.
+ ifneq ($(CC_VERSION), gcc)
+ CFLAGS_COMMON = -v
+ CFLAGS_OPT = -Xa $(POPT)
+ CFLAGS_DBG = -Xa -g
+ else
+ CFLAGS_COMMON =
+ #CFLAGS_OPT = $(POPT)
+ CFLAGS_OPT = -O3
+ ifeq ($(STRIP), true)
+ CFLAGS_DBG =
+ else
+ CFLAGS_DBG = -g
+ endif
+ endif
+
+ #
+ # Optional global flags with defaults: turn on from command line like
+ #
+ # % gnumake THREADS_FLAG=native
+ #
+
+ # By default use green threads
+ THREADS_FLAG = green
+
+ ifeq ($(THREADS_FLAG), native)
+ CFLAGS_COMMON += -D_REENTRANT -DNATIVE
+ endif
+
+ # By default, gprof support is off
+ GPROF = false
+
+ ifeq ($(GPROF), true)
+ CFLAGS_COMMON += -DGPROF -xpg
+ endif
+
+ # turn JCOV on
+ JCOV = true
+
+ ifeq ($(JCOV), true)
+ ifeq ($(VARIANT), DBG)
+ CFLAGS_COMMON += -DJCOV
+ endif
+ endif
+
+ # Java memory management is based on memory mapping by default, but a
+ # system only assuming malloc/free can be built by adding -DUSE_MALLOC
+
+ ifneq ($(CC_VERSION), gcc)
+ CPPFLAGS_COMMON = -D$(ARCH) -DSUNOS4 -DRELEASE='"$(RELEASE)"'
+ else
+ CPPFLAGS_COMMON = -D$(ARCH) -DHAVE_ALIGNED_LONGLONGS -DHAVE_ALIGNED_DOUBLES -DSUNOS4 -DRELEASE='"$(RELEASE)"'
+ endif
+ CPPFLAGS_OPT = -DTRIMMED
+ CPPFLAGS_DBG = -DDEBUG -DTRACING -DBREAKPTS
+
+ ASFLAGS_COMMON = -P
+ ASFLAGS_OPT =
+ ASFLAGS_DBG =
+
+ LDFLAGS_COMMON =
+ LDFLAGS_OPT =
+ LDFLAGS_DBG =
+
+ LDLIBS_COMMON =
+ LDLIBS_OPT =
+ LDLIBS_DBG =
+
+ ifeq ($(THREADS_FLAG),native)
+ LDLIBS_COMMON += -lthread
+ endif
+
+ ifeq ($(GPROF), true)
+ LDLIBS_COMMON += -xpg
+ endif
+
+ #
+ # Java variations
+ #
+ ifeq ($(PRODUCT), java)
+ # Java default optimization -x04
+ ifneq ($(CC_VERSION), gcc)
+ _OPT = -xO4
+ else
+ _OPT = -O3
+ endif
+ CPPFLAGS_DBG += -DLOGGING -DDBINFO
+ ASFLAGS_COMMON += -D_ASM
+ # LDLIBS_COMMON += -lm -ldl
+ endif
+
+
+ #
+ # Tools
+ #
+ ifneq ($(CC_VERSION), gcc)
+ CC = cc
+ CPP = cc -E
+ else
+ CC = gcc
+ CPP = gcc -E
+ endif
+ AS = as
+ LD = ld
+
+ OPENWINHOME = /usr/openwin
+
+ LIBRARY_SUFFIX = so
+
*** /dev/null Fri Aug 8 14:35:01 1997
--- build/sunos/java/main/referenceX.c Thu Aug 7 17:14:10 1997
***************
*** 0 ****
--- 1,12 ----
+ #if defined(SUNOS4)
+ void referenceXstuff(void) {
+ /* this is never called, but is in here to get the loader to pull up
+ libXm, libXt, libXext, and libX11 */
+ #ifdef USE_MOTIF
+ XmActivateProtocol();
+ #endif
+ XtInitialize();
+ XextFindDisplay();
+ XServerVendor();
+ }
+ #endif