- Supports now up to 64k pages, aas defined by the o32 ABI.
- Tested on a bcm1480 with a kernel for 16k pages.
- The pagesize handling in SBCL is very broken for most other
architectures / OSes.
(defvar *alloc-region-size*
#-gencgc
- 4096
+ (get-page-size)
;; This hardcoded 2 matches the one in gc_find_freeish_pages. It's not
;; really worth genesifying.
#+gencgc
(in-package "SB!VM")
-;;; FIXME: Do I need a different one for little-endian? :spim,
-;;; perhaps?
(def!constant +backend-fasl-file-implementation+ :mips)
(setf *backend-register-save-penalty* 3)
(setf *backend-byte-order*
#!+little-endian :little-endian
#!-little-endian :big-endian)
-;;; FIXME: Check this. Where is it used?
-(setf *backend-page-size* 4096)
+
+(progn ;eval-when (:compile-toplevel :load-toplevel :execute)
+ ;; The o32 ABI specifies 4k-64k as page size. We have to pick the
+ ;; maximum since mprotect() works only with page granularity.
+ (setf *backend-page-size* 65536))
(setf *backend-byte-order* :big-endian)
(eval-when (:compile-toplevel :load-toplevel :execute)
- ;; On Linux, the ABI specifies the page size to be 4k-65k, use the
+ ;; On Linux, the ABI specifies the page size to be 4k-64k, use the
;; maximum of that range. FIXME: it'd be great if somebody would
;; find out whether using exact multiples of the page size actually
;; matters in the few places where that's done, or whether we could
#ifdef LISP_FEATURE_GENCGC
#define PAGE_BYTES GENCGC_PAGE_SIZE
#else
-#define PAGE_BYTES 0x1000
+#define PAGE_BYTES BACKEND_PAGE_SIZE
#endif
typedef signed long page_index_t;
}
/* Align down to multiple of page_table page size */
- dynamic_space_size = (dynamic_space_size/PAGE_BYTES) * PAGE_BYTES;
+ dynamic_space_size &= ~(PAGE_BYTES - 1);
/* KLUDGE: os_vm_page_size is set by os_init(), and on some
* systems (e.g. Alpha) arch_init() needs need os_vm_page_size, so
/* Give a chance for cleanup threads to run. */
sched_yield();
#endif
- /* may as well allocate all the spaces at once: it saves us from
+ /* May as well allocate all the spaces at once: it saves us from
* having to decide what to do if only some of the allocations
- * succeed */
- spaces=os_validate(0, THREAD_STRUCT_SIZE);
+ * succeed. SPACES must be page-aligned, since the GC expects the
+ * control stack to start at a page boundary. We can't rely on the
+ * alignment passed from os_validate, since that might assume the
+ * current (e.g. 4k) pagesize, while we calculate with the biggest
+ * (e.g. 64k) pagesize allowed by the ABI. */
+ spaces=os_validate(0, THREAD_STRUCT_SIZE + BACKEND_PAGE_SIZE);
if(!spaces)
return NULL;
+ spaces = (void *)((((unsigned long)(char *)spaces)
+ + BACKEND_PAGE_SIZE - 1)
+ & ~(BACKEND_PAGE_SIZE - 1));
per_thread=(union per_thread_data *)
(spaces+
THREAD_CONTROL_STACK_SIZE+
;;; checkins which aren't released. (And occasionally for internal
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"1.0.9.29"
+"1.0.9.30"