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

Contents of /src/code/mach.lisp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations)
Fri Jan 24 04:31:37 1992 UTC (22 years, 2 months ago) by wlott
Branch: MAIN
Initial revision
1 wlott 1.1 ;;; -*- Package: MACH -*-
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.lisp,v 1.1 1992/01/24 04:31:37 wlott Exp $")
11     ;;;
12     ;;; **********************************************************************
13     ;;;
14     ;;; This file contains the low-level support for MACH features not found
15     ;;; in UNIX.
16     ;;;
17    
18     (in-package "MACH")
19     (use-package "ALIEN")
20     (use-package "C-CALL")
21     (use-package "SYSTEM")
22    
23     (export '(
24     port mach-task_self mach-task_data mach-task_notify
25     vm_allocate vm_copy vm_deallocate vm_statistics))
26    
27     (def-alien-type port int)
28    
29    
30     ;;;; Standard ports.
31    
32     (def-alien-routine ("task_self" mach-task_self) int)
33     (def-alien-routine ("thread_reply" mach-task_data) int)
34     (def-alien-routine ("task_notify" mach-task_notify) int)
35    
36    
37    
38     ;;;; VM routines.
39    
40     (export '(vm_allocate vm_copy vm_deallocate vm_statistics))
41    
42     (def-alien-routine ("vm_allocate" vm_allocate) int
43     (task port)
44     (address system-area-pointer :in-out)
45     (size unsigned-long)
46     (anywhere boolean))
47    
48     (def-alien-routine ("vm_copy" vm_copy) int
49     (task port)
50     (source system-area-pointer)
51     (count unsigned-long)
52     (dest system-area-pointer))
53    
54     (def-alien-routine ("vm_deallocate" vm_deallocate) int
55     (task port)
56     (address system-area-pointer)
57     (size unsigned-long))
58    
59    
60     (def-alien-type nil
61     (struct vm_statistics
62     (pagesize long)
63     (free_count long)
64     (active_count long)
65     (inactive_count long)
66     (wire_count long)
67     (zero_fill_count long)
68     (reactivations long)
69     (pageins long)
70     (pageouts long)
71     (faults long)
72     (cow_faults long)
73     (lookups long)
74     (hits long)))
75    
76     (defun vm_statistics (task)
77     (with-alien ((vm_stats (struct vm_statistics)))
78     (values
79     (alien-funcall (extern-alien "vm_statistics"
80     (function int
81     port
82     (* (struct vm_statistics))))
83     task (alien-sap vm_stats))
84     (slot vm_stats 'pagesize)
85     (slot vm_stats 'free_count)
86     (slot vm_stats 'active_count)
87     (slot vm_stats 'inactive_count)
88     (slot vm_stats 'wire_count)
89     (slot vm_stats 'zero_fill_count)
90     (slot vm_stats 'reactivations)
91     (slot vm_stats 'pageins)
92     (slot vm_stats 'pageouts)
93     (slot vm_stats 'faults)
94     (slot vm_stats 'cow_faults)
95     (slot vm_stats 'lookups)
96     (slot vm_stats 'hits))))

  ViewVC Help
Powered by ViewVC 1.1.5