/************************************************************************
 *
 * This file contains the platform-dependent definitions for the PowerPC chip
 * running Linux 2.x or later.
 *
 *	Copyright (C) 1999-2008 Cincom Systems, Inc.
 *
 ************************************************************************/

#define LEFT_BIT_FIELD_ORDER 1 /* Compiler ordering of bit fields in structs */

#define HaveCleanSignals TRUE
#ifdef PLATFORM_SIGNAL_HANDLER
#   define CanSmashRegisters TRUE
#else
#   define CanSmashRegisters FALSE
#endif
#define HaveLimitRegister TRUE
/*#define HaveLimitRegister FALSE*/

#if UseEdenAllocRegister && !defined(assembly)
register void *edenAllocAndLimitRegister asm("r26");
#endif

#define bytesInNMethodZone (1152 * 1024)

/* Ideally this would be defined in the processor include file, but differences
 * in platform assembler syntax makes this a better place.
 */
#define GlueProc "glueLinuxPPC.h"
/* This is potentially OS-specific and so does belong here.
 */
#define platcallc_h "linuxPPCCallC.h"

/* I/O defines */
#define PLAT_OSNAME "unix sysV PowerPC linux"

/* Use sbrk for initial alloc to ensure permSpace is below any new old segs. */
#define MORE_MEMORY_USES_SBRK 1
#define USV 1
#define USVR4 1
#ifndef F_ULOCK
#	define F_ULOCK 0
#	define F_LOCK  1
#	define F_TLOCK 2
#	define F_TEST  3
#endif

/* To interoperate with Linux Threads the stack zone needs to be allocated
 * on the stack.
 */
#define ALLOCATE_STACKZONE_ON_C_STACK TRUE

/* The System V ABI requires 16-byte alignment.
 */
#define C_STACK_POINTER_BYTE_ALIGNMENT 16
#if defined(__GNUC__)
# define getsp() ({ register void *sp;						\
	asm volatile ("ori  %0,1,0" : "=r"(sp) : : "memory");	\
	sp; })
#elif !defined(assembly)
extern void *getsp(void);
#endif

#define HaveWriteSigiosOnDisplayConnection TRUE

#define pdFPUType() 1
#define DOUBLES_ALIGNED

#if !defined(PLATFORM_SUPPORTS_64_BITS)
#	define PLATFORM_SUPPORTS_64_BITS 1
#endif
#define HAS_64_BIT_ARITHMETIC 1
#ifndef assembly
typedef long long longlong;
typedef unsigned long long ulonglong;
#endif
