*** postgresql-v6.5/src/template/linux_m68k Thu Jun 10 16:18:56 1999 --- postgresql-6.5/src/template/linux_m68k Mon Jun 22 03:04:29 1998 *************** *** 0 **** --- 1,10 ---- + AROPT:crs + CFLAGS:-O2 + SHARED_LIB:-fpic + ALL: + SRCH_INC: + SRCH_LIB: + USE_LOCALE:no + DLSUFFIX:.so + YFLAGS:-d + YACC:bison -y *** postgresql-v6.5/src/include/storage/s_lock.h Wed Apr 14 08:02:00 1999 --- postgresql-6.5/src/include/storage/s_lock.h Wed Jun 9 09:47:54 1999 *************** *** 157,162 **** --- 157,180 ---- #endif /* sparc */ + #if defined(__mc68000__) + #define TAS(lock) tas(lock) + + static __inline__ int + tas(volatile slock_t *lock) + { + register int rv; + + __asm__ __volatile__ ( + "tas %1; sne %0" + : "=d" (rv), "=m"(*lock) + : "1" (*lock) + : "cc" ); + return rv; + } + + #endif /* defined(__mc68000__) */ + #if defined(NEED_VAX_TAS_ASM) /* *************** *** 372,374 **** --- 390,393 ---- #endif /* HAS_TEST_AND_SET */ #endif /* S_LOCK_H */ + *** postgresql-v6.5/src/include/postgres.h Tue May 4 08:00:28 1999 --- postgresql-6.5/src/include/postgres.h Wed Jun 9 09:47:54 1999 *************** *** 63,69 **** --- 63,83 ---- typedef Oid RegProcedure; /* ptr to func returning (char *) */ + #if defined(__mc68000__) && defined(__ELF__) + /* The m68k SVR4 ABI defines that pointers are returned in %a0 instead of + * %d0. So if a function pointer is declared to return a pointer, the + * compiler may look only into %a0, but if the called function was declared + * to return return an integer type, it puts its value only into %d0. So the + * caller doesn't pink up the correct return value. The solution is to + * declare the function pointer to return int, so the compiler picks up the + * return value from %d0. (Functions returning pointers put their value + * *additionally* into %d0 for compability.) The price is that there are + * some warnings about int->pointer conversions... + */ + typedef int32 ((*func_ptr) ()); + #else typedef char *((*func_ptr) ()); + #endif #define RegProcedureIsValid(p) OidIsValid(p)