diff --git a/.travis.sh b/.travis.sh index 5a714e126..3d3c0770c 100755 --- a/.travis.sh +++ b/.travis.sh @@ -47,6 +47,7 @@ travis_time_start install # Use this to install any prerequisites or dependencie cd ${HOME} [ -e jskeus ] || git clone http://github.com/euslisp/jskeus jskeus ln -s $CI_SOURCE_PATH jskeus/eus +ln -s `pwd`/jskeus/irteus jskeus/eus/irteus travis_time_end travis_time_start script.make # All commands must exit with code 0 on success. Anything else is considered failure. @@ -60,9 +61,15 @@ source bashrc.eus export DISPLAY= set +e if [[ "`uname -m`" == "arm"* || "`uname -m`" == "aarch"* ]]; then - export EXIT_STATUS=0; for test_l in irteus/test/geo.l; do irteusgl $test_l; export EXIT_STATUS=`expr $? + 1`; done;echo "Exit status : $EXIT_STATUS"; [ $EXIT_STATUS == 0 ] + export EXIT_STATUS=0; for test_l in irteus/test/*.l; do [[ $test_l =~ geo.l|interpolator.l|irteus-demo.l|test-irt-motion.l|object.l|coords.l|bignum.l|mathtest.l ]] && continue; irteusgl $test_l; export EXIT_STATUS=`expr $? + $EXIT_STATUS`; done;echo "Exit status : $EXIT_STATUS"; [ $EXIT_STATUS == 0 ] || exit 1 else - export EXIT_STATUS=0; for test_l in irteus/test/*.l; do irteusgl $test_l; export EXIT_STATUS=`expr $? + 1`; done;echo "Exit status : $EXIT_STATUS"; [ $EXIT_STATUS == 0 ] + export EXIT_STATUS=0; for test_l in irteus/test/*.l; do irteusgl $test_l; export EXIT_STATUS=`expr $? + $EXIT_STATUS`; done;echo "Exit status : $EXIT_STATUS"; [ $EXIT_STATUS == 0 ] || exit 1 +fi + +if [[ "$TRAVIS_OS_NAME" == "osx" || "`uname -m`" == "arm"* ]]; then + uname -a +else + make -C eus/contrib/eus64-check/ || exit 1 # check eus64-check fi travis_time_end diff --git a/contrib/eus64-check/Makefile b/contrib/eus64-check/Makefile index f22b41acb..3ec68ba24 100644 --- a/contrib/eus64-check/Makefile +++ b/contrib/eus64-check/Makefile @@ -1,14 +1,34 @@ -all : test_foreign.so +all : test + +MARCH=$(shell uname -m) test_foreign.so : test_foreign.c ifeq ($(ARCHDIR), Linux64) - gcc -m64 -O2 -g -falign-functions=8 -Dx86_64 -DLinux -fPIC -c $< - gcc -m64 -shared -fPIC -falign-functions=8 -o $@ test_foreign.o +## + gcc -O2 -g -falign-functions=8 -Dx86_64 -DLinux -fPIC -c $< + gcc -shared -fPIC -falign-functions=8 -o $@ test_foreign.o +else +ifeq ($(ARCHDIR), LinuxARM) +ifeq ($(MARCH), aarch64) +## arm 64bit + gcc -O2 -g -Wimplicit -falign-functions=8 -Daarch64 -Darmv8 -DARM -DLinux -fPIC -c $< + gcc -shared -fPIC -falign-functions=8 -o $@ test_foreign.o +else +## arm 32bit + gcc -O2 -g -falign-functions=4 -DARM -DLinux -fpic -c $< + gcc -shared -fpic -falign-functions=4 -o $@ test_foreign.o +endif else +## Linux32 bit gcc -m32 -O2 -g -falign-functions=4 -Di386 -Di486 -DLinux -fpic -c $< gcc -m32 -shared -fpic -falign-functions=4 -o $@ test_foreign.o endif +endif + +test: test_foreign.so + irteusgl eus64-test.l clean : \rm -f *.o *.so + diff --git a/contrib/eus64-check/eus64-module.l b/contrib/eus64-check/eus64-module.l new file mode 100644 index 000000000..922bcbc9e --- /dev/null +++ b/contrib/eus64-check/eus64-module.l @@ -0,0 +1,38 @@ +(unless (boundp '*testmod*) + (setq *testmod* (load-foreign "test_foreign.so")) + (defforeign float-test *testmod* "float_test" (:integer :float32 :float32 :float32 :float32) :integer) + (defforeign float2-test *testmod* "float_test" (:integer :double :double :double :double) :integer) + (defforeign float3-test *testmod* "float_test" () :integer) + (defforeign double-test *testmod* "double_test" (:integer :double :double :double :double) :integer) + (defforeign double2-test *testmod* "double_test" (:integer :float32 :float32 :float32 :float32) :integer) + (defforeign double3-test *testmod* "double_test" () :integer) + (defforeign iv-test *testmod* "iv_test" () :integer) + (defforeign lv-test *testmod* "lv_test" () :integer) + (defforeign fv-test *testmod* "fv_test" () :integer) + (defforeign dv-test *testmod* "dv_test" () :integer) + (defforeign str-test *testmod* "str_test" () :integer) + (defforeign int-test *testmod* "int_test" () :integer) + (defforeign ret-float *testmod* "ret_float" () :float32) + (defforeign ret-double *testmod* "ret_double" () :float) + (defforeign ret-long *testmod* "ret_long" () :integer) + + (defforeign set-ifunc *testmod* "set_ifunc" (:integer) :integer) + (defforeign set-ffunc *testmod* "set_ffunc" (:integer) :integer) + + (defforeign test-testd *testmod* "test_testd" (:integer :integer :integer + :integer :integer :integer + :double :double :double :double + :double :double :double :double + :double :double + :integer :integer) :float) + (defforeign call-ifunc *testmod* "call_ifunc" () :integer) + (defforeign call-ffunc *testmod* "call_ffunc" () :float) + + (defforeign get-size-pointer *testmod* "get_size_of_pointer" () :integer) + (defforeign get-size-float32 *testmod* "get_size_of_float32" () :integer) + (defforeign get-size-double *testmod* "get_size_of_double" () :integer) + (defforeign get-size-long *testmod* "get_size_of_long" () :integer) + (defforeign get-size-int *testmod* "get_size_of_int" () :integer) + ) + + diff --git a/contrib/eus64-check/eus64-test.l b/contrib/eus64-check/eus64-test.l index 6c20ea6be..9cf1560b1 100644 --- a/contrib/eus64-check/eus64-test.l +++ b/contrib/eus64-check/eus64-test.l @@ -1,133 +1,206 @@ -(unless (boundp '*testmod*) - (setq *testmod* (load-foreign "test_foreign.so")) - (defforeign float-test *testmod* "float_test" (:integer :float32 :float32 :float32 :float32) :integer) - (defforeign float2-test *testmod* "float_test" (:integer :double :double :double :double) :integer) - (defforeign float3-test *testmod* "float_test" () :integer) - (defforeign double-test *testmod* "double_test" (:integer :double :double :double :double) :integer) - (defforeign double2-test *testmod* "double_test" (:integer :float32 :float32 :float32 :float32) :integer) - (defforeign double3-test *testmod* "double_test" () :integer) - (defforeign iv-test *testmod* "iv_test" () :integer) - (defforeign lv-test *testmod* "lv_test" () :integer) - (defforeign fv-test *testmod* "fv_test" () :integer) - (defforeign dv-test *testmod* "dv_test" () :integer) - (defforeign str-test *testmod* "str_test" () :integer) - (defforeign int-test *testmod* "int_test" () :integer) - (defforeign ret-float *testmod* "ret_float" () :float32) - (defforeign ret-double *testmod* "ret_double" () :float) - (defforeign ret-long *testmod* "ret_long" () :integer) +(load "eus64-module.l") +(require :unittest "lib/llib/unittest.l") + +(init-unit-test) + +(deftest test-pointer-size + (format t "~%;;;; pointer size check ;;;;~%") + + (format t "pointer size ~D ~D~%" + lisp::sizeof-* (get-size-pointer)) + (assert (= lisp::sizeof-* (get-size-pointer))) - (defforeign set-ifunc *testmod* "set_ifunc" (:integer) :integer) - (defforeign set-ffunc *testmod* "set_ffunc" (:integer) :integer) - - (defforeign test-testd *testmod* "test_testd" (:integer :integer :integer - :integer :integer :integer - :double :double :double :double - :double :double :double :double - :double :double - :integer :integer) :float) - (defforeign call-ifunc *testmod* "call_ifunc" () :integer) - (defforeign call-ffunc *testmod* "call_ffunc" () :float) - ) + (format t "double size ~D ~D~%" + lisp::sizeof-double (get-size-double)) + (assert (= lisp::sizeof-double (get-size-double))) + (format t "long integer size ~D ~D~%" + (cadr (assoc :long lisp::sizeof-types)) + (get-size-long)) + (assert (= (cadr (assoc :long lisp::sizeof-types)) (get-size-long))) -(format t "~%multiple arguments passing~%") -(format t "expected result~%") -(format t "100 101 102 + (format t "integer size ~D ~D~%" + lisp::sizeof-int (get-size-int)) + (assert (= lisp::sizeof-int (get-size-int))) + + (format t "float size ~D ~D~%" + lisp::sizeof-float (get-size-float32)) + (assert (= lisp::sizeof-float (get-size-float32))) + ) + +(deftest test-multiple-arguments-passing + (format t "~%multiple arguments passing~%") + (format t "expected result~%") + (format t "100 101 102 103 104 105 1000.000000 1010.000000 1020.000000 1030.000000 1040.000000 1050.000000 1060.000000 1070.000000 2080.000000 2090.000000 -206 207~%") -(format t "exec in eus64~%") -(format t "test-testd = ~A~%" - (test-testd 100 101 102 +206 207 +test-testd = 1.23456 +~%") + (format t "exec in eus~%") + (format t "test-testd = ~A~%" + (setq ret (test-testd 100 101 102 103 104 105 1000.0 1010.0 1020.0 1030.0 1040.0 1050.0 1060.0 1070.0 2080.0 2090.0 - 206 207)) - -(format t "~%float-test~%") -(format t "expected result~%") -(format t "0: 1.000000e-01 ..~%") -(format t "0: 2.000000e-01 ..~%") -(format t "0: 3.000000e-01 ..~%") -(format t "0: 4.000000e-01 ..~%") -(format t "exec in eus64~%") -(float-test 0 0.1 0.2 0.3 0.4) -(format t "~%float2-test~%") -(float2-test 0 0.1 0.2 0.3 0.4) -(format t "~%float3-test~%") -(float3-test 0 0.1 0.2 0.3 0.4) - -(format t "~%double-test~%") -(format t "expected result~%") -(format t "1: 1.000000e-01 ..~%") -(format t "1: 2.000000e-01 ..~%") -(format t "1: 3.000000e-01 ..~%") -(format t "1: 4.000000e-01 ..~%") -(format t "exec in eus64~%") -(double-test 1 0.1 0.2 0.3 0.4) -(format t "~%double2-test~%") -(double2-test 1 0.1 0.2 0.3 0.4) -(format t "~%double3-test~%") -(double3-test 1 0.1 0.2 0.3 0.4) - -(setq iv (integer-vector 0 100 10000 1000000 100000000 10000000000)) -#| -(format t "~%iv-test~%") -(format t "expected result~%") -(format t "exec in eus64~%") -(iv-test (length iv) iv) -|# -(format t "~%lv-test~%") -(format t "size = 6 + 206 207))) + (assert (eps= 1.23456 ret)) + + ;; + (setq f (piped-fork "irteusgl eus64-module.l '(progn (test-testd 100 101 102 103 104 105 1000.000000 1010.000000 1020.000000 1030.000000 1040.000000 1050.000000 1060.000000 1070.000000 2080.000000 2090.000000 206 207)(exit 0))'")) + (assert (string= (read-line f) "100 101 102")) + (assert (string= (read-line f) "103 104 105")) + (assert (string= (read-line f) "1000.000000 1010.000000 1020.000000 1030.000000")) + (assert (string= (read-line f) "1040.000000 1050.000000 1060.000000 1070.000000")) + (assert (string= (read-line f) "2080.000000 2090.000000")) + (assert (string= (read-line f) "206 207")) + ) + +(deftest test-float-test + (format t "~%~%float-test~%") + (format t "expected result~%") + (format t "0: 1.000000e-01 ..~%") + (format t "0: 2.000000e-01 ..~%") + (format t "0: 3.000000e-01 ..~%") + (format t "0: 4.000000e-01 ..~%") + (format t "~%float-test(success, exec in eus)~%") + (float-test 0 0.1 0.2 0.3 0.4) + (format t "~%float2-test(fail, exec in eus)~%") + (float2-test 0 0.1 0.2 0.3 0.4) + (format t "~%float3-test(depend on architecture, exec in eus)~%") + (float3-test 0 0.1 0.2 0.3 0.4) + + ;; + (setq f (piped-fork "irteusgl eus64-module.l '(progn (float-test 0 0.1 0.2 0.3 0.4)(exit 0))'")) + (assert (eps= (read-from-string (subseq (read-line f) 2)) 0.1)) ;; skip first 2 character + (assert (eps= (read-from-string (subseq (read-line f) 2)) 0.2)) + (assert (eps= (read-from-string (subseq (read-line f) 2)) 0.3)) + (assert (eps= (read-from-string (subseq (read-line f) 2)) 0.4)) + ) + +(deftest test-double-test + (format t "~%~%double-test~%") + (format t "expected result~%") + (format t "1: 1.000000e-01 ..~%") + (format t "1: 2.000000e-01 ..~%") + (format t "1: 3.000000e-01 ..~%") + (format t "1: 4.000000e-01 ..~%") + (format t "~%double-test(success, exec in eus)~%") + (double-test 1 0.1 0.2 0.3 0.4) + (format t "~%double2-test(fail, exec in eus)~%") + (double2-test 1 0.1 0.2 0.3 0.4) + (format t "~%double3-test(depend on architecture, exec in eus)~%") + (double3-test 1 0.1 0.2 0.3 0.4) + + ;; + (setq f (piped-fork "irteusgl eus64-module.l '(progn (double-test 1 0.1 0.2 0.3 0.4)(exit 0))'")) + (assert (eps= (read-from-string (subseq (read-line f) 2)) 0.1)) ;; skip first 2 character + (assert (eps= (read-from-string (subseq (read-line f) 2)) 0.2)) + (assert (eps= (read-from-string (subseq (read-line f) 2)) 0.3)) + (assert (eps= (read-from-string (subseq (read-line f) 2)) 0.4)) + (setq f (piped-fork "irteusgl eus64-module.l '(progn (double3-test 1 0.1 0.2 0.3 0.4)(exit 0))'")) + (assert (eps= (read-from-string (subseq (read-line f) 2)) 0.1)) ;; skip first 2 character + (assert (eps= (read-from-string (subseq (read-line f) 2)) 0.2)) + (assert (eps= (read-from-string (subseq (read-line f) 2)) 0.3)) + (assert (eps= (read-from-string (subseq (read-line f) 2)) 0.4)) + ) + +(deftest test-integer-vector + (setq iv (integer-vector 0 100 10000 1000000 100000000 10000000000)) + #| + (format t "~%iv-test~%") + (format t "expected result~%") + (format t "exec in eus64~%") + (iv-test (length iv) iv) + |# + (format t "~%lv-test~%") + (format t "size = 6 0: 0 0 1: 100 64 2: 10000 2710 3: 1000000 F4240 4: 100000000 5F5E100 5: 10000000000 2540BE400~%") -(format t "exec in eus64~%") -(lv-test (length iv) iv) + (format t "~%lv-test(exec in eus)~%") + (lv-test (length iv) iv) -(setq fv (float-vector 0.1 0.2 0.3 0.5 0.7)) -#| -(format t "~%fv-test~%") -(format t "exec in eus64~%") -(fv-test (length fv) fv) -|# + ;; + (setq f (piped-fork "irteusgl eus64-module.l '(progn (setq iv (integer-vector 0 100 10000 1000000 100000000 10000000000))(lv-test (length iv) iv)(exit 0))'")) + (assert (string= (read-line f) "size = 6")) + (assert (string= (read-line f) "0: 0 0")) + (assert (string= (read-line f) "1: 100 64")) + (assert (string= (read-line f) "2: 10000 2710")) + (assert (string= (read-line f) "3: 1000000 F4240")) + (assert (string= (read-line f) "4: 100000000 5F5E100")) + (assert (string= (read-line f) "5: 10000000000 2540BE400")) + ) + +(deftest test-float-vector + (setq fv (float-vector 0.1 0.2 0.3 0.5 0.7)) + #| + (format t "~%fv-test~%") + (format t "exec in eus64~%") + (fv-test (length fv) fv) + |# -(format t "~%dv-test~%") -(format t "size = 5 + (format t "~%dv-test~%") + (format t "size = 5 0: 1.000000e-01 3FB9999999999998 1: 2.000000e-01 3FC9999999999998 2: 3.000000e-01 3FD3333333333330 3: 5.000000e-01 3FE0000000000000 4: 7.000000e-01 3FE6666666666664~%") -(format t "exec in eus64~%") -(dv-test (length fv) fv) + (format t "~%dv-test(exec in eus)~%") + (dv-test (length fv) fv) -(setq str "input : test64 string") -(format t "~%str-test~%") -(format t "expected result~%") -(format t "print : ~S~%" str) -(format t "exec in eus64~%") -(str-test (length str) str) + ;; + (setq f (piped-fork "irteusgl eus64-module.l '(progn (setq fv (float-vector 0.1 0.2 0.3 0.5 0.7))(dv-test (length fv) fv)(exit 0))'")) + (assert (string= (read-line f) "size = 5")) + (assert (string= (read-line f) "0: 1.000000e-01 3FB9999999999998")) + (assert (string= (read-line f) "1: 2.000000e-01 3FC9999999999998")) + (assert (string= (read-line f) "2: 3.000000e-01 3FD3333333333330")) + (assert (string= (read-line f) "3: 5.000000e-01 3FE0000000000000")) + (assert (string= (read-line f) "4: 7.000000e-01 3FE6666666666664")) + ) +(deftest test-string-test + (setq str "input : test64 string") + (format t "~%str-test~%") + ;;(format t "expected result~%") + (format t "input string : ~S~%" str) + (format t "~%str-test(exec in eus)~%") + (str-test (length str) str) + ;; + (setq f (piped-fork "irteusgl eus64-module.l '(progn (setq str \"input : test64 string\")(str-test (length str) str)(exit 0))'")) + (assert (string= (read-line f) (format nil "size = ~d" (length str)))) + (dotimes (i (length str)) + (assert (string= (read-line f) (format nil "~d: ~c ~x" i (elt str i) (elt str i)))) + ) + ) -(format t "~%return double test~%") -(format t "expected result~%") -(format t "ret-double ~8,8e~%" (+ 0.55555 133.0)) -(format t "exec in eus64~%") -(format t "ret-double ~8,8e~%" (ret-double 0.55555 133.0)) +(deftest test-return-double + (format t "~%return double test~%") + (format t "expected result~%") + (format t " ret-double ~8,8e~%" (+ 0.55555 133.0)) + (format t "~%ret-double(exec in eus)~%") + (format t " ret-double ~8,8e~%" (ret-double 0.55555 133.0)) + ;; + (assert (eps= (ret-double 0.55555 133.0) (+ 0.55555 133.0))) + ) -(format t "~%return long test~%") -(format t "expected result~%") -(format t "ret-long ~D~%" (+ 123 645000)) -(format t "exec in eus64~%") -(format t "ret-long ~D~%" (ret-long 123 645000)) +(deftest test-return-long + (format t "~%return long test~%") + (format t "expected result~%") + (format t " ret-long ~D~%" (+ 123 645000)) + (format t "~%ret-long(exec in eus)~%") + (format t " ret-long ~D~%" (ret-long 123 645000)) + (assert (= (ret-long 123 645000) (+ 123 645000))) + ) +#| ;; ret-int ;; ret-short ;; ret-char @@ -138,9 +211,10 @@ 1234) ;; (format t "~%callback function test(integer)~%") -(format t "callback function is set~%") +(format t " callback function is set~%") (set-ifunc (pod-address 'LISP-IFUNC)) -(format t "call-ifunc = ~A~%" (call-ifunc)) +(format t " expected result: LISP-INTFUNC is called, return 1234~%") +(format t " call-ifunc = ~A~%" (call-ifunc)) (defun-c-callable LISP-FFUNC ((i0 :integer) (i1 :integer) (i2 :integer) (i3 :integer) (i4 :integer) (i5 :integer) @@ -158,6 +232,18 @@ (format t "return ~A~%" 0.12345) 0.12345) (format t "~%callback function test(float)~%") -(format t "callback function is set~%") +(format t " callback function is set~%") (set-ffunc (pod-address 'LISP-FFUNC)) +(format t " expected result: LISP-FFUNC is called + 100 101 102 + 103 104 105 + 1000.0 1010.0 1020.0 1030.0 + 1040.0 1050.0 1060.0 1070.0 + 2080.0 2090.0 + 206 207 + return 0.12345~%") (format t "call-ffunc = ~A~%" (call-ffunc)) +|# + +(run-all-tests) +(exit) diff --git a/contrib/eus64-check/test_foreign.c b/contrib/eus64-check/test_foreign.c index b31627c32..f0af5255f 100644 --- a/contrib/eus64-check/test_foreign.c +++ b/contrib/eus64-check/test_foreign.c @@ -81,7 +81,7 @@ int str_test(int n, char *src) { int i; printf("size = %d\n", n); for(i=0;i>(-count))); if (val<=0) { return(makeint(val< stack + "mov x1, 0\n\t" + "ldr x2, [x29, 24]\n\t" + "b .FUNCII_LPCK\n\t" + ".FUNCII_LP:\n\t" + "lsl x0, x1, 3\n\t" + "add x3, x2, x0\n\t" // vargv[i] + "add x4, sp, x0\n\t" // stack[i] + "ldr x0, [x3]\n\t" + "str x0, [x4]\n\t" // push stack + "add x1, x1, 1\n\t" + ".FUNCII_LPCK:\n\t" + "ldr x5, [x29, 32]\n\t" + "cmp x1, x5\n\t" + "blt .FUNCII_LP\n\t" + // fargv -> register + "ldr x0, [x29, 40]\n\t" // fargv + "ldr d0, [x0]\n\t" + "add x0, x0, 8\n\t" + "ldr d1, [x0]\n\t" + "add x0, x0, 8\n\t" + "ldr d2, [x0]\n\t" + "add x0, x0, 8\n\t" + "ldr d3, [x0]\n\t" + "add x0, x0, 8\n\t" + "ldr d4, [x0]\n\t" + "add x0, x0, 8\n\t" + "ldr d5, [x0]\n\t" + "add x0, x0, 8\n\t" + "ldr d6, [x0]\n\t" + "add x0, x0, 8\n\t" + "ldr d7, [x0]\n\t" + // iargv -> register + "ldr x0, [x29, 48]\n\t" // iargv + "ldr x9, [x0]\n\t" + "add x0, x0, 8\n\t" + "ldr x1, [x0]\n\t" + "add x0, x0, 8\n\t" + "ldr x2, [x0]\n\t" + "add x0, x0, 8\n\t" + "ldr x3, [x0]\n\t" + "add x0, x0, 8\n\t" + "ldr x4, [x0]\n\t" + "add x0, x0, 8\n\t" + "ldr x5, [x0]\n\t" + "add x0, x0, 8\n\t" + "ldr x6, [x0]\n\t" + "add x0, x0, 8\n\t" + "ldr x7, [x0]\n\t" + // function call + "ldr x8, [x29, 56]\n\t" + "mov x0, x9\n\t" + "blr x8\n\t" + "add sp, x29, 0\n\t" + "ldp x29, x30, [sp], 64\n\t" + "ret" + ); + +__asm__ (".align 8\n" + "exec_function_f:\n\t" + "sub sp, sp, #192\n\t" // 128(8x16) + 64 + "stp x29, x30, [sp, 128]\n\t" + "add x29, sp, 128\n\t" + "str x0, [x29, 56]\n\t" // fc + "str x1, [x29, 48]\n\t" // iargv + "str x2, [x29, 40]\n\t" // fargv + "str x3, [x29, 32]\n\t" // vargc + "str x4, [x29, 24]\n\t" // vargv + // vargv -> stack + "mov x1, 0\n\t" + "ldr x2, [x29, 24]\n\t" + "b .FUNCFF_LPCK\n\t" + ".FUNCFF_LP:\n\t" + "lsl x0, x1, 3\n\t" + "add x3, x2, x0\n\t" // vargv[i] + "add x4, sp, x0\n\t" // stack[i] + "ldr x0, [x3]\n\t" + "str x0, [x4]\n\t" // push stack + "add x1, x1, 1\n\t" + ".FUNCFF_LPCK:\n\t" + "ldr x5, [x29, 32]\n\t" + "cmp x1, x5\n\t" + "blt .FUNCFF_LP\n\t" + // fargv -> register + "ldr x0, [x29, 40]\n\t" // fargv + "ldr d0, [x0]\n\t" + "add x0, x0, 8\n\t" + "ldr d1, [x0]\n\t" + "add x0, x0, 8\n\t" + "ldr d2, [x0]\n\t" + "add x0, x0, 8\n\t" + "ldr d3, [x0]\n\t" + "add x0, x0, 8\n\t" + "ldr d4, [x0]\n\t" + "add x0, x0, 8\n\t" + "ldr d5, [x0]\n\t" + "add x0, x0, 8\n\t" + "ldr d6, [x0]\n\t" + "add x0, x0, 8\n\t" + "ldr d7, [x0]\n\t" + // iargv -> register + "ldr x0, [x29, 48]\n\t" // iargv + "ldr x9, [x0]\n\t" + "add x0, x0, 8\n\t" + "ldr x1, [x0]\n\t" + "add x0, x0, 8\n\t" + "ldr x2, [x0]\n\t" + "add x0, x0, 8\n\t" + "ldr x3, [x0]\n\t" + "add x0, x0, 8\n\t" + "ldr x4, [x0]\n\t" + "add x0, x0, 8\n\t" + "ldr x5, [x0]\n\t" + "add x0, x0, 8\n\t" + "ldr x6, [x0]\n\t" + "add x0, x0, 8\n\t" + "ldr x7, [x0]\n\t" + // function call + "ldr x8, [x29, 56]\n\t" + "mov x0, x9\n\t" + "blr x8\n\t" + "str d0, [x29, 56]\n\t" + "ldr x0, [x29, 56]\n\t" + "add sp, x29, 0\n\t" + "ldp x29, x30, [sp], 64\n\t" + "ret" + ); +#endif + +#if x86_64 +#define NUM_INT_ARGUMENTS 6 +#define NUM_FLT_ARGUMENTS 8 +#define NUM_EXTRA_ARGUMENTS 16 +#elif aarch64 +#define NUM_INT_ARGUMENTS 8 +#define NUM_FLT_ARGUMENTS 8 +#define NUM_EXTRA_ARGUMENTS 16 +#endif pointer call_foreign(ifunc,code,n,args) eusinteger_t (*ifunc)(); /* ???? */ @@ -718,9 +871,9 @@ pointer args[]; pointer paramtypes=code->c.fcode.paramtypes; pointer resulttype=code->c.fcode.resulttype; pointer p,lisparg; - eusinteger_t iargv[6]; - eusinteger_t fargv[8]; - eusinteger_t vargv[16]; + eusinteger_t iargv[NUM_INT_ARGUMENTS]; + eusinteger_t fargv[NUM_FLT_ARGUMENTS]; + eusinteger_t vargv[NUM_EXTRA_ARGUMENTS]; int icntr = 0, fcntr = 0, vcntr = 0; numunion nu; @@ -746,46 +899,52 @@ pointer args[]; lisparg=args[j++]; if (p==K_INTEGER) { c = isint(lisparg)?intval(lisparg):bigintval(lisparg); - if(icntr < 6) iargv[icntr++] = c; else vargv[vcntr++] = c; + if(icntr < NUM_INT_ARGUMENTS) iargv[icntr++] = c; else vargv[vcntr++] = c; } else if (p==K_STRING) { if (elmtypeof(lisparg)==ELM_FOREIGN) c=lisparg->c.ivec.iv[0]; else c=(eusinteger_t)(lisparg->c.str.chars); - if(icntr < 6) iargv[icntr++] = c; else vargv[vcntr++] = c; + if(icntr < NUM_INT_ARGUMENTS) iargv[icntr++] = c; else vargv[vcntr++] = c; } else if (p==K_FLOAT32) { numbox.f=(float)ckfltval(lisparg); c=((eusinteger_t)numbox.i.i1) & 0x00000000FFFFFFFF; - if(fcntr < 8) fargv[fcntr++] = c; else vargv[vcntr++] = c; + if(fcntr < NUM_FLT_ARGUMENTS) fargv[fcntr++] = c; else vargv[vcntr++] = c; } else if (p==K_DOUBLE || p==K_FLOAT) { numbox.d=ckfltval(lisparg); c=numbox.l; - if(fcntr < 8) fargv[fcntr++] = c; else vargv[vcntr++] = c; + if(fcntr < NUM_FLT_ARGUMENTS) fargv[fcntr++] = c; else vargv[vcntr++] = c; } else error(E_USER,(pointer)"unknown type specifier"); + if (vcntr >= NUM_EXTRA_ARGUMENTS) { + error(E_USER,(pointer)"too many number of arguments"); + } } /* &rest arguments? */ while (jc.ivec.iv[0]; else c=(eusinteger_t)(lisparg->c.str.chars); - if(icntr < 6) iargv[icntr++] = c; else vargv[vcntr++] = c; + if(icntr < NUM_INT_ARGUMENTS) iargv[icntr++] = c; else vargv[vcntr++] = c; } else if (isbignum(lisparg)){ if (bigsize(lisparg)==1){ eusinteger_t *xv = bigvec(lisparg); c=(eusinteger_t)xv[0]; - if(icntr < 6) iargv[icntr++] = c; else vargv[vcntr++] = c; + if(icntr < NUM_INT_ARGUMENTS) iargv[icntr++] = c; else vargv[vcntr++] = c; }else{ fprintf(stderr, "bignum size!=1\n"); } } else { c=(eusinteger_t)(lisparg->c.obj.iv); - if(icntr < 6) iargv[icntr++] = c; else vargv[vcntr++] = c; + if(icntr < NUM_INT_ARGUMENTS) iargv[icntr++] = c; else vargv[vcntr++] = c; + } + if (vcntr >= NUM_EXTRA_ARGUMENTS) { + error(E_USER,(pointer)"too many number of arguments"); } } /**/ @@ -1103,7 +1262,7 @@ int noarg; #if ARM register eusinteger_t addr; addr = (eusinteger_t)(fn->c.code.entry); -#ifdef x86_64 +#if (WORD_SIZE == 64) addr &= ~3L; /*0xfffffffc; ???? */ #else addr &= ~3; /*0xfffffffc; ???? */ diff --git a/lisp/c/fcall.c b/lisp/c/fcall.c index deb0a6ac6..e5af7ce21 100644 --- a/lisp/c/fcall.c +++ b/lisp/c/fcall.c @@ -24,7 +24,7 @@ pointer (**fslot)(); fn=getfunc(ctx,sym); if (ispointer(fn) && (fn->cix==codecp.cix)) { -#if x86_64 +#if (WORD_SIZE == 64) x= (eusinteger_t)(fn->c.code.entry); x &= ~3L; #else x= (eusinteger_t)(fn->c.code.entry); x &= ~3; diff --git a/lisp/c/fstringdouble.c b/lisp/c/fstringdouble.c index 8e4d54c02..c34f3cc29 100644 --- a/lisp/c/fstringdouble.c +++ b/lisp/c/fstringdouble.c @@ -3,7 +3,7 @@ */ #include "eus.h" -#ifdef x86_64 +#if (WORD_SIZE == 64) extern pointer makefvector(); /* string converted by DV2FSTRING convert to float-vector(vector of 64bit float) @@ -398,7 +398,7 @@ context *ctx; int n; pointer argv[]; { pointer mod=argv[0]; -#ifdef x86_64 +#if (WORD_SIZE == 64) defun(ctx,"FLOAT-BYTESTRING2DVECTOR",mod,FSTRING2DV); defun(ctx,"DVECTOR2FLOAT-BYTESTRING",mod,DV2FSTRING); defun(ctx,"INTEGER-BYTESTRING2LVECTOR",mod,ISTRING2LV); diff --git a/lisp/c/loadelf.c b/lisp/c/loadelf.c index b4d1d7093..ea12b8a70 100644 --- a/lisp/c/loadelf.c +++ b/lisp/c/loadelf.c @@ -208,7 +208,7 @@ pointer *argv; ckarg(2); if (!isldmod(argv[0])) error(E_USER,(pointer)"not a LOAD-MODULE"); if (!iscons(argv[1])) error(E_NOLIST); -#if x86_64 +#if (WORD_SIZE == 64) dlhandle=(void *)((eusinteger_t)(argv[0]->c.ldmod.handle) & ~3L); #else dlhandle=(void *)((eusinteger_t)(argv[0]->c.ldmod.handle) & ~3); @@ -313,7 +313,7 @@ pointer argv[]; else mod=sysmod; if (!isldmod(mod)) error(E_USER,(pointer)"not a LOAD-MODULE"); entry_string=(char *)get_string(argv[0]); -#if x86_64 +#if (WORD_SIZE == 64) entry=(pointer)dlsym((void *)((eusinteger_t)(mod->c.ldmod.handle) & ~3L), entry_string); #else entry=(pointer)dlsym((void *)((eusinteger_t)(mod->c.ldmod.handle) & ~3), entry_string); @@ -334,7 +334,7 @@ pointer argv[]; else mod=sysmod; if (!isldmod(mod)) error(E_USER,(pointer)"not a LOAD-MODULE"); entry_string=(char *)get_string(argv[0]); -#if x86_64 +#if (WORD_SIZE == 64) entry=(pointer)dlsym((void *)((eusinteger_t)(mod->c.ldmod.handle) & ~3L), entry_string); #else entry=(pointer)dlsym((void *)((eusinteger_t)(mod->c.ldmod.handle) & ~3), entry_string); @@ -358,7 +358,7 @@ pointer *argv; register int stat; ckarg(1); if (!isldmod(mod)) error(E_USER,(pointer)"not a compiled-module"); -#if x86_64 +#if (WORD_SIZE == 64) stat=dlclose((void *)((eusinteger_t)(mod->c.ldmod.handle) & ~3L)); #else stat=dlclose((void *)((eusinteger_t)(mod->c.ldmod.handle) & ~3)); diff --git a/lisp/c/memory.c b/lisp/c/memory.c index 0eec679b2..870fefbd0 100644 --- a/lisp/c/memory.c +++ b/lisp/c/memory.c @@ -416,7 +416,7 @@ pointer *gcstack, *gcsplimit, *gcsp; #define out_of_heap(p) ((int)p<(int)_end || (pointer)0x20000000stack; pvsp; p++) { mark_state=(long)p; -#ifdef x86_64 +#if (WORD_SIZE == 64) if ((((eusinteger_t)(*p) & 7L)==0L) && #else if ((((eusinteger_t)(*p) & 3)==0) && @@ -605,7 +605,7 @@ register bpointer p; if (s->c.fstream.fd==makeint(0) || s->c.fstream.fd==makeint(1)) { fprintf(stderr,";; gc! bogus stream at %lx fd=%ld\n", (unsigned long int)s,intval(s->c.fstream.fd));} -#if x86_64 +#if (WORD_SIZE == 64) else if (s->c.fstream.fd == 0) { // Sometimes, s->c.fstream.fd is 0. // c.fstream.fd should be eus integer which least 2bits is 10. diff --git a/lisp/c/reader.c b/lisp/c/reader.c index d2d95105f..30b0c1d89 100644 --- a/lisp/c/reader.c +++ b/lisp/c/reader.c @@ -254,7 +254,7 @@ eusinteger_t labx; #endif #if sun4 || vax || news || mips || alpha || i386 unsolp=(pointer *)((eusinteger_t)unsol & ~3);/*???? */ -#elif x86_64 +#elif (WORD_SIZE == 64) unsolp=(pointer *)((eusinteger_t)unsol & ~3L);/*???? */ #endif unsol= *unsolp; diff --git a/lisp/c/specials.c b/lisp/c/specials.c index 06ff80ebe..95b6ff6a7 100644 --- a/lisp/c/specials.c +++ b/lisp/c/specials.c @@ -167,7 +167,7 @@ register pointer argv[]; if (iscode(mac)) { #if ARM eusinteger_t addr = (eusinteger_t)(mac->c.code.entry); -#ifdef x86_64 +#if (WORD_SIZE == 64) addr &= ~3L; /*0xfffffffc; ???? */ #else addr &= ~3; /*0xfffffffc; ???? */ diff --git a/lisp/c/sysfunc.c b/lisp/c/sysfunc.c index 62dee1a5d..314aaf2fc 100644 --- a/lisp/c/sysfunc.c +++ b/lisp/c/sysfunc.c @@ -117,7 +117,7 @@ register pointer p; if ((&ctx->stack[0]<=p) && (p<= &ctx->stack[MAXSTACK])) return(NULL); #endif if (issymbol(p)) return((long int)NULL); -#if x86_64 +#if (WORD_SIZE == 64) bp=(bpointer)((eusinteger_t)p & ~3L); #else bp=(bpointer)((eusinteger_t)p & ~3); @@ -152,7 +152,7 @@ register pointer p; #if sun if (p<(pointer)0x10000) return(NULL); #endif -#if x86_64 +#if (WORD_SIZE == 64) bp=(bpointer)((eusinteger_t)p & ~3L/*0xfffffffc*/);/* ???? */ #else bp=(bpointer)((eusinteger_t)p & ~3/*0xfffffffc*/);/* ???? */ diff --git a/lisp/l/constants.l b/lisp/l/constants.l index a93cdb8c1..6f1e56b2a 100644 --- a/lisp/l/constants.l +++ b/lisp/l/constants.l @@ -31,7 +31,7 @@ (nconc *features* '(:m68020)) ; -#+(or :alpha :irix6 :x86_64) +#+(or :alpha :irix6 :x86_64 :aarch64) (progn (defconstant sizeof-* 8) (defconstant sizeof-long 8) @@ -50,7 +50,7 @@ (defconstant pi 3.14159265358979323846) (defconstant pi/2 1.57079632679489661923) ) -#-(or :alpha :irix6 :x86_64) +#-(or :alpha :irix6 :x86_64 :aarch64) (progn (defconstant sizeof-* 4) (defconstant sizeof-long 4) diff --git a/lisp/l/eusforeign.l b/lisp/l/eusforeign.l index a08f934c9..20570e5fc 100644 --- a/lisp/l/eusforeign.l +++ b/lisp/l/eusforeign.l @@ -156,9 +156,9 @@ (defmethod foreign-pod (:pod-address () -#-:x86_64 +#-(or :x86_64 :aarch64) (+ 8 (sys:address podcode)) -#+:x86_64 +#+(or :x86_64 :aarch64) (+ 16 (sys:address podcode)) ) (:init (param result func) diff --git a/lisp/l/string.l b/lisp/l/string.l index 9394f0b76..bb5fcee81 100644 --- a/lisp/l/string.l +++ b/lisp/l/string.l @@ -136,10 +136,10 @@ (if (numberp val) (sys:poke val self pos type) (let ((offset (cdr (assoc type -#-(or :alpha :irix6 :x86_64) +#-(or :alpha :irix6 :x86_64 :aarch64) '((:short . 2) (:long . 4) (:byte . 1) (:char . 1) (:int . 4) (:integer . 4) (:float . 4) (:double . 8)) -#+(or :alpha :irix6 :x86_64) +#+(or :alpha :irix6 :x86_64 :aarch64) '((:short . 2) (:long . 8) (:byte . 1) (:char . 1) (:int . 4) (:integer . 4) (:float . 4) (:double . 8)) )))) diff --git a/lisp/opengl/src/glforeign.l b/lisp/opengl/src/glforeign.l index d583d767c..f5fcfa357 100644 --- a/lisp/opengl/src/glforeign.l +++ b/lisp/opengl/src/glforeign.l @@ -317,7 +317,7 @@ glVertex4sv glViewport)) -#+:x86_64 +#+(or :x86_64 :aarch64) (defmacro set-function-fv-as-dv (funcfv funcdv) `(progn (setf (symbol-function ',(read-from-string @@ -326,7 +326,7 @@ (setf (symbol-function ',funcfv) (symbol-function ',funcdv)) )) -#+:x86_64 +#+(or :x86_64 :aarch64) (eval-when (load) ;; func_fv has to work as func_dv in x86_64 (set-function-fv-as-dv glColor3fv glColor3dv) @@ -360,23 +360,23 @@ (setf (symbol-function 'glGenTexturesEXT-org) (symbol-function 'glGenTexturesEXT))) ) -#+:x86_64 +#+(or :x86_64 :aarch64) (defun glMaterialfv (face pname fv) (let ((tmp (user::dvector2float-bytestring fv))) (glMaterialfv-org face pname tmp) )) -#+:x86_64 +#+(or :x86_64 :aarch64) (defun glGetMaterialfv (face pname fv) (let ((tmp (user::dvector2float-bytestring fv)) ret) (setq ret (glGetMaterialfv-org face pname tmp)) (user::float-bytestring2dvector tmp fv) ret)) -#+:x86_64 +#+(or :x86_64 :aarch64) (defun glLightfv (light pname fv) (let ((tmp (user::dvector2float-bytestring fv))) (glLightfv-org light pname tmp) )) -#+:x86_64 +#+(or :x86_64 :aarch64) (if (fboundp 'glGenTexturesEXT-org) (setf (symbol-function 'glGenTexturesEXT) #'(lambda (len iv) diff --git a/lisp/opengl/src/gluforeign.l b/lisp/opengl/src/gluforeign.l index 858421df4..0b2d123f0 100644 --- a/lisp/opengl/src/gluforeign.l +++ b/lisp/opengl/src/gluforeign.l @@ -69,7 +69,7 @@ gluGetNurbsProperty gluNurbsCallback )) -#+:x86_64 +#+(or :x86_64 :aarch64) (eval-when (load) ;; define wrapped functions later (setf (symbol-function 'gluNurbsProperty-org) @@ -83,13 +83,13 @@ (setf (symbol-function 'gluNurbsSurface-org) (symbol-function 'gluNurbsSurface)) ) -#+:x86_64 +#+(or :x86_64 :aarch64) (defun gluNurbsCurve (nobj nknots knot stride ctlarray order type) (let ((fknot (user::dvector2float-bytestring knot)) (fctlarray (user::dvector2float-bytestring ctlarray))) (gluNurbsCurve-org nobj nknots fknot stride fctlarray order type) )) -#+:x86_64 +#+(or :x86_64 :aarch64) (defun gluNurbsSurface (nurb sknotcount sknots tknotCount tknots sstride tstride control sorder torder type) (let ((fsknots (user::dvector2float-bytestring sknots)) diff --git a/lisp/opengl/src/glview.l b/lisp/opengl/src/glview.l index bcf3da6dd..abdc39faa 100644 --- a/lisp/opengl/src/glview.l +++ b/lisp/opengl/src/glview.l @@ -168,12 +168,12 @@ (glXChooseVisual x::*display* (x::DefaultScreen x::*display*) *attributelist*)) (setq glcon (glXCreateContext x::*display* visualinfo shared-glcon GL_TRUE)) -#-:x86_64 +#-(or :x86_64 :aarch64) (send-super* :create :depth (sys:peek (+ visualinfo 12) :long) :visual (sys:peek visualinfo :long) :title title args) -#+:x86_64 +#+(or :x86_64 :aarch64) (send-super* :create :depth (sys:peek (+ visualinfo 20) :integer) :visual (sys:peek visualinfo :long) diff --git a/lisp/opengl/src/glxforeign.l b/lisp/opengl/src/glxforeign.l index 5a9d3f9f7..ce456ff2e 100644 --- a/lisp/opengl/src/glxforeign.l +++ b/lisp/opengl/src/glxforeign.l @@ -27,7 +27,7 @@ glXUseXFont glXWaitGL glXWaitX)) -#+:x86_64 +#+(or :x86_64 :aarch64) (eval-when (load) (setf (symbol-function 'glxchoosevisual-for-wrap) (symbol-function 'glxchoosevisual)) diff --git a/lisp/opengl/src/oglforeign.c.c b/lisp/opengl/src/oglforeign.c.c index a696d8a34..9674a8e55 100755 --- a/lisp/opengl/src/oglforeign.c.c +++ b/lisp/opengl/src/oglforeign.c.c @@ -41,7 +41,7 @@ char *xentry; dlhandle=(eusinteger_t)dlopen(0, RTLD_LAZY); entry=(eusinteger_t)dlsym(dlhandle, xentry); #else -#if x86_64 +#if (WORD_SIZE == 64) entry=(eusinteger_t)dlsym((void *)((eusinteger_t)(sysmod->c.ldmod.handle) & ~3L), xentry); #else entry=(eusinteger_t)dlsym((void *)((eusinteger_t)(sysmod->c.ldmod.handle) & ~3), xentry); @@ -585,7 +585,7 @@ pointer argv[]; defoglforeign(ctx,"alloctessinfo"); defoglforeign(ctx,"tess_vertex_cb"); defoglforeign(ctx,"glDepthRangefv"); -#if x86_64 +#if (WORD_SIZE == 64) defoglforeign(ctx,"glPointSized"); defoglforeign(ctx,"glLineWidthd"); defoglforeign(ctx,"gluNurbsPropertyd"); diff --git a/lisp/opengl/src/util.c b/lisp/opengl/src/util.c index b56e5b902..9c6b895b6 100644 --- a/lisp/opengl/src/util.c +++ b/lisp/opengl/src/util.c @@ -264,7 +264,7 @@ void glPolygonOffsetEXTfv(v) } #endif -#if x86_64 +#if (WORD_SIZE == 64) void glPointSized (double d) { glPointSize((float)d); } diff --git a/lisp/xwindow/Xeus.l b/lisp/xwindow/Xeus.l index 553c13c30..7f65bf11a 100644 --- a/lisp/xwindow/Xeus.l +++ b/lisp/xwindow/Xeus.l @@ -170,9 +170,9 @@ (:GetImage (&key (xy nil) (x 0) (y 0) (width (- (send self :width) x)) (height (- (send self :height) y)) -#-(or :alpha :irix6 :x86_64) +#-(or :alpha :irix6 :x86_64 :aarch64) (mask #xffffffff) -#+(or :alpha :irix6 :x86_64) +#+(or :alpha :irix6 :x86_64 :aarch64) (mask #xfffffffffffffff) (format 2)) ;; #define XYBitmap 0 /* depth 1, XYFormat */ @@ -180,13 +180,13 @@ ;; #define ZPixmap 2 /* depth == drawable depth */ (if xy (setq x (aref xy 0) y (aref xy 1))) (let* ((ximg (getimage *display* drawable x y width height mask format)) -#-(or :alpha :irix6 :x86_64) +#-(or :alpha :irix6 :x86_64 :aarch64) (pixsize (/ (sys:peek (+ ximg #x2c) :integer) 8)) -#+(or :alpha :irix6 :x86_64) +#+(or :alpha :irix6 :x86_64 :aarch64) (pixsize (/ (sys:peek (+ ximg #x30) :integer) 8)) -#-(or :alpha :irix6 :x86_64) +#-(or :alpha :irix6 :x86_64 :aarch64) (rowsize (sys:peek (+ ximg #x28) :integer)) -#+(or :alpha :irix6 :x86_64) +#+(or :alpha :irix6 :x86_64 :aarch64) (rowsize (sys:peek (+ ximg #x2c) :integer)) (xoffset (sys:peek (+ ximg 8) :integer)) (ximgdata (sys:peek (+ ximg #x10) :long)) @@ -535,11 +535,7 @@ (setf (SetWindowAttributes-win_gravity swa) (gravity-to-value gravity)) (unless color-map (cond ((= vi *visual*) ;use parent's colormap for the default - (setq color-map (send parent :colormap)) - (unless (derivedp color-map colormap) - (warning-message 2 "~s's parent ~s does not have cmap; root cmap is used." - self parent) - (setq color-map *color-map*))) + (setq color-map (send parent :colormap))) (t ;make private cmap (setq color-map (instance colormap :create :visual vi)) (send color-map :copy-colors *color-map* 0 32)) )) @@ -635,8 +631,13 @@ (integer-vector (send attr :get 'width) (send attr :get 'height))) (:depth () (send (send self :attributes) :get 'depth)) (:screen () (send (send self :attributes) :get 'screen)) - (:ColorMap () (gethash (send (send self :attributes) :get 'colormap) - *xwindows-hash-tab*)) + (:ColorMap () (let ((color-map (gethash (send (send self :attributes) :get 'colormap) + *xwindows-hash-tab*))) + (unless (derivedp color-map colormap) + (warning-message 2 "~s's parent ~s does not have cmap; root cmap is used.~%" + self parent) + (setq color-map *color-map*)) + color-map)) (:root () (send (send self :attributes) :get 'root)) ;drawable id of the root (:title (title) ;(send self :unmap) diff --git a/lisp/xwindow/Xevent.l b/lisp/xwindow/Xevent.l index 039f1d23d..d8eb5c715 100644 --- a/lisp/xwindow/Xevent.l +++ b/lisp/xwindow/Xevent.l @@ -107,13 +107,13 @@ (same-screen :integer) ;14 (focus :integer) ;15 (alt-state :integer) ;16 -#-(or :alpha :irix6 :x86_64) +#-(or :alpha :irix6 :x86_64 :aarch64) (pad :char 28) ;xevent is required to hold 24 longs #+:irix6 (pad :char 84) #+:alpha (pad :char 88) -#+:x86_64 +#+(or :x86_64 :aarch64) (pad :char 92) ;xevent is required to hold xx longs at x86-64 ) @@ -179,14 +179,14 @@ (defun event-root-pos (e) (integer-vector (XEvent-x-root e) (XEvent-y-root e))) -#-:x86_64 +#-(or :x86_64 :aarch64) (defun event-width (e) (XEvent-x e)) -#-:x86_64 +#-(or :x86_64 :aarch64) (defun event-height (e) (XEvent-y e)) -#+:x86_64 +#+(or :x86_64 :aarch64) (defun event-width (e) (sys::peek ;; for width of XConfigureEvent (+ (sys::address e) 16 (* 4 14)) :integer)) -#+:x86_64 +#+(or :x86_64 :aarch64) (defun event-height (e) (sys::peek ;; for height of XConfigureEvent (+ (sys::address e) 16 (* 4 15)) :integer)) @@ -442,11 +442,11 @@ instead of 12th of motoinNotify events." (defun window-main-thread () (sys::thread-no-wait #'window-main-thread2))) -#-(or :alpha :irix6 :x86_64) +#-(or :alpha :irix6 :x86_64 :aarch64) (defun display-fd (&optional (disp *display*)) (if disp (sys:peek (+ disp 8) :long))) -#+(or :alpha :irix6 :x86_64) +#+(or :alpha :irix6 :x86_64 :aarch64) (defun display-fd (&optional (disp *display*)) (if disp (sys:peek (+ disp 16) :integer))) diff --git a/lisp/xwindow/Xgraphics.l b/lisp/xwindow/Xgraphics.l index 80373e083..95c78e5cf 100644 --- a/lisp/xwindow/Xgraphics.l +++ b/lisp/xwindow/Xgraphics.l @@ -185,9 +185,9 @@ (setq id (LoadQueryFont *display* font)) (if (= id 0) (prog1 0 (warn "can't load font ~S" font)) -#-(or :alpha :irix6 :x86_64) +#-(or :alpha :irix6 :x86_64 :aarch64) (sys:peek (+ id 4) :long) -#+(or :alpha :irix6 :x86_64) +#+(or :alpha :irix6 :x86_64 :aarch64) (sys:peek (+ id 8) :long) )))) @@ -228,9 +228,9 @@ bitunit ; bitmap_mad 32? (* width (/ bitunit 8) ; bytes_per_line 'width'? ))) - #-:x86_64 + #-(or :x86_64 :aarch64) (make-foreign-string addr 64) - #+:x86_64 + #+(or :x86_64 :aarch64) (make-foreign-string addr 88) )) @@ -257,7 +257,7 @@ (defparameter *blue-mask* #x00ff0000) -#-(or :alpha :irix6 :x86_64) +#-(or :alpha :irix6 :x86_64 :aarch64) (defun set-ximage (ximage data width height &optional (visual *visual*) (depth (visual-depth visual)) @@ -279,7 +279,7 @@ (sys:poke *blue-mask* ximage 48 :long) ximage) -#+:x86_64 +#+(or :x86_64 :aarch64) (defun set-ximage (ximage data width height &optional (visual *visual*) (depth (visual-depth visual)) @@ -358,9 +358,9 @@ (:gc () gcid) (:copy () (let ((newgc (instance gcontext :create))) -#-(or :alpha :irix6 :x86_64) +#-(or :alpha :irix6 :x86_64 :aarch64) (CopyGC *display* gcid #xffffffff (send newgc :gc)) -#+(or :alpha :irix6 :x86_64) +#+(or :alpha :irix6 :x86_64 :aarch64) (CopyGC *display* gcid #xffffffffffffffff (send newgc :gc)) newgc)) (:function-to-value (f)