MacOSCompat.cpp File Reference

#include <support/atomic.h>
#include <support/ByteOrder.h>
#include <support/Errors.h>
#include <support/StdIO.h>
#include <support/String.h>
#include <support/SupportDefs.h>
#include <support/TLS.h>
#include <PalmTypesCompatibility.h>
#include <float.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <limits.h>
#include <pthread.h>
#include <semaphore.h>
#include <time.h>
#include <ErrorMgr.h>
#include <LocaleMgr.h>
#include <TextMgr.h>
#include <TextMgrPrv.h>
#include <SysThreadConcealed.h>
#include <sys/kernel.h>

Functions

int32_t atomic_add (volatile int32_t *location, int32_t addvalue)
int32_t atomic_and (volatile int32_t *location, int32_t andvalue)
int32_t atomic_or (volatile int32_t *location, int32_t orvalue)
status_t close_binder (int desc)
int32_t compare_and_swap32 (volatile int32_t *location, int32_t oldValue, int32_t newValue)
int32_t compare_and_swap64 (volatile int64_t *location, int64_t oldValue, int64_t newValue)
void ErrFatalErrorInContext (const char *fileName, uint32_t lineNum, const char *errMsg)
status_t get_image_symbol (image_id imid, const char *name, int32_t sclass, void **ptr)
status_t get_nth_image_symbol (image_id imid, int32_t index, char *buf, int32_t *bufsize, int32_t *sclass, void **ptr)
void * inplace_realloc (void *, size_t)
 Perform a realloc, but only if it won't change the location of the memory.
status_t ioctl_binder (int desc, int cmd, void *data, int32_t len)
status_t KALCurrentThreadDelay (nsecs_t timeout, timeoutFlags_t flags)
CharEncodingType LmGetSystemLocale (LmLocaleType *oSystemLocale)
image_id load_add_on (const char *path)
int open_binder (int teamID)
ssize_t read_binder (int desc, void *data, size_t numBytes)
int32_t SysAtomicDec32 (volatile int32_t *location)
int32_t SysAtomicInc32 (volatile int32_t *location)
SysHandle SysCurrentThread (void)
 Return the handle for the calling thread.
nsecs_t SysGetRunTime ()
 Return the amount of time (in nanoseconds) the system has been running.
uint32_t SysProcessID ()
const char * SysProcessName ()
status_t SysSemaphoreCreateEZ (uint32_t initialCount, SysHandle *outSemaphore)
status_t SysSemaphoreDestroy (SysHandle semaphore)
status_t SysSemaphoreSignal (SysHandle semaphore)
status_t SysSemaphoreWait (SysHandle semaphore, timeoutFlags_t iTimeoutFlags, nsecs_t iTimeout)
status_t SysSemaphoreWaitCount (SysHandle sem, timeoutFlags_t iTimeoutFlags, nsecs_t iTimeout, uint32_t count)
nsecs_t system_real_time (void)
status_t SysThreadInstallExitCallback (SysThreadExitCallbackFunc *iExitCallbackP, void *iCallbackArg, SysThreadExitCallbackID *oThreadExitCallbackId)
status_t SysTSDAllocate (SysTSDSlotID *oTSDSlot, SysTSDDestructorFunc *iDestructor, uint32_t iName)
status_t SysTSDFree (SysTSDSlotID tsdslot)
void * SysTSDGet (SysTSDSlotID tsdslot)
void SysTSDSet (SysTSDSlotID tsdslot, void *data)
status_t TxtConvertEncoding (Boolean newConversion, TxtConvertStateType *ioStateP, const char *srcTextP, size_t *ioSrcBytes, CharEncodingType srcEncoding, char *dstTextP, size_t *ioDstBytes, CharEncodingType dstEncoding, const char *substitutionStr, size_t substitutionLen)
status_t TxtDeviceToUTF32Lengths (const uint8_t *srcTextP, size_t srcBytes, wchar32_t *dstTextP, uint8_t *srcCharLengths, size_t dstLength)
size_t TxtSetNextChar (char *iTextP, size_t iOffset, wchar32_t iChar)
status_t unload_add_on (image_id imid)
ssize_t write_binder (int desc, void *data, size_t numBytes)


Function Documentation

int32_t atomic_add volatile int32_t *  location,
int32_t  addvalue
 

int32_t atomic_and volatile int32_t *  location,
int32_t  andvalue
 

int32_t atomic_or volatile int32_t *  location,
int32_t  orvalue
 

status_t close_binder int  desc  ) 
 

int32_t compare_and_swap32 volatile int32_t *  location,
int32_t  oldValue,
int32_t  newValue
 

int32_t compare_and_swap64 volatile int64_t *  location,
int64_t  oldValue,
int64_t  newValue
 

void ErrFatalErrorInContext const char *  fileName,
uint32_t  lineNum,
const char *  errMsg
 

status_t get_image_symbol image_id  imid,
const char *  name,
int32_t  sclass,
void **  ptr
 

status_t get_nth_image_symbol image_id  imid,
int32_t  index,
char *  buf,
int32_t *  bufsize,
int32_t *  sclass,
void **  ptr
 

status_t ioctl_binder int  desc,
int  cmd,
void *  data,
int32_t  len
 

status_t KALCurrentThreadDelay nsecs_t  timeout,
timeoutFlags_t  flags
 

CharEncodingType LmGetSystemLocale LmLocaleType oSystemLocale  ) 
 

image_id load_add_on const char *  path  ) 
 

int open_binder int  teamID  ) 
 

ssize_t read_binder int  desc,
void *  data,
size_t  numBytes
 

int32_t SysAtomicDec32 volatile int32_t *  location  ) 
 

int32_t SysAtomicInc32 volatile int32_t *  location  ) 
 

SysHandle SysCurrentThread void   ) 
 

Return the handle for the calling thread.

nsecs_t SysGetRunTime void   ) 
 

Return the amount of time (in nanoseconds) the system has been running.

This time does not include time during which the device is asleep.

uint32_t SysProcessID void   ) 
 

const char* SysProcessName void   ) 
 

status_t SysSemaphoreCreateEZ uint32_t  initialCount,
SysHandle outSemaphore
 

status_t SysSemaphoreDestroy SysHandle  semaphore  ) 
 

status_t SysSemaphoreSignal SysHandle  semaphore  ) 
 

status_t SysSemaphoreWait SysHandle  semaphore,
timeoutFlags_t  iTimeoutFlags,
nsecs_t  iTimeout
 

status_t SysSemaphoreWaitCount SysHandle  sem,
timeoutFlags_t  iTimeoutFlags,
nsecs_t  iTimeout,
uint32_t  count
 

nsecs_t system_real_time void   ) 
 

status_t SysThreadInstallExitCallback SysThreadExitCallbackFunc iExitCallbackP,
void *  iCallbackArg,
SysThreadExitCallbackID oThreadExitCallbackId
 

status_t SysTSDAllocate SysTSDSlotID oTSDSlot,
SysTSDDestructorFunc iDestructor,
uint32_t  iName
 

status_t SysTSDFree SysTSDSlotID  tsdslot  ) 
 

void* SysTSDGet SysTSDSlotID  tsdslot  ) 
 

void SysTSDSet SysTSDSlotID  tsdslot,
void *  data
 

status_t TxtConvertEncoding Boolean  newConversion,
TxtConvertStateType ioStateP,
const char *  srcTextP,
size_t *  ioSrcBytes,
CharEncodingType  srcEncoding,
char *  dstTextP,
size_t *  ioDstBytes,
CharEncodingType  dstEncoding,
const char *  substitutionStr,
size_t  substitutionLen
 

status_t TxtDeviceToUTF32Lengths const uint8_t *  srcTextP,
size_t  srcBytes,
wchar32_t dstTextP,
uint8_t *  srcCharLengths,
size_t  dstLength
 

size_t TxtSetNextChar char *  iTextP,
size_t  iOffset,
wchar32_t  iChar
 

status_t unload_add_on image_id  imid  ) 
 

ssize_t write_binder int  desc,
void *  data,
size_t  numBytes