;;;; -*- coding: utf-8; fill-column: 78 -*-
changes in sbcl-1.0.27 relative to 1.0.26:
* new port: support added for x86-64 OpenBSD. (thanks to Josh Elsasser)
+ * new port: support added for x86-64 Solaris. (thanks to Alex Viskovatoff)
* bug fix: a type error is signaled for attempts to use the LOOP
keyword ACROSS for a NIL value. (thanks to Daniel Lowe)
* bug fix: fix gc related interrupt handling bug on ppc (regression from
"-D_FILE_OFFSET_BITS=64")
#+(and x86-64 darwin)
'("-arch" "x86_64")
+ #+(and x86-64 sunos) '("-m64")
(list "-o"
(namestring tmp-a-dot-out)
(namestring tmp-c-source)))
#+win32
#.sb-posix:eacces)
-#-(or (and x86-64 linux) win32)
+#-(or (and x86-64 (or linux sunos)) win32)
(deftest fcntl.1
(let ((fd (sb-posix:open "/dev/null" sb-posix::o-nonblock)))
(= (sb-posix:fcntl fd sb-posix::f-getfl) sb-posix::o-nonblock))
t)
;; On AMD64/Linux O_LARGEFILE is always set, even though the whole
;; flag makes no sense.
-#+(and x86-64 linux)
+#+(and x86-64 (or linux sunos))
(deftest fcntl.1
(let ((fd (sb-posix:open "/dev/null" sb-posix::o-nonblock)))
(/= 0 (logand (sb-posix:fcntl fd sb-posix::f-getfl)
(delete-file temp))))
t "mkstemp-1")
-#-(or win32 sunos hpux)
-;;; mkdtemp is unimplemented on at least Solaris 10
+;#-(or win32 sunos hpux)
+;;;; mkdtemp is unimplemented on at least Solaris 10
+#-(or win32 hpux)
+;;; But it is implemented on OpenSolaris 2008.11
(deftest mkdtemp.1
(let ((pathname
(sb-ext:parse-native-namestring
;;
esac
+# Under Solaris, uname -m returns "i86pc" even if CPU is amd64.
+if [ "$sbcl_os" = "sunos" ] && [ `isainfo -k` = "amd64" ]; then
+ guessed_sbcl_arch=x86-64
+fi
+
echo //setting up CPU-architecture-dependent information
sbcl_arch=${SBCL_ARCH:-$guessed_sbcl_arch}
echo sbcl_arch=\"$sbcl_arch\"
printf ' :unix' >> $ltf
printf ' :elf' >> $ltf
printf ' :sunos' >> $ltf
- if [ $sbcl_arch = "x86" ]; then
+ if [ $sbcl_arch = "x86" ] || [ $sbcl_arch = "amd64" ]; then
printf ' :sb-lutex' >> $ltf
fi
link_or_copy Config.$sbcl_arch-sunos Config
;; disposable.
;; FIXME II: this could well be wrong
#!+sparc 8192
- #!+x86 4096)
+ #!+(or x86 x86-64) 4096)
--- /dev/null
+CC=gcc
+CFLAGS = -m64 -g -O2 -Wall -D__EXTENSIONS__ -D_POSIX_C_SOURCE=199506L -DSVR4 -D_REENTRANT -fno-omit-frame-pointer
+ASFLAGS = -m64 -Wall
+LD = ld
+LINKFLAGS = -m64 -g
+NM = nm -xgp
+GREP = ggrep
+
+#CC=/opt/SunStudioExpress/bin/cc
+#CFLAGS = -xarch=generic64 -g -O2 -Wall -D__EXTENSIONS__ -D_POSIX_C_SOURCE=199506L -DSVR4 -D_REENTRANT -fno-omit-frame-pointer
+#ASFLAGS = -xarch=generic64 -Wall
+
+ASSEM_SRC = x86-64-assem.S ldso-stubs.S
+ARCH_SRC = x86-64-arch.c
+
+OS_SRC = sunos-os.c x86-64-sunos-os.c os-common.c
+OS_LIBS= -ldl -lsocket -lnsl -lrt
+
+GC_SRC= gencgc.c
+
+# Nothing to do for after-grovel-headers.
+.PHONY: after-grovel-headers
+after-grovel-headers:
#define _SPARC_SOLARIS_OS_H
typedef ucontext_t os_context_t;
+typedef int os_context_register_t ;
static inline os_context_t *arch_os_get_context(void **void_context)
{
#if defined LISP_FEATURE_SPARC
#define OS_VM_DEFAULT_PAGESIZE 8192
-#elif defined LISP_FEATURE_X86
+#elif defined LISP_FEATURE_X86 || defined LISP_FEATURE_X86_64
#define OS_VM_DEFAULT_PAGESIZE 4096
#else
#error "Don't know OS_VM_DEFAULT_PAGESIZE"
#define SIG_MEMORY_FAULT SIGSEGV
#define SIG_STOP_FOR_GC (SIGUSR2)
-
-/* Yaargh?! */
-typedef int os_context_register_t ;
-
os_context_register_t *
context_eflags_addr(os_context_t *context)
{
-#if defined __linux__
+#if defined __linux__ || defined __sun
/* KLUDGE: As of kernel 2.2.14 on Red Hat 6.2, there's code in the
* <sys/ucontext.h> file to define symbolic names for offsets into
* gregs[], but it's conditional on __USE_GNU and not defined, so
#include "genesis/thread.h"
/* Minimize conditionalization for different OS naming schemes. */
-#if defined __linux__ || defined __FreeBSD__ || defined __OpenBSD__
+#if defined __linux__ || defined __FreeBSD__ || defined __OpenBSD__ || defined __sun
#define GNAME(var) var
#else
#define GNAME(var) _##var
/* Get the right type of alignment. Linux, FreeBSD and OpenBSD
* want alignment in bytes. */
-#if defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__)
+#if defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__sun)
#define align_4byte 4
#define align_8byte 8
#define align_16byte 16
--- /dev/null
+#include <stdio.h>
+#include <sys/param.h>
+#include <sys/file.h>
+#include "sbcl.h"
+#include "./signal.h"
+#include "os.h"
+#include "arch.h"
+#include "globals.h"
+#include "interrupt.h"
+#include "interr.h"
+#include "lispregs.h"
+#include <sys/socket.h>
+#include <sys/utsname.h>
+
+#include <sys/types.h>
+#include <signal.h>
+#include <sys/time.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+#ifdef LISP_FEATURE_SB_THREAD
+#error "Threading is not supported for Solaris running on x86-64."
+#endif
+
+#include "validate.h"
+
+
+int arch_os_thread_init(struct thread *thread) {
+ stack_t sigstack;
+ return 1;
+}
+
+int arch_os_thread_cleanup(struct thread *thread) {
+ return 1;
+}
+
+
+os_context_register_t *
+os_context_register_addr(os_context_t *context, int offset)
+{
+#define RCASE(name) case reg_ ## name: return &context->uc_mcontext.gregs[REG_ ## name];
+ switch(offset) {
+ RCASE(RAX)
+ RCASE(RCX)
+ RCASE(RDX)
+ RCASE(RBX)
+ RCASE(RSP)
+ RCASE(RBP)
+ RCASE(RSI)
+ RCASE(RDI)
+ RCASE(R8)
+ RCASE(R9)
+ RCASE(R10)
+ RCASE(R11)
+ RCASE(R12)
+ RCASE(R13)
+ RCASE(R14)
+ RCASE(R15)
+ default:
+ if(offset<NGREG)
+ return &context->uc_mcontext.gregs[offset/2+4];
+ else return 0;
+ }
+ return &context->uc_mcontext.gregs[offset];
+}
+
+os_context_register_t *
+os_context_pc_addr(os_context_t *context)
+{
+ return &context->uc_mcontext.gregs[REG_RIP];
+}
+
+os_context_register_t *
+os_context_sp_addr(os_context_t *context)
+{
+ return &context->uc_mcontext.gregs[REG_RSP];
+}
+
+sigset_t *
+os_context_sigmask_addr(os_context_t *context)
+{
+ return &(context->uc_sigmask);
+}
+
+void os_flush_icache(os_vm_address_t address, os_vm_size_t length)
+{
+}
+
+unsigned long
+os_context_fp_control(os_context_t *context)
+{
+ return context->uc_mcontext.fpregs.fp_reg_set.fpchip_state.cw;
+}
--- /dev/null
+#ifndef _X86_64_SOLARIS_OS_H
+#define _X86_64_SOLARIS_OS_H
+
+typedef struct ucontext os_context_t;
+typedef long os_context_register_t;
+
+static inline os_context_t *arch_os_get_context(void **void_context)
+{
+ return (os_context_t *) *void_context;
+}
+
+#endif /* _X86_64_SOLARIS_OS_H */
#define _X86_SOLARIS_OS_H
typedef ucontext_t os_context_t;
+typedef int os_context_register_t;
static inline os_context_t *arch_os_get_context(void **void_context)
{
;;; checkins which aren't released. (And occasionally for internal
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"1.0.26.17"
+"1.0.26.18"