/[cmucl]/src/code/mach-os.lisp
ViewVC logotype

Contents of /src/code/mach-os.lisp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.10 - (show annotations)
Sun Feb 7 21:17:31 1993 UTC (21 years, 2 months ago) by wlott
Branch: MAIN
Changes since 1.9: +1 -4 lines
Moved foreign-segment-{start,size} from mumble-os.lisp into foreign.lisp.
1 ;;; -*- Package: SYSTEM -*-
2 ;;;
3 ;;; **********************************************************************
4 ;;; This code was written as part of the CMU Common Lisp project at
5 ;;; Carnegie Mellon University, and has been placed in the public domain.
6 ;;; If you want to use this code or any part of CMU Common Lisp, please contact
7 ;;; Scott Fahlman or slisp-group@cs.cmu.edu.
8 ;;;
9 (ext:file-comment
10 "$Header: /tiger/var/lib/cvsroots/cmucl/src/code/mach-os.lisp,v 1.10 1993/02/07 21:17:31 wlott Exp $")
11 ;;;
12 ;;; **********************************************************************
13 ;;;
14 ;;; OS interface functions for CMU CL under Mach.
15 ;;;
16 ;;; Written and maintained mostly by Skef Wholey and Rob MacLachlan.
17 ;;; Scott Fahlman, Dan Aronson, and Steve Handerson did stuff here, too.
18 ;;;
19 (in-package "SYSTEM")
20 (use-package "EXTENSIONS")
21 (export '(get-system-info get-page-size os-init))
22 (export '(*task-self* *task-data* *task-notify*))
23
24 (pushnew :mach *features*)
25 (setq *software-type* "MACH/4.3BSD")
26
27 (defun software-version ()
28 "Returns a string describing version of the supporting software."
29 (string-trim '(#\newline)
30 (with-output-to-string (stream)
31 (run-program "/usr/cs/etc/version" ; Site dependent???
32 nil :output stream))))
33
34
35 ;;; OS-Init initializes our operating-system interface. It sets the values
36 ;;; of the global port variables to what they should be and calls the functions
37 ;;; that set up the argument blocks for the server interfaces.
38
39 (defvar *task-self*)
40
41 (defun os-init ()
42 (setf *task-self* (mach:mach-task_self)))
43
44
45 ;;; GET-SYSTEM-INFO -- Interface
46 ;;;
47 ;;; Return system time, user time and number of page faults. For
48 ;;; page-faults, we add pagein and pageout, since that is a somewhat more
49 ;;; interesting number than the total faults.
50 ;;;
51 (defun get-system-info ()
52 (multiple-value-bind (err? utime stime maxrss ixrss idrss
53 isrss minflt majflt)
54 (unix:unix-getrusage unix:rusage_self)
55 (declare (ignore maxrss ixrss idrss isrss minflt majflt))
56 (unless err?
57 (error "Unix system call getrusage failed: ~A."
58 (unix:get-unix-error-msg utime)))
59
60 (multiple-value-bind (gr ps fc ac ic wc zf ra in ot)
61 (mach:vm_statistics *task-self*)
62 (declare (ignore ps fc ac ic wc zf ra))
63 (mach:gr-error 'mach:vm_statistics gr)
64
65 (values utime stime (+ in ot)))))
66
67
68 ;;; GET-PAGE-SIZE -- Interface
69 ;;;
70 ;;; Return the system page size.
71 ;;;
72 (defun get-page-size ()
73 (mach:gr-call* mach:vm_statistics *task-self*))
74

  ViewVC Help
Powered by ViewVC 1.1.5