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
e7d07412
Commit
e7d07412
authored
19 years ago
by
rtoy
Browse files
Options
Downloads
Patches
Plain Diff
Move the Darwin-specific timebase_init stuff from lisp.c to Darwin-os.c,
where it belongs.
parent
e96ee310
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lisp/Darwin-os.c
+53
-1
53 additions, 1 deletion
lisp/Darwin-os.c
lisp/lisp.c
+1
-51
1 addition, 51 deletions
lisp/lisp.c
with
54 additions
and
52 deletions
lisp/Darwin-os.c
+
53
−
1
View file @
e7d07412
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
* Frobbed for OpenBSD by Pierre R. Mai, 2001.
* Frobbed for OpenBSD by Pierre R. Mai, 2001.
* Frobbed for Darwin by Pierre R. Mai, 2003.
* Frobbed for Darwin by Pierre R. Mai, 2003.
*
*
* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/Darwin-os.c,v 1.
3
2005/0
6
/0
1
13:
30:16
rtoy Exp $
* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/Darwin-os.c,v 1.
4
2005/0
9
/0
6
13:
05:58
rtoy Exp $
*
*
*/
*/
...
@@ -34,6 +34,10 @@
...
@@ -34,6 +34,10 @@
#include
<signal.h>
#include
<signal.h>
/* #include <sys/sysinfo.h> */
/* #include <sys/sysinfo.h> */
/* #include <sys/proc.h> */
/* #include <sys/proc.h> */
/* For timebase info */
#include
<sys/param.h>
#include
<sys/sysctl.h>
/* Need this to define ppc_saved_state_t (for 10.4) */
/* Need this to define ppc_saved_state_t (for 10.4) */
#include
<mach/thread_status.h>
#include
<mach/thread_status.h>
...
@@ -43,10 +47,58 @@ vm_size_t os_vm_page_size;
...
@@ -43,10 +47,58 @@ vm_size_t os_vm_page_size;
#define DPRINTF(t,a) {if (t) fprintf a;}
#define DPRINTF(t,a) {if (t) fprintf a;}
/*
* This is accessed by Lisp! Make this a static symbol?
*/
int
cycles_per_tick
=
1
;
/*
* Compute the conversion factor from the numbef of time base ticks to
* clock frequency. The timebase counter on PPC is not a cycle
* counter; we have to derive the relationship ourselves.
*/
void
timebase_init
()
{
int
mib
[
2
];
int
tbfrequency
;
int
cpufrequency
;
unsigned
int
miblen
;
size_t
len
;
mib
[
0
]
=
CTL_HW
;
#ifndef HW_TB_FREQ
/*
* Mac OS X 10.2.8 doesn't have this, so we take it from 10.3.8,
* which does.
*/
#define HW_TB_FREQ 23
#endif
mib
[
1
]
=
HW_TB_FREQ
;
miblen
=
2
;
len
=
sizeof
(
tbfrequency
);
if
(
sysctl
(
mib
,
miblen
,
&
tbfrequency
,
&
len
,
NULL
,
0
)
==
-
1
)
{
perror
(
"Error getting HW_TB_FREQ from sysctl: "
);
}
mib
[
0
]
=
CTL_HW
;
mib
[
1
]
=
HW_CPU_FREQ
;
miblen
=
2
;
len
=
sizeof
(
cpufrequency
);
if
(
sysctl
(
mib
,
miblen
,
&
cpufrequency
,
&
len
,
NULL
,
0
)
==
-
1
)
{
perror
(
"Error getting HW_CPU_FREQ from sysctl: "
);
}
cycles_per_tick
=
cpufrequency
/
tbfrequency
;
}
void
os_init
(
void
)
void
os_init
(
void
)
{
{
os_vm_page_size
=
OS_VM_DEFAULT_PAGESIZE
;
os_vm_page_size
=
OS_VM_DEFAULT_PAGESIZE
;
timebase_init
();
}
}
int
os_get_errno
(
void
)
int
os_get_errno
(
void
)
...
...
This diff is collapsed.
Click to expand it.
lisp/lisp.c
+
1
−
51
View file @
e7d07412
/*
/*
* main() entry point for a stand alone lisp image.
* main() entry point for a stand alone lisp image.
*
*
* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/lisp.c,v 1.4
8
2005/09/06
01:33:29 cshapiro
Exp $
* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/lisp.c,v 1.4
9
2005/09/06
13:05:58 rtoy
Exp $
*
*
*/
*/
...
@@ -394,53 +394,6 @@ prepend_core_path(char* lib, char* corefile)
...
@@ -394,53 +394,6 @@ prepend_core_path(char* lib, char* corefile)
int
builtin_image_flag
=
0
;
int
builtin_image_flag
=
0
;
long
initial_function_addr
=
0
;
long
initial_function_addr
=
0
;
#ifdef DARWIN
#include
<sys/param.h>
#include
<sys/sysctl.h>
int
cycles_per_tick
=
1
;
/*
* Compute the conversion factor from the numbef of time base ticks to
* clock frequency. The timebase counter on PPC is not a cycle
* counter; we have to derive the relationship ourselves.
*/
void
timebase_init
()
{
int
mib
[
2
];
int
tbfrequency
;
int
cpufrequency
;
unsigned
int
miblen
;
size_t
len
;
mib
[
0
]
=
CTL_HW
;
#ifndef HW_TB_FREQ
/*
* Mac OS X 10.2.8 doesn't have this, so we take it from 10.3.8,
* which does.
*/
#define HW_TB_FREQ 23
#endif
mib
[
1
]
=
HW_TB_FREQ
;
miblen
=
2
;
len
=
sizeof
(
tbfrequency
);
if
(
sysctl
(
mib
,
miblen
,
&
tbfrequency
,
&
len
,
NULL
,
0
)
==
-
1
)
{
perror
(
"Error getting HW_TB_FREQ from sysctl: "
);
}
mib
[
0
]
=
CTL_HW
;
mib
[
1
]
=
HW_CPU_FREQ
;
miblen
=
2
;
len
=
sizeof
(
cpufrequency
);
if
(
sysctl
(
mib
,
miblen
,
&
cpufrequency
,
&
len
,
NULL
,
0
)
==
-
1
)
{
perror
(
"Error getting HW_CPU_FREQ from sysctl: "
);
}
cycles_per_tick
=
cpufrequency
/
tbfrequency
;
}
#endif
/* And here be main. */
/* And here be main. */
int
main
(
int
argc
,
char
*
argv
[],
char
*
envp
[])
int
main
(
int
argc
,
char
*
argv
[],
char
*
envp
[])
...
@@ -746,9 +699,6 @@ int main(int argc, char *argv[], char *envp[])
...
@@ -746,9 +699,6 @@ int main(int argc, char *argv[], char *envp[])
*/
*/
sigint_init
();
sigint_init
();
#ifdef DARWIN
timebase_init
();
#endif
if
(
monitor
)
{
if
(
monitor
)
{
while
(
1
)
{
while
(
1
)
{
ldb_monitor
();
ldb_monitor
();
...
...
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