Checked in DG/UX port contributed by Marc Fraioli <fraioli@dg-rtp.dg.com>.

New files: dgux.mk, _dgux.cfg, _dgux.h, and dgux.c.
Files changed: lib/msgc/tests/Makefile, pr/include/md/Makefile,
_unixos.h, prosdep.h, prsocket.c, pr/src/md/unix/Makefile,
pr/src/md/unix/objs.mk, unix.c.
This commit is contained in:
wtc%netscape.com 1998-08-11 22:29:48 +00:00
Родитель c3dff13df9
Коммит fc47bba6a3
12 изменённых файлов: 442 добавлений и 10 удалений

42
nsprpub/config/dgux.mk Normal file
Просмотреть файл

@ -0,0 +1,42 @@
#
# 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 Data General DG/UX
#
# Initial DG/UX port by Marc Fraioli <fraioli@dg-rtp.dg.com>
#
include $(MOD_DEPTH)/config/UNIX.mk
CC = gcc
CCC = g++
RANLIB = true
DEFINES += -D_PR_LOCAL_THREADS_ONLY
OS_CFLAGS = -DSVR4 -DSYSV -DDGUX -D_DGUX_SOURCE -D_POSIX4A_DRAFT6_SOURCE
MKSHLIB = $(LD) $(DSO_LDOPTS)
DSO_LDOPTS = -G
CPU_ARCH = x86
ARCH = dgux
NOSUCHFILE = /no-such-file
OPTIMIZER =

Просмотреть файл

@ -212,6 +212,10 @@ ifeq ($(OS_ARCH),BSD_OS)
EXTRA_LIBS = -ldl
endif
ifeq ($(OS_ARCH),dgux)
EXTRA_LIBS = -lsocket -lnsl -ldl
endif
#####################################################
#
# The rules

Просмотреть файл

@ -107,6 +107,10 @@ ifeq ($(OS_ARCH),NCR)
MDCPUCFG_H = _ncr.cfg
endif
ifeq ($(OS_ARCH),dgux)
MDCPUCFG_H = _dgux.cfg
endif
export:: $(HEADERS) $(MDCPUCFG_H)
$(INSTALL) -m 444 $(HEADERS) $(DIST)/include/md
$(INSTALL) -m 444 $(MDCPUCFG_H) $(DIST)/include

Просмотреть файл

@ -0,0 +1,121 @@
/* -*- 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 DGUX
#define DGUX
#endif
#define IS_LITTLE_ENDIAN 1
#undef IS_BIG_ENDIAN
#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
#define _PR_USE_POLL
#define _PR_POLL_AVAILABLE
#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___ */

Просмотреть файл

@ -0,0 +1,162 @@
/* -*- 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_dgux_defs_h___
#define nspr_dgux_defs_h___
/*
* Internal configuration macros
*/
#define PR_LINKER_ARCH "dgux"
#define _PR_SI_SYSNAME "DGUX"
#define _PR_SI_ARCHITECTURE "x86"
#define PR_DLL_SUFFIX ".so"
#define _PR_VMBASE 0x30000000
#define _PR_STACK_VMBASE 0x50000000
#define _MD_DEFAULT_STACK_SIZE 65536L
#define _MD_MMAP_FLAGS MAP_PRIVATE
#ifndef HAVE_WEAK_IO_SYMBOLS
#define HAVE_WEAK_IO_SYMBOLS
#endif
#undef HAVE_STACK_GROWING_UP
#define HAVE_NETCONFIG
#define HAVE_DLL
#define USE_DLFCN
#define NEED_STRFTIME_LOCK
#define NEED_TIME_R
#define _PR_NEED_STRCASECMP
#define USE_SETJMP
#include <setjmp.h>
#define _SETJMP setjmp
#define _LONGJMP longjmp
#define _PR_CONTEXT_TYPE jmp_buf
#define _MD_GET_SP(_t) (_t)->md.context[4]
#define _PR_NUM_GCREGS _JBLEN
#define CONTEXT(_th) ((_th)->md.context)
/*
** Initialize the thread context preparing it to execute _main.
*/
#define _MD_INIT_CONTEXT(_thread, _sp, _main, status) \
{ \
*status = PR_TRUE; \
if(_SETJMP(CONTEXT(_thread))) (*_main)(); \
_MD_GET_SP(_thread) = (int) ((_sp) - 128); \
}
#define _MD_SWITCH_CONTEXT(_thread) \
if (!_SETJMP(CONTEXT(_thread))) { \
(_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); \
_LONGJMP(CONTEXT(_thread), 1); \
}
/* Machine-dependent (MD) data structures.
* Don't use SVR4 native threads (yet).
*/
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()
/*
* The following are copied from _sunos.h, _aix.h. This means
* some of them should probably be moved into _unixos.h. But
* _irix.h seems to be quite different in regard to these macros.
*/
#define _MD_GET_INTERVAL _PR_UNIX_GetInterval
#define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond
#define _MD_EARLY_INIT _MD_EarlyInit
#define _MD_FINAL_INIT _PR_UnixInit
#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)
#define _MD_RESUME_THREAD(thread)
#define _MD_CLEAN_THREAD(_thread)
/*
* We wrapped the select() call. _MD_SELECT refers to the built-in,
* unwrapped version.
*/
#include <unistd.h>
#include <sys/types.h>
#include <sys/time.h>
extern int _select(int nfds, fd_set *readfds, fd_set *writefds,
fd_set *execptfds, struct timeval *timeout);
#define _MD_SELECT _select
#define _MD_POLL _poll
#include <poll.h>
#include <stropts.h>
extern int _poll(struct pollfd *fds, unsigned long nfds, int timeout);
#endif /* nspr_dgux_defs_h___ */

Просмотреть файл

@ -50,7 +50,7 @@
|| defined(BSDI) || defined(SONY)
#include <sys/select.h>
#elif defined(SUNOS4) || defined(SCO) || defined(FREEBSD) \
|| defined(NETBSD) || defined(RHAPSODY)
|| defined(NETBSD) || defined(RHAPSODY) || defined(DGUX)
#include <sys/types.h>
#elif defined(LINUX)
#include <sys/time.h>

Просмотреть файл

@ -104,6 +104,9 @@ PR_BEGIN_EXTERN_C
#elif defined(NCR)
#include "md/_ncr.h"
#elif defined(DGUX)
#include "md/_dgux.h"
#else
#error unknown Unix flavor

Просмотреть файл

@ -18,16 +18,8 @@
#include "primpl.h"
#ifdef XP_UNIX
#include <fcntl.h>
#endif
#include <string.h>
#if defined(SVR4) || defined(SUNOS4)
/* To pick up FIONREAD */
#include <sys/filio.h>
#endif
/************************************************************************/
/* These two functions are only used in assertions. */

Просмотреть файл

@ -105,6 +105,10 @@ SCOOS_CSRCS = \
scoos.c \
$(NULL)
DGUX_CSRCS = \
dgux.c \
$(NULL)
ifeq ($(PTHREADS_USER),1)
CSRCS += $(PTH_USER_CSRCS)
endif
@ -163,6 +167,9 @@ endif
ifeq ($(OS_ARCH),SCOOS)
CSRCS += $(SCOOS_CSRCS)
endif
ifeq ($(OS_ARCH),dgux)
CSRCS += $(DGUX_CSRCS)
endif
#
# Some Unix platforms have an assembly language file.

Просмотреть файл

@ -0,0 +1,90 @@
/* -*- 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"
/*
* using only NSPR threads here
*
* Copied from the UnixWare implementation. Should be kept in sync
* with ../../../include/md/_dgux.h.
*/
#include <setjmp.h>
void _MD_EarlyInit(void)
{
}
PRWord *_MD_HomeGCRegisters(PRThread *t, int isCurrent, int *np)
{
if (isCurrent) {
(void) setjmp(CONTEXT(t));
}
*np = sizeof(CONTEXT(t)) / sizeof(PRWord);
return (PRWord *) CONTEXT(t);
}
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 DG/UX */
void
_MD_YIELD(void)
{
PR_NOT_REACHED("_MD_YIELD should not be called for DG/UX.");
}
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 DG/UX.");
}

Просмотреть файл

@ -97,6 +97,10 @@ SCOOS_CSRCS = \
scoos.c \
$(NULL)
DGUX_CSRCS = \
dgux.c \
$(NULL)
ifeq ($(PTHREADS_USER),1)
CSRCS += $(PTH_USER_CSRCS)
@ -156,6 +160,9 @@ endif
ifeq ($(OS_ARCH),SCOOS)
CSRCS += $(SCOOS_CSRCS)
endif
ifeq ($(OS_ARCH),dgux)
CSRCS += $(DGUX_CSRCS)
endif
#
# Some Unix platforms have an assembly language file.

Просмотреть файл

@ -48,7 +48,7 @@
|| defined(SUNOS4) || defined(NCR) || defined(RHAPSODY)
#define _PRSockLen_t int
#elif (defined(AIX) && !defined(AIX4_1)) || defined(FREEBSD) \
|| defined(NETBSD) || defined(UNIXWARE)
|| defined(NETBSD) || defined(UNIXWARE) || defined(DGUX)
#define _PRSockLen_t size_t
#else
#error "Cannot determine architecture"