Skip to content

Commit

Permalink
fix for aarch64 (ARM64)
Browse files Browse the repository at this point in the history
  • Loading branch information
YoheiKakiuchi authored and k-okada committed Jan 7, 2017
1 parent 5a8dd24 commit 58c7b51
Show file tree
Hide file tree
Showing 17 changed files with 35 additions and 35 deletions.
2 changes: 1 addition & 1 deletion lisp/c/arith.c
Original file line number Diff line number Diff line change
Expand Up @@ -1307,7 +1307,7 @@ register pointer argv[];
val=intval(argv[0]);
if (count<=0) return(makeint(val>>(-count)));
if (val<=0) { return(makeint(val<<count));}
#ifdef x86_64
#if (WORD_SIZE == 64)
firstone=ffsl(val);
#else
firstone=ffs(val);
Expand Down
2 changes: 1 addition & 1 deletion lisp/c/eus.h
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,7 @@ extern eusinteger_t intval(pointer p);
#endif

#if sun3 || sun4 || system5 || apollo || news || sanyo || vxworks || mips || NEXT || i386 || i486 || i586 || x86_64 || ARM
#if x86_64
#if (WORD_SIZE == 64)
#define fltval(p) (nu.ival=((eusinteger_t)(p) & ~3L), nu.fval)
#define makeflt(f) (nu.fval=(eusfloat_t)(f), (pointer)((nu.ival & ~3L) | 1L))
#else
Expand Down
4 changes: 2 additions & 2 deletions lisp/c/eval.c
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ pointer args[];
#else /* IRIX */

/* not IRIS */
#if (x86_64 || aarch64)
#if (defined(x86_64) || defined(aarch64))
extern long exec_function_i(void (*)(), long *, long *, long, long *);
extern long exec_function_f(void (*)(), long *, long *, long, long *);

Expand Down Expand Up @@ -1262,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; ???? */
Expand Down
2 changes: 1 addition & 1 deletion lisp/c/fcall.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions lisp/c/fstringdouble.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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);
Expand Down
8 changes: 4 additions & 4 deletions lisp/c/loadelf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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));
Expand Down
6 changes: 3 additions & 3 deletions lisp/c/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ pointer *gcstack, *gcsplimit, *gcsp;
#define out_of_heap(p) ((int)p<(int)_end || (pointer)0x20000000<p)
#else /* Solaris2 */
#if Linux
#if x86_64
#if (WORD_SIZE == 64)
#define out_of_heap(p) ((unsigned long)p<(unsigned long)_end || (pointer)maxmemory <p)
#else
#define out_of_heap(p) ((unsigned int)p<(unsigned int)_end || (pointer)maxmemory <p)
Expand Down Expand Up @@ -554,7 +554,7 @@ void markall()
/* mark from thread's stack */
for (p=ctx->stack; p<ctx->vsp; 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) &&
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion lisp/c/reader.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lisp/c/specials.c
Original file line number Diff line number Diff line change
Expand Up @@ -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; ???? */
Expand Down
4 changes: 2 additions & 2 deletions lisp/c/sysfunc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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*/);/* ???? */
Expand Down
4 changes: 2 additions & 2 deletions lisp/l/eusforeign.l
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
12 changes: 6 additions & 6 deletions lisp/opengl/src/glforeign.l
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions lisp/opengl/src/gluforeign.l
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
gluGetNurbsProperty
gluNurbsCallback
))
#+:x86_64
#+(or :x86_64 :aarch64)
(eval-when (load)
;; define wrapped functions later
(setf (symbol-function 'gluNurbsProperty-org)
Expand All @@ -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))
Expand Down
4 changes: 2 additions & 2 deletions lisp/opengl/src/glview.l
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion lisp/opengl/src/glxforeign.l
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
4 changes: 2 additions & 2 deletions lisp/opengl/src/oglforeign.c.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion lisp/opengl/src/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ void glPolygonOffsetEXTfv(v)
}
#endif

#if x86_64
#if (WORD_SIZE == 64)
void glPointSized (double d) {
glPointSize((float)d);
}
Expand Down

0 comments on commit 58c7b51

Please sign in to comment.