1 | ;;;-*- Mode: Lisp; Package: CCL -*- |
---|
2 | |
---|
3 | ;;; Copyright 2009 Clozure Associates |
---|
4 | ;;; This file is part of Clozure CL. |
---|
5 | ;;; |
---|
6 | ;;; Clozure CL is licensed under the terms of the Lisp Lesser GNU |
---|
7 | ;;; Public License , known as the LLGPL and distributed with Clozure |
---|
8 | ;;; CL as the file "LICENSE". The LLGPL consists of a preamble and |
---|
9 | ;;; the LGPL, which is distributed with Clozure CL as the file "LGPL". |
---|
10 | ;;; Where these 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 | (eval-when (:compile-toplevel :execute) |
---|
20 | (require "FASLENV" "ccl:xdump;faslenv") |
---|
21 | (require "X86-LAP")) |
---|
22 | |
---|
23 | (eval-when (:compile-toplevel :load-toplevel :execute) |
---|
24 | (require "XFASLOAD" "ccl:xdump;xfasload")) |
---|
25 | |
---|
26 | (defparameter *x8632-macro-apply-code* |
---|
27 | #xc9cd0000) ;uuo-error-call-macro-or-special-operator |
---|
28 | |
---|
29 | (defun x8632-fixup-macro-apply-code () |
---|
30 | *x8632-macro-apply-code*) |
---|
31 | |
---|
32 | ;;; For now, do this with a UUO so that the kernel can catch it. |
---|
33 | (defparameter *x8632-udf-code* |
---|
34 | #xc7cd0000) ;uuo-error-udf-call |
---|
35 | |
---|
36 | (defun x8632-initialize-static-space () |
---|
37 | (xload-make-ivector *xload-static-space* |
---|
38 | (xload-target-subtype :unsigned-32-bit-vector) |
---|
39 | (1- (/ 4096 4))) |
---|
40 | (xload-make-cons *xload-target-nil* *xload-target-nil* *xload-static-space*)) |
---|
41 | |
---|
42 | (defparameter *x8632-darwin-xload-backend* |
---|
43 | (make-backend-xload-info |
---|
44 | :name :darwinx8632 |
---|
45 | :macro-apply-code-function 'x8632-fixup-macro-apply-code |
---|
46 | :closure-trampoline-code nil |
---|
47 | :udf-code *x8632-udf-code* |
---|
48 | :default-image-name "ccl:ccl;x86-boot32.image" |
---|
49 | :default-startup-file-name "level-1.dx32fsl" |
---|
50 | :subdirs '("ccl:level-0;X86;X8632;" "ccl:level-0;X86;") |
---|
51 | :compiler-target-name :darwinx8632 |
---|
52 | :image-base-address #x04000000 |
---|
53 | :nil-relative-symbols x86::*x86-nil-relative-symbols* |
---|
54 | :static-space-init-function 'x8632-initialize-static-space |
---|
55 | :purespace-reserve (ash 1 26) |
---|
56 | :static-space-address (+ (ash 1 16) (ash 2 12)) |
---|
57 | )) |
---|
58 | |
---|
59 | (add-xload-backend *x8632-darwin-xload-backend*) |
---|
60 | |
---|
61 | (defparameter *x8632-linux-xload-backend* |
---|
62 | (make-backend-xload-info |
---|
63 | :name :linuxx8632 |
---|
64 | :macro-apply-code-function 'x8632-fixup-macro-apply-code |
---|
65 | :closure-trampoline-code nil |
---|
66 | :udf-code *x8632-udf-code* |
---|
67 | :default-image-name "ccl:ccl;x86-boot32" |
---|
68 | :default-startup-file-name "level-1.lx32fsl" |
---|
69 | :subdirs '("ccl:level-0;X86;X8632;" "ccl:level-0;X86;") |
---|
70 | :compiler-target-name :linuxx8632 |
---|
71 | :image-base-address #x10000000 |
---|
72 | :nil-relative-symbols x86::*x86-nil-relative-symbols* |
---|
73 | :static-space-init-function 'x8632-initialize-static-space |
---|
74 | :purespace-reserve (ash 1 26) |
---|
75 | :static-space-address (+ (ash 1 16) (ash 2 12)) |
---|
76 | )) |
---|
77 | |
---|
78 | (add-xload-backend *x8632-linux-xload-backend*) |
---|
79 | |
---|
80 | (defparameter *x8632-windows-xload-backend* |
---|
81 | (make-backend-xload-info |
---|
82 | :name :win32 |
---|
83 | :macro-apply-code-function 'x8632-fixup-macro-apply-code |
---|
84 | :closure-trampoline-code nil |
---|
85 | :udf-code *x8632-udf-code* |
---|
86 | :default-image-name "ccl:ccl;wx86-boot32.image" |
---|
87 | :default-startup-file-name "level-1.wx32fsl" |
---|
88 | :subdirs '("ccl:level-0;X86;X8632;" "ccl:level-0;X86;") |
---|
89 | :compiler-target-name :win32 |
---|
90 | :image-base-address #x04000000 |
---|
91 | :nil-relative-symbols x86::*x86-nil-relative-symbols* |
---|
92 | :static-space-init-function 'x8632-initialize-static-space |
---|
93 | :purespace-reserve (ash 1 26) |
---|
94 | :static-space-address (+ (ash 1 16) (ash 2 12)) |
---|
95 | )) |
---|
96 | |
---|
97 | (add-xload-backend *x8632-windows-xload-backend*) |
---|
98 | |
---|
99 | (defparameter *x8632-solaris-xload-backend* |
---|
100 | (make-backend-xload-info |
---|
101 | :name :solarisx8632 |
---|
102 | :macro-apply-code-function 'x8632-fixup-macro-apply-code |
---|
103 | :closure-trampoline-code nil |
---|
104 | :udf-code *x8632-udf-code* |
---|
105 | :default-image-name "ccl:ccl;sx86-boot32" |
---|
106 | :default-startup-file-name "level-1.sx32fsl" |
---|
107 | :subdirs '("ccl:level-0;X86;X8632;" "ccl:level-0;X86;") |
---|
108 | :compiler-target-name :solarisx8632 |
---|
109 | :image-base-address #x10000000 |
---|
110 | :nil-relative-symbols x86::*x86-nil-relative-symbols* |
---|
111 | :static-space-init-function 'x8632-initialize-static-space |
---|
112 | :purespace-reserve (ash 1 26) |
---|
113 | :static-space-address (+ (ash 1 16) (ash 2 12)) |
---|
114 | )) |
---|
115 | |
---|
116 | (add-xload-backend *x8632-solaris-xload-backend*) |
---|
117 | |
---|
118 | (defparameter *x8632-freebsd-xload-backend* |
---|
119 | (make-backend-xload-info |
---|
120 | :name :freebsdx8632 |
---|
121 | :macro-apply-code-function 'x8632-fixup-macro-apply-code |
---|
122 | :closure-trampoline-code nil |
---|
123 | :udf-code *x8632-udf-code* |
---|
124 | :default-image-name "ccl:ccl;fx86-boot32" |
---|
125 | :default-startup-file-name "level-1.fx32fsl" |
---|
126 | :subdirs '("ccl:level-0;X86;X8632;" "ccl:level-0;X86;") |
---|
127 | :compiler-target-name :freebsdx8632 |
---|
128 | :image-base-address #x30000000 |
---|
129 | :nil-relative-symbols x86::*x86-nil-relative-symbols* |
---|
130 | :static-space-init-function 'x8632-initialize-static-space |
---|
131 | :purespace-reserve (ash 1 26) |
---|
132 | :static-space-address (+ (ash 1 16) (ash 2 12)) |
---|
133 | )) |
---|
134 | |
---|
135 | (add-xload-backend *x8632-freebsd-xload-backend*) |
---|
136 | |
---|
137 | #+x8632-target |
---|
138 | (progn |
---|
139 | #+darwin-target |
---|
140 | (setq *xload-default-backend* *x8632-darwin-xload-backend*) |
---|
141 | #+linux-target |
---|
142 | (setq *xload-default-backend* *x8632-linux-xload-backend*) |
---|
143 | #+windows-target |
---|
144 | (setq *xload-default-backend* *x8632-windows-xload-backend*) |
---|
145 | #+solaris-target |
---|
146 | (setq *xload-default-backend* *x8632-solaris-xload-backend*) |
---|
147 | #+freebsd-target |
---|
148 | (setq *xload-default-backend* *x8632-freebsd-xload-backend*) |
---|
149 | ) |
---|