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
89f6eb3f
Commit
89f6eb3f
authored
22 years ago
by
toy
Browse files
Options
Downloads
Patches
Plain Diff
Use \code{} instead of \verb to fix up some overlong lines.
parent
3120869f
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
docs/internals/design.tex
+1
-0
1 addition, 0 deletions
docs/internals/design.tex
docs/internals/lowlev.tex
+23
-23
23 additions, 23 deletions
docs/internals/lowlev.tex
with
24 additions
and
23 deletions
docs/internals/design.tex
+
1
−
0
View file @
89f6eb3f
...
@@ -67,6 +67,7 @@
...
@@ -67,6 +67,7 @@
\def\bottomfraction
{
.9
}
% was .3
\def\bottomfraction
{
.9
}
% was .3
\def\topfraction
{
.9
}
\def\topfraction
{
.9
}
\newcommand
{
\code
}
[1]
{
\textnormal
{{
\sffamily
#1
}}}
%% Some common abbreviations
%% Some common abbreviations
\newcommand
{
\cmucl
}{
\textsc
{
cmucl
}}
\newcommand
{
\cmucl
}{
\textsc
{
cmucl
}}
...
...
This diff is collapsed.
Click to expand it.
docs/internals/lowlev.tex
+
23
−
23
View file @
89f6eb3f
...
@@ -16,47 +16,47 @@ A table of functions is used which is filled in with the appropriate
...
@@ -16,47 +16,47 @@ A table of functions is used which is filled in with the appropriate
code to jump to the correct address.
code to jump to the correct address.
For
\cmucl
{}
, this table is stored at
For
\cmucl
{}
, this table is stored at
\
verb
|
target-foreign-linkage-space-start
|
. Each entry is
\
code
{
target-foreign-linkage-space-start
}
. Each entry is
\
verb
|
target-foreign-linkage-entry-size
|
bytes long.
\
code
{
target-foreign-linkage-entry-size
}
bytes long.
At startup, the table is initialized with default values in
At startup, the table is initialized with default values in
\
verb
|
os_foreign_linkage_init
|
. On x86 platforms, the first entry is
\
code
{
os
\
_
foreign
\
_
linkage
\
_
init
}
. On x86 platforms, the first entry is
code to call the routine
\
verb
|
resolve_linkage_tramp
|
. All other
code to call the routine
\
code
{
resolve
\
_
linkage
\
_
tramp
}
. All other
entries jump to the first entry. The function
entries jump to the first entry. The function
\
verb
|
resolve_linkage_tramp
|
looks at where it was called from to
\
code
{
resolve
\
_
linkage
\
_
tramp
}
looks at where it was called from to
figure out which entry in the table was used. It calls
figure out which entry in the table was used. It calls
\
verb
|
lazy_resolve_linkage
|
with the address of the linkage entry.
\
code
{
lazy
\
_
resolve
\
_
linkage
}
with the address of the linkage entry.
This routine then fills in the appropriate linkage entry with code to
This routine then fills in the appropriate linkage entry with code to
jump to where the real routine is located, and returns the address of
jump to where the real routine is located, and returns the address of
the entry. On return,
\
verb
|
resolve_linkage_tramp
|
then just jumps to
the entry. On return,
\
code
{
resolve
\
_
linkage
\
_
tramp
}
then just jumps to
the returned address to call the desired function. On all subsequent
the returned address to call the desired function. On all subsequent
calls, the entry no longer points to
\
verb
|
resolve_linkage_tramp
|
but
calls, the entry no longer points to
\
code
{
resolve
\
_
linkage
\
_
tramp
}
but
to the real function.
to the real function.
This describes how function calls are made. For foreign data,
This describes how function calls are made. For foreign data,
\
verb
|
lazy_resolve_linkage
|
stuffs the address of the actual foreign
\
code
{
lazy
\
_
resolve
\
_
linkage
}
stuffs the address of the actual foreign
data into the linkage table. The lisp code then just loads the address
data into the linkage table. The lisp code then just loads the address
from there to get the actual address of the foreign data.
from there to get the actual address of the foreign data.
For sparc, the linkage table is slightly different. The first entry is
For sparc, the linkage table is slightly different. The first entry is
the entry for
\
verb
|
call_into_c
|
so we never have to look this up. All
the entry for
\
code
{
call
\
_
into
\
_
c
}
so we never have to look this up. All
other entries are for
\
verb
|
resolve_linkage_tramp
|
. This has the
other entries are for
\
code
{
resolve
\
_
linkage
\
_
tramp
}
. This has the
advantage that
\
verb
|
resolve_linkage_tramp
|
can be much simpler since
advantage that
\
code
{
resolve
\
_
linkage
\
_
tramp
}
can be much simpler since
all calls to foreign code go through
\
verb
|
call_into_c
|
anyway, and
all calls to foreign code go through
\
code
{
call
\
_
into
\
_
c
}
anyway, and
that means all live Lisp registers have already been saved. Also, to
that means all live Lisp registers have already been saved. Also, to
make life simpler, we lie about
\
verb
|
closure_tramp
|
and
make life simpler, we lie about
\
code
{
closure
\
_
tramp
}
and
\
verb
|
undefined_tramp
|
in the Lisp code. These are really functions,
\
code
{
undefined
\
_
tramp
}
in the Lisp code. These are really functions,
but we treat them as foreign data since these two routines are only
but we treat them as foreign data since these two routines are only
used as addresses in the Lisp code to stuff into a lisp function
used as addresses in the Lisp code to stuff into a lisp function
header.
header.
On the Lisp side, there are two supporting data structures for the
On the Lisp side, there are two supporting data structures for the
linkage table:
\
verb
|
*linkage-table-data*
|
and
linkage table:
\
code
{
*linkage-table-data*
}
and
\
verb
|
*foreign-linkage-symbols*
|
. The latter is a hash table whose key
\
code
{
*foreign-linkage-symbols*
}
. The latter is a hash table whose key
is the foriegn symbol (a string) and whose value is an index into
is the foriegn symbol (a string) and whose value is an index into
\
verb
|
*linkage-table-data*
|
.
\
code
{
*linkage-table-data*
}
.
\
verb
|
*linkage-table-data*
|
is a vector with an unlispy layout. Each
\
code
{
*linkage-table-data*
}
is a vector with an unlispy layout. Each
entry has 3 parts:
entry has 3 parts:
\begin{itemize}
\begin{itemize}
...
@@ -66,11 +66,11 @@ entry has 3 parts:
...
@@ -66,11 +66,11 @@ entry has 3 parts:
\end{itemize}
\end{itemize}
Whenever a new foreign symbol is defined, a new
Whenever a new foreign symbol is defined, a new
\
verb
|
*linkage-table-data*
|
entry is created.
\
code
{
*linkage-table-data*
}
entry is created.
\
verb
|
*foreign-linkage-symbols*
|
is updated with the symbol and the
\
code
{
*foreign-linkage-symbols*
}
is updated with the symbol and the
entry number into
\
verb
|
*linkage-table-data*
|
.
entry number into
\
code
{
*linkage-table-data*
}
.
The
\
verb
|
*linkage-table-data*
|
is accessed from C (hence the unlispy
The
\
code
{
*linkage-table-data*
}
is accessed from C (hence the unlispy
layout), to figure out the symbol name and the type so that the
layout), to figure out the symbol name and the type so that the
address of the symbol can be determined. The type tells the C code
address of the symbol can be determined. The type tells the C code
how to fill in the entry in the linkage-table itself.
how to fill in the entry in the linkage-table itself.
...
...
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