Skip to content
Snippets Groups Projects
Commit 89f6eb3f authored by toy's avatar toy
Browse files

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
...@@ -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}}
......
...@@ -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.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment