source: branches/arm/level-1/arm-callback-support.lisp @ 13922

Last change on this file since 13922 was 13922, checked in by gb, 9 years ago

More files from last commit.

arm-callback-support.lisp, arm-error-signal.lisp,
arm-trap-support.lisp,l1-boot-3.lisp: try to get basic stuff working
well enough to enable callbacks. Enable callbacks.

arm-backtrace.lisp: a little bit of platform-specific code and some
code from the PPC port, so that backtrace sort of works.

File size: 1.5 KB
Line 
1;;;-*-Mode: LISP; Package: CCL -*-
2;;;
3;;;   Copyright (C) 2010 Clozure Associates
4;;;   This file is part of Clozure CL. 
5;;;
6;;;   Clozure CL is licensed under the terms of the Lisp Lesser GNU Public
7;;;   License , known as the LLGPL and distributed with Clozure CL as the
8;;;   file "LICENSE".  The LLGPL consists of a preamble and the LGPL,
9;;;   which is distributed with Clozure CL as the file "LGPL".  Where these
10;;;   conflict, the preamble takes precedence. 
11;;;
12;;;   Clozure CL is referenced in the preamble as the "LIBRARY."
13;;;
14;;;   The LLGPL is also available online at
15;;;   http://opensource.franz.com/preamble.html
16
17(in-package "CCL")
18
19(defun make-callback-trampoline (index &optional info)
20  (declare (ignore info))
21  (let* ((p (%allocate-callback-pointer 12)))
22    (macrolet ((arm-lap-word (instruction-form)
23                 (uvref (uvref (compile nil `(lambda (&lap 0) (arm-lap-function () ((?? 0)) ,instruction-form))) 1) 0)))
24      (setf (%get-unsigned-long p 0)
25            (dpb (ldb (byte 8 0) index)
26                 (byte 8 0)
27                 (arm-lap-word (mov r12 (:$ 0))))
28            (%get-unsigned-long p 4)
29            (dpb (ldb (byte 8 8) index)
30                 (byte 8 0)
31                 (arm-lap-word (orr r12 r12 (:$ #xff00))))
32            (%get-unsigned-long p 8)
33            (arm-lap-word (ba .SPeabi-callback)))
34      (ff-call (%kernel-import #.arm::kernel-import-makedataexecutable) 
35               :address p 
36               :unsigned-fullword 12
37               :void)
38      p)))
39                   
Note: See TracBrowser for help on using the repository browser.