Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
cmucl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Carl Shapiro
cmucl
Commits
3c78ebec
Commit
3c78ebec
authored
16 years ago
by
rtoy
Browse files
Options
Downloads
Patches
Plain Diff
o Add a VOP that runs the cpuid instruction and returns the results.
o Add the function VM::CPUID to return the raw results.
parent
b14ffba7
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
compiler/x86/system.lisp
+55
-1
55 additions, 1 deletion
compiler/x86/system.lisp
with
55 additions
and
1 deletion
compiler/x86/system.lisp
+
55
−
1
View file @
3c78ebec
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;;
;;;
(
ext:file-comment
(
ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/x86/system.lisp,v 1.1
3
200
3
/0
3/23 21:23:41 gerd
Exp $"
)
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/x86/system.lisp,v 1.1
4
200
9
/0
1/09 14:16:09 rtoy
Exp $"
)
;;;
;;;
;;; **********************************************************************
;;; **********************************************************************
;;;
;;;
...
@@ -606,3 +606,57 @@
...
@@ -606,3 +606,57 @@
#+
pentium
#+
pentium
(
defun
read-cycle-counter
()
(
defun
read-cycle-counter
()
(
read-cycle-counter
))
(
read-cycle-counter
))
(
defknown
cpuid
((
unsigned-byte
32
))
(
values
(
unsigned-byte
32
)
(
unsigned-byte
32
)
(
unsigned-byte
32
)
(
unsigned-byte
32
))
())
(
define-vop
(
cpuid
)
(
:policy
:fast-safe
)
(
:translate
cpuid
)
(
:args
(
level
:scs
(
unsigned-reg
)
:to
:result
))
(
:arg-types
unsigned-num
)
(
:results
(
a
:scs
(
unsigned-reg
))
(
b
:scs
(
unsigned-reg
))
(
c
:scs
(
unsigned-reg
))
(
d
:scs
(
unsigned-reg
)))
(
:result-types
unsigned-num
unsigned-num
unsigned-num
unsigned-num
)
;; Not sure about these :from/:to values.
(
:temporary
(
:sc
unsigned-reg
:offset
eax-offset
:to
(
:result
0
))
eax
)
(
:temporary
(
:sc
unsigned-reg
:offset
ebx-offset
:to
(
:result
1
))
ebx
)
(
:temporary
(
:sc
unsigned-reg
:offset
ecx-offset
:to
(
:result
2
))
ecx
)
(
:temporary
(
:sc
unsigned-reg
:offset
edx-offset
:to
(
:result
3
))
edx
)
(
:temporary
(
:sc
unsigned-stack
)
eax-stack
)
(
:temporary
(
:sc
unsigned-stack
)
ebx-stack
)
(
:temporary
(
:sc
unsigned-stack
)
ecx-stack
)
(
:temporary
(
:sc
unsigned-stack
)
edx-stack
)
(
:generator
10
(
move
eax
level
)
(
inst
cpuid
)
;; Don't know where a, b, c, d are, so we save the results of
;; cpuid to the stack and then copy the stack values to the result
;; registers.
(
move
eax-stack
eax
)
(
move
ebx-stack
ebx
)
(
move
ecx-stack
ecx
)
(
move
edx-stack
edx
)
(
move
a
eax-stack
)
(
move
b
ebx-stack
)
(
move
c
ecx-stack
)
(
move
d
edx-stack
)))
(
defun
cpuid
(
level
)
(
declare
(
type
(
unsigned-byte
32
)
level
))
(
cpuid
level
))
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment