org.jikesrvm.runtime
Class SysCall

java.lang.Object
  extended by org.jikesrvm.runtime.SysCall

public abstract class SysCall
extends Object

Support for lowlevel (ie non-JNI) invocation of C functions with static addresses. All methods of this class have the following signature:

 public abstract  NAME()
 
which will call the corresponding method in system call trampoline with the added function address from the boot image.

NOTE: From the standpoint of the rest of the VM, an invocation to a method of SysCall is uninterruptible.

NOTE: There must be a matching field NAMEIP in BootRecord.java for each method declared here.


Field Summary
static SysCall sysCall
          Actual implementation of the SysCall class
 
Constructor Summary
SysCall()
           
 
Method Summary
abstract  Address gcspyDriverAddStream(Address driver, int id)
           
abstract  void gcspyDriverEndOutput(Address driver)
           
abstract  void gcspyDriverInit(Address driver, int id, Address serverName, Address driverName, Address title, Address blockInfo, int tileNum, Address unused, int mainSpace)
           
abstract  void gcspyDriverInitOutput(Address driver)
           
abstract  void gcspyDriverResize(Address driver, int size)
           
abstract  void gcspyDriverSetTileName(Address driver, int i, Address start, long value)
           
abstract  void gcspyDriverSetTileNameRange(Address driver, int i, Address start, Address end)
           
abstract  void gcspyDriverSpaceInfo(Address driver, Address info)
           
abstract  void gcspyDriverStartComm(Address driver)
           
abstract  void gcspyDriverStream(Address driver, int id, int len)
           
abstract  void gcspyDriverStreamByteValue(Address driver, byte value)
           
abstract  void gcspyDriverStreamIntValue(Address driver, int value)
           
abstract  void gcspyDriverStreamShortValue(Address driver, short value)
           
abstract  void gcspyDriverSummary(Address driver, int id, int len)
           
abstract  void gcspyDriverSummaryValue(Address driver, int value)
           
abstract  void gcspyFormatSize(Address buffer, int size)
           
abstract  void gcspyIntWriteControl(Address driver, int id, int tileNum)
           
abstract  Address gcspyMainServerAddDriver(Address addr)
           
abstract  void gcspyMainServerAddEvent(Address server, int event, Address name)
           
abstract  Address gcspyMainServerInit(int port, int len, Address name, int verbose)
           
abstract  int gcspyMainServerIsConnected(Address server, int event)
           
abstract  Address gcspyMainServerOuterLoop()
           
abstract  void gcspyMainServerSafepoint(Address server, int event)
           
abstract  void gcspyMainServerSetGeneralInfo(Address server, Address info)
           
abstract  void gcspyMainServerStartCompensationTimer(Address server)
           
abstract  void gcspyMainServerStopCompensationTimer(Address server)
           
abstract  int gcspySprintf(Address str, Address format, Address value)
           
abstract  void gcspyStartserver(Address server, int wait, Address serverOuterLoop)
           
abstract  void gcspyStreamInit(Address stream, int id, int dataType, Address name, int minValue, int maxValue, int zeroValue, int defaultValue, Address pre, Address post, int presentation, int paintStyle, int maxStreamIndex, int red, int green, int blue)
           
abstract  int sysAccess(byte[] name, int kind)
           
abstract  int sysArg(int argno, byte[] buf, int buflen)
           
abstract  int sysBytesAvailable(int fd)
           
abstract  Address sysCalloc(int length)
           
abstract  void sysConsoleWriteChar(char v)
           
abstract  void sysConsoleWriteDouble(double value, int postDecimalDigits)
           
abstract  void sysConsoleWriteInteger(int value, int hexToo)
           
abstract  void sysConsoleWriteLong(long value, int hexToo)
           
abstract  void sysCopy(Address dst, Address src, Extent cnt)
           
abstract  void sysCreateThreadSpecificDataKeys()
           
abstract  long sysCurrentTimeMillis()
           
abstract  void sysDisableAlignmentChecking()
           
abstract  Address sysDlopen(byte[] libname)
           
abstract  Address sysDlsym(Address libHandler, byte[] symbolName)
           
abstract  double sysDoubleRemainder(double x, double y)
           
abstract  int sysDoubleToInt(double x)
           
abstract  long sysDoubleToLong(double x)
           
abstract  void sysEnableAlignmentChecking()
           
abstract  void sysExit(int value)
           
abstract  int sysFloatToInt(float x)
           
abstract  long sysFloatToLong(float x)
           
abstract  void sysFree(Address location)
           
abstract  int sysGetenv(byte[] varName, byte[] buf, int limit)
           
abstract  int sysGetPageSize()
           
abstract  void sysInitializeStartupLocks(int howMany)
           
abstract  long sysLongDivide(long x, long y)
           
abstract  long sysLongRemainder(long x, long y)
           
abstract  double sysLongToDouble(long x)
           
abstract  float sysLongToFloat(long x)
           
abstract  Address sysMalloc(int length)
           
abstract  Address sysMMap(Address start, Extent length, int protection, int flags, int fd, Offset offset)
           
abstract  Address sysMMapErrno(Address start, Extent length, int protection, int flags, int fd, Offset offset)
           
abstract  int sysMProtect(Address start, Extent length, int prot)
           
abstract  void sysNanosleep(long howLongNanos)
           
abstract  long sysNanoTime()
           
abstract  int sysNetSelect(int[] allFds, int rc, int wc, int ec)
           
abstract  int sysNetSocketAccept(int fd, SocketImpl connectionObject)
           
abstract  int sysNetSocketBind(int fd, int family, int localAddress, int localPort)
           
abstract  int sysNetSocketClose(int fd)
           
abstract  int sysNetSocketConnect(int fd, int family, int remoteAddress, int remotePort)
           
abstract  int sysNetSocketCreate(int isStream)
           
abstract  int sysNetSocketFamily(int fd)
           
abstract  int sysNetSocketLinger(int fd, int enable, int timeout)
           
abstract  int sysNetSocketListen(int fd, int backlog)
           
abstract  int sysNetSocketLocalAddress(int fd)
           
abstract  int sysNetSocketNoBlock(int fd, int enable)
           
abstract  int sysNetSocketNoDelay(int fd, int enable)
           
abstract  int sysNetSocketPort(int fd)
           
abstract  int sysNetSocketShutdown(int fd, int how)
           
abstract  int sysNetSocketSndBuf(int fd)
           
abstract  int sysNumProcessors()
           
abstract  long sysParseMemorySize(byte[] sizeName, byte[] sizeFlag, byte[] defaultFactor, int roundTo, byte[] argToken, byte[] subArg)
          Parse memory sizes passed as command-line arguments.
abstract  void sysPerfCtrInit(int metric)
           
abstract  void sysPerfCtrRead(byte[] name)
           
abstract  long sysPerfCtrReadCycles()
           
abstract  long sysPerfCtrReadMetric()
           
abstract  float sysPrimitiveParseFloat(byte[] buf)
          Used to parse command line arguments that are doubles and floats early in booting before it is safe to call Float.valueOf or Double.valueOf.
abstract  int sysPrimitiveParseInt(byte[] buf)
          Used to parse command line arguments that are bytes and ints early in booting before it is safe to call Byte.parseByte or Integer.parseInt.
abstract  void sysPthreadExit()
           
abstract  int sysPthreadJoin(int pthread)
           
abstract  int sysPthreadSelf()
           
abstract  void sysPthreadSetupSignalHandling()
           
abstract  int sysPthreadSignal(int pthread)
           
abstract  int sysReadByte(int fd)
           
abstract  int sysReadBytes(int fd, Address buf, int cnt)
           
abstract  void sysRegisterStaticFieldOffsets(int gcStatusOffset, int timerTickOffset, int reportedTimerTickOffset)
           
abstract  void sysReportAlignmentChecking()
           
abstract  int sysSetFdCloseOnExec(int fd)
           
abstract  int sysStashVmProcessorInPthread(Processor vmProcessor)
           
abstract  int sysStat(byte[] name, int kind)
           
abstract  void sysSyncCache(Address address, int size)
           
abstract  int sysSyncFile(int fd)
           
abstract  void sysVirtualProcessorBind(int cpuid)
          Bind execution of current virtual processor to specified physical cpu.
abstract  int sysVirtualProcessorCreate(Address pr, Address ip, Address fp)
          Create a virtual processor (aka "unix kernel thread", "pthread").
abstract  void sysVirtualProcessorEnableTimeSlicing(int timeSlice)
          Start interrupt generator for thread timeslicing.
abstract  void sysVirtualProcessorYield()
           
abstract  void sysWaitForMultithreadingStart()
           
abstract  void sysWaitForVirtualProcessorInitialization()
           
abstract  void sysWaitPids(Address pidArray, Address exitStatusArray, int numPids)
           
abstract  int sysWriteByte(int fd, int data)
           
abstract  int sysWriteBytes(int fd, Address buf, int cnt)
           
abstract  void sysZero(Address dst, Extent cnt)
           
abstract  void sysZeroPages(Address dst, int cnt)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sysCall

public static final SysCall sysCall
Actual implementation of the SysCall class

Constructor Detail

SysCall

public SysCall()
Method Detail

sysConsoleWriteChar

public abstract void sysConsoleWriteChar(char v)

sysConsoleWriteInteger

public abstract void sysConsoleWriteInteger(int value,
                                            int hexToo)

sysConsoleWriteLong

public abstract void sysConsoleWriteLong(long value,
                                         int hexToo)

sysConsoleWriteDouble

public abstract void sysConsoleWriteDouble(double value,
                                           int postDecimalDigits)

sysRegisterStaticFieldOffsets

public abstract void sysRegisterStaticFieldOffsets(int gcStatusOffset,
                                                   int timerTickOffset,
                                                   int reportedTimerTickOffset)

sysExit

public abstract void sysExit(int value)

sysArg

public abstract int sysArg(int argno,
                           byte[] buf,
                           int buflen)

sysGetenv

public abstract int sysGetenv(byte[] varName,
                              byte[] buf,
                              int limit)

sysCopy

public abstract void sysCopy(Address dst,
                             Address src,
                             Extent cnt)

sysMalloc

public abstract Address sysMalloc(int length)

sysCalloc

public abstract Address sysCalloc(int length)

sysFree

public abstract void sysFree(Address location)

sysZero

public abstract void sysZero(Address dst,
                             Extent cnt)

sysZeroPages

public abstract void sysZeroPages(Address dst,
                                  int cnt)

sysSyncCache

public abstract void sysSyncCache(Address address,
                                  int size)

sysPerfCtrInit

public abstract void sysPerfCtrInit(int metric)

sysPerfCtrRead

public abstract void sysPerfCtrRead(byte[] name)

sysPerfCtrReadMetric

public abstract long sysPerfCtrReadMetric()

sysPerfCtrReadCycles

public abstract long sysPerfCtrReadCycles()

sysStat

public abstract int sysStat(byte[] name,
                            int kind)

sysReadByte

public abstract int sysReadByte(int fd)

sysWriteByte

public abstract int sysWriteByte(int fd,
                                 int data)

sysReadBytes

public abstract int sysReadBytes(int fd,
                                 Address buf,
                                 int cnt)

sysWriteBytes

public abstract int sysWriteBytes(int fd,
                                  Address buf,
                                  int cnt)

sysBytesAvailable

public abstract int sysBytesAvailable(int fd)

sysSyncFile

public abstract int sysSyncFile(int fd)

sysSetFdCloseOnExec

public abstract int sysSetFdCloseOnExec(int fd)

sysAccess

public abstract int sysAccess(byte[] name,
                              int kind)

sysMMap

public abstract Address sysMMap(Address start,
                                Extent length,
                                int protection,
                                int flags,
                                int fd,
                                Offset offset)

sysMMapErrno

public abstract Address sysMMapErrno(Address start,
                                     Extent length,
                                     int protection,
                                     int flags,
                                     int fd,
                                     Offset offset)

sysMProtect

public abstract int sysMProtect(Address start,
                                Extent length,
                                int prot)

sysGetPageSize

public abstract int sysGetPageSize()

sysNumProcessors

public abstract int sysNumProcessors()

sysVirtualProcessorCreate

public abstract int sysVirtualProcessorCreate(Address pr,
                                              Address ip,
                                              Address fp)
Create a virtual processor (aka "unix kernel thread", "pthread").

Parameters:
pr -
ip -
fp -
Returns:
virtual processor's o/s handle

sysVirtualProcessorBind

public abstract void sysVirtualProcessorBind(int cpuid)
Bind execution of current virtual processor to specified physical cpu.

Parameters:
cpuid - physical cpu id (0, 1, 2, ...)

sysVirtualProcessorYield

public abstract void sysVirtualProcessorYield()

sysVirtualProcessorEnableTimeSlicing

public abstract void sysVirtualProcessorEnableTimeSlicing(int timeSlice)
Start interrupt generator for thread timeslicing. The interrupt will be delivered to whatever virtual processor happens to be running when the timer expires.


sysPthreadSelf

public abstract int sysPthreadSelf()

sysPthreadSetupSignalHandling

public abstract void sysPthreadSetupSignalHandling()

sysPthreadSignal

public abstract int sysPthreadSignal(int pthread)

sysPthreadExit

public abstract void sysPthreadExit()

sysPthreadJoin

public abstract int sysPthreadJoin(int pthread)

sysStashVmProcessorInPthread

public abstract int sysStashVmProcessorInPthread(Processor vmProcessor)

sysLongDivide

public abstract long sysLongDivide(long x,
                                   long y)

sysLongRemainder

public abstract long sysLongRemainder(long x,
                                      long y)

sysLongToFloat

public abstract float sysLongToFloat(long x)

sysLongToDouble

public abstract double sysLongToDouble(long x)

sysFloatToInt

public abstract int sysFloatToInt(float x)

sysDoubleToInt

public abstract int sysDoubleToInt(double x)

sysFloatToLong

public abstract long sysFloatToLong(float x)

sysDoubleToLong

public abstract long sysDoubleToLong(double x)

sysDoubleRemainder

public abstract double sysDoubleRemainder(double x,
                                          double y)

sysPrimitiveParseFloat

public abstract float sysPrimitiveParseFloat(byte[] buf)
Used to parse command line arguments that are doubles and floats early in booting before it is safe to call Float.valueOf or Double.valueOf. This aborts in case of errors, with an appropriate error message. NOTE: this does not support the full Java spec of parsing a string into a float.

Parameters:
buf - a null terminated byte[] that can be parsed by strtof()
Returns:
the floating-point value produced by the call to strtof() on buf.

sysPrimitiveParseInt

public abstract int sysPrimitiveParseInt(byte[] buf)
Used to parse command line arguments that are bytes and ints early in booting before it is safe to call Byte.parseByte or Integer.parseInt. This aborts in case of errors, with an appropriate error message.

Parameters:
buf - a null terminated byte[] that can be parsed by strtol()
Returns:
the int value produced by the call to strtol() on buf.

sysParseMemorySize

public abstract long sysParseMemorySize(byte[] sizeName,
                                        byte[] sizeFlag,
                                        byte[] defaultFactor,
                                        int roundTo,
                                        byte[] argToken,
                                        byte[] subArg)
Parse memory sizes passed as command-line arguments.


sysCurrentTimeMillis

public abstract long sysCurrentTimeMillis()

sysNanoTime

public abstract long sysNanoTime()

sysNanosleep

public abstract void sysNanosleep(long howLongNanos)

sysDlopen

public abstract Address sysDlopen(byte[] libname)

sysDlsym

public abstract Address sysDlsym(Address libHandler,
                                 byte[] symbolName)

sysNetSocketCreate

public abstract int sysNetSocketCreate(int isStream)

sysNetSocketPort

public abstract int sysNetSocketPort(int fd)

sysNetSocketSndBuf

public abstract int sysNetSocketSndBuf(int fd)

sysNetSocketFamily

public abstract int sysNetSocketFamily(int fd)

sysNetSocketLocalAddress

public abstract int sysNetSocketLocalAddress(int fd)

sysNetSocketBind

public abstract int sysNetSocketBind(int fd,
                                     int family,
                                     int localAddress,
                                     int localPort)

sysNetSocketConnect

public abstract int sysNetSocketConnect(int fd,
                                        int family,
                                        int remoteAddress,
                                        int remotePort)

sysNetSocketListen

public abstract int sysNetSocketListen(int fd,
                                       int backlog)

sysNetSocketAccept

public abstract int sysNetSocketAccept(int fd,
                                       SocketImpl connectionObject)

sysNetSocketLinger

public abstract int sysNetSocketLinger(int fd,
                                       int enable,
                                       int timeout)

sysNetSocketNoDelay

public abstract int sysNetSocketNoDelay(int fd,
                                        int enable)

sysNetSocketNoBlock

public abstract int sysNetSocketNoBlock(int fd,
                                        int enable)

sysNetSocketClose

public abstract int sysNetSocketClose(int fd)

sysNetSocketShutdown

public abstract int sysNetSocketShutdown(int fd,
                                         int how)

sysNetSelect

public abstract int sysNetSelect(int[] allFds,
                                 int rc,
                                 int wc,
                                 int ec)

sysWaitPids

public abstract void sysWaitPids(Address pidArray,
                                 Address exitStatusArray,
                                 int numPids)

sysCreateThreadSpecificDataKeys

public abstract void sysCreateThreadSpecificDataKeys()

sysInitializeStartupLocks

public abstract void sysInitializeStartupLocks(int howMany)

sysWaitForVirtualProcessorInitialization

public abstract void sysWaitForVirtualProcessorInitialization()

sysWaitForMultithreadingStart

public abstract void sysWaitForMultithreadingStart()

sysEnableAlignmentChecking

public abstract void sysEnableAlignmentChecking()

sysDisableAlignmentChecking

public abstract void sysDisableAlignmentChecking()

sysReportAlignmentChecking

public abstract void sysReportAlignmentChecking()

gcspyDriverAddStream

public abstract Address gcspyDriverAddStream(Address driver,
                                             int id)

gcspyDriverEndOutput

public abstract void gcspyDriverEndOutput(Address driver)

gcspyDriverInit

public abstract void gcspyDriverInit(Address driver,
                                     int id,
                                     Address serverName,
                                     Address driverName,
                                     Address title,
                                     Address blockInfo,
                                     int tileNum,
                                     Address unused,
                                     int mainSpace)

gcspyDriverInitOutput

public abstract void gcspyDriverInitOutput(Address driver)

gcspyDriverResize

public abstract void gcspyDriverResize(Address driver,
                                       int size)

gcspyDriverSetTileNameRange

public abstract void gcspyDriverSetTileNameRange(Address driver,
                                                 int i,
                                                 Address start,
                                                 Address end)

gcspyDriverSetTileName

public abstract void gcspyDriverSetTileName(Address driver,
                                            int i,
                                            Address start,
                                            long value)

gcspyDriverSpaceInfo

public abstract void gcspyDriverSpaceInfo(Address driver,
                                          Address info)

gcspyDriverStartComm

public abstract void gcspyDriverStartComm(Address driver)

gcspyDriverStream

public abstract void gcspyDriverStream(Address driver,
                                       int id,
                                       int len)

gcspyDriverStreamByteValue

public abstract void gcspyDriverStreamByteValue(Address driver,
                                                byte value)

gcspyDriverStreamShortValue

public abstract void gcspyDriverStreamShortValue(Address driver,
                                                 short value)

gcspyDriverStreamIntValue

public abstract void gcspyDriverStreamIntValue(Address driver,
                                               int value)

gcspyDriverSummary

public abstract void gcspyDriverSummary(Address driver,
                                        int id,
                                        int len)

gcspyDriverSummaryValue

public abstract void gcspyDriverSummaryValue(Address driver,
                                             int value)

gcspyIntWriteControl

public abstract void gcspyIntWriteControl(Address driver,
                                          int id,
                                          int tileNum)

gcspyMainServerAddDriver

public abstract Address gcspyMainServerAddDriver(Address addr)

gcspyMainServerAddEvent

public abstract void gcspyMainServerAddEvent(Address server,
                                             int event,
                                             Address name)

gcspyMainServerInit

public abstract Address gcspyMainServerInit(int port,
                                            int len,
                                            Address name,
                                            int verbose)

gcspyMainServerIsConnected

public abstract int gcspyMainServerIsConnected(Address server,
                                               int event)

gcspyMainServerOuterLoop

public abstract Address gcspyMainServerOuterLoop()

gcspyMainServerSafepoint

public abstract void gcspyMainServerSafepoint(Address server,
                                              int event)

gcspyMainServerSetGeneralInfo

public abstract void gcspyMainServerSetGeneralInfo(Address server,
                                                   Address info)

gcspyMainServerStartCompensationTimer

public abstract void gcspyMainServerStartCompensationTimer(Address server)

gcspyMainServerStopCompensationTimer

public abstract void gcspyMainServerStopCompensationTimer(Address server)

gcspyStartserver

public abstract void gcspyStartserver(Address server,
                                      int wait,
                                      Address serverOuterLoop)

gcspyStreamInit

public abstract void gcspyStreamInit(Address stream,
                                     int id,
                                     int dataType,
                                     Address name,
                                     int minValue,
                                     int maxValue,
                                     int zeroValue,
                                     int defaultValue,
                                     Address pre,
                                     Address post,
                                     int presentation,
                                     int paintStyle,
                                     int maxStreamIndex,
                                     int red,
                                     int green,
                                     int blue)

gcspyFormatSize

public abstract void gcspyFormatSize(Address buffer,
                                     int size)

gcspySprintf

public abstract int gcspySprintf(Address str,
                                 Address format,
                                 Address value)