[Openmcl-cvs-notifications] r10053 - in /trunk/source/level-1: l1-streams.lisp linux-files.lisp x86-trap-support.lisp
gb at clozure.com
gb at clozure.com
Wed Jul 16 10:23:17 EDT 2008
Author: gb
Date: Wed Jul 16 10:23:17 2008
New Revision: 10053
Log:
Conditionalize for Solaris.
Modified:
trunk/source/level-1/l1-streams.lisp
trunk/source/level-1/linux-files.lisp
trunk/source/level-1/x86-trap-support.lisp
Modified: trunk/source/level-1/l1-streams.lisp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/source/level-1/l1-streams.lisp (original)
+++ trunk/source/level-1/l1-streams.lisp Wed Jul 16 10:23:17 2008
@@ -27,7 +27,9 @@
#+darwinx8664-target
(require "DARWINX8664-SYSCALLS")
#+freebsdx8664-target
- (require "X8664-FREEBSD-SYSCALLS"))
+ (require "X8664-FREEBSD-SYSCALLS")
+ #+solarisx8664-target
+ (require "X8664-SOLARIS-SYSCALLS"))
=
;;;
=
Modified: trunk/source/level-1/linux-files.lisp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/source/level-1/linux-files.lisp (original)
+++ trunk/source/level-1/linux-files.lisp Wed Jul 16 10:23:17 2008
@@ -27,6 +27,8 @@
(require "DARWINX8664-SYSCALLS")
#+(and freebsd-target x8664-target)
(require "X8664-FREEBSD-SYSCALLS")
+ #+(and solaris-target x8664-target)
+ (require "X8664-SOLARIS-SYSCALLS")
)
=
=
@@ -265,16 +267,16 @@
t
(pref stat :stat.st_mode)
(pref stat :stat.st_size)
- #+linux-target
+ #+(or linux-target solaris-target)
(pref stat :stat.st_mtim.tv_sec)
- #-linux-target
+ #-(or linux-target solaris-target)
(pref stat :stat.st_mtimespec.tv_sec)
(pref stat :stat.st_ino)
(pref stat :stat.st_uid)
(pref stat :stat.st_blksize)
- #+linux-target
+ #+(or linux-target solaris-target)
(round (pref stat :stat.st_mtim.tv_nsec) 1000)
- #-linux-target
+ #-(or linux-target solaris-target)
(round (pref stat :stat.st_mtimespec.tv_nsec) 1000)
(pref stat :stat.st_gid))
(values nil nil nil nil nil nil nil)))
@@ -345,7 +347,8 @@
(if (eql 0 result)
(%get-cstring (%inc-ptr buf (* #+linux-target #$_UTSNAME_LENGTH
#+darwin-target #$_SYS_NAMELEN
- #+freebsd-target #$SYS_NMLN idx)))
+ #+(or freebsd-target solaris-target) #$=
SYS_NMLN
+ idx)))
"unknown"))
=
(defun copy-file-attributes (source-path dest-path)
@@ -392,11 +395,19 @@
(%stack-block ((buf (* #$SYS_NMLN 5)))
(%uts-string (#___xuname #$SYS_NMLN buf) idx buf)))
=
+#+solaris-target
+(defun %uname (idx)
+ (%stack-block ((buf (* #$SYS_NMLN 5)))
+ (%uts-string (#_uname buf) idx buf)))
+
(defun fd-dup (fd)
(syscall syscalls::dup fd))
=
(defun fd-fsync (fd)
- (syscall syscalls::fsync fd))
+ #-solaris-target
+ (syscall syscalls::fsync fd)
+ #+solaris-target
+ (syscall syscalls::fdsync fd #$FSYNC))
=
(defun fd-get-flags (fd)
(syscall syscalls::fcntl fd #$F_GETFL))
@@ -492,7 +503,11 @@
=
=
(defun %%rusage (usage &optional (who #$RUSAGE_SELF))
- (syscall syscalls::getrusage who usage))
+ #-solaris-target
+ (syscall syscalls::getrusage who usage)
+ #+solaris-target
+ (syscall syscalls::rusagesys #$_RUSAGESYS_GETRUSAGE who usage)
+ )
=
=
=
@@ -600,7 +615,7 @@
(%get-cstring p))))
=
;;; Kind of has something to do with files, and doesn't work in level-0.
-#+(or linux-target freebsd-target)
+#+(or linux-target freebsd-target solaris-target)
(defun close-shared-library (lib &key (completely t))
"If completely is T, set the reference count of library to 0. Otherwise,
decrements it by 1. In either case, if the reference count becomes 0,
@@ -933,7 +948,9 @@
:stopped
:signaled)
signal
- (logtest #$WCOREFLAG statusflags)))))
+ (logtest #-solaris-target #$WCOREFLAG
+ #+solaris-target #$WCOREFLG
+ statusflags)))))
(setf (external-process-%status p) status
(external-process-%exit-code p) code
(external-process-core p) core)
@@ -1248,11 +1265,12 @@
count))
(pref info :host_basic_info.max_cpus)
1))
- #+linux-target
+ #+(or linux-target solaris-target)
(or
(let* ((n (#_sysconf #$_SC_NPROCESSORS_ONLN)))
(declare (fixnum n))
(if (> n 0) n))
+ #+linux-target
(ignore-errors
(with-open-file (p "/proc/cpuinfo")
(let* ((ncpu 0)
Modified: trunk/source/level-1/x86-trap-support.lisp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/source/level-1/x86-trap-support.lisp (original)
+++ trunk/source/level-1/x86-trap-support.lisp Wed Jul 16 10:23:17 2008
@@ -127,6 +127,34 @@
13 ;r13
14 ;r14
15 ;r15
+ )))
+
+#+solarisx8664-target
+(progn
+ (defconstant gp-regs-offset (+ (get-field-offset :ucontext.uc_mcontext)
+ (get-field-offset :mcontext_t.gregs)))
+ (defmacro xp-gp-regs (xp) xp)
+ (defconstant flags-register-offset #$REG_RFL)
+ (defconstant rip-register-offset #$REG_RIP)
+ (defun xp-mxcsr (xp)
+ (pref xp :ucontext.uc_mcontext.fpregs.fp_reg_set.fpchip_state.mxcsr))
+ (defparameter *encoded-gpr-to-indexed-gpr*
+ #(14 ;rax
+ 13 ;rcx
+ 12 ;rdx
+ 11 ;rbx
+ 20 ;rsp
+ 10 ;rbp
+ 9 ;rsi
+ 8 ;rdi
+ 7 ;r8
+ 6 ;r9
+ 5 ;r10
+ 4 ;r11
+ 3 ;r12
+ 2 ;r13
+ 1 ;r14
+ 0 ;r15
)))
=
(defun indexed-gpr-lisp (xp igpr)
More information about the Openmcl-cvs-notifications
mailing list