Class AbstractEmuLinuxSyscallUseropLibrary<T>
java.lang.Object
ghidra.pcode.exec.AnnotatedPcodeUseropLibrary<T>
ghidra.pcode.emu.sys.AnnotatedEmuSyscallUseropLibrary<T>
ghidra.pcode.emu.unix.AbstractEmuUnixSyscallUseropLibrary<T>
ghidra.pcode.emu.linux.AbstractEmuLinuxSyscallUseropLibrary<T>
- Type Parameters:
T- the type of values processed by the library
- All Implemented Interfaces:
EmuSyscallLibrary<T>, PcodeUseropLibrary<T>
- Direct Known Subclasses:
EmuLinuxAmd64SyscallUseropLibrary, EmuLinuxX86SyscallUseropLibrary
public abstract class AbstractEmuLinuxSyscallUseropLibrary<T>
extends AbstractEmuUnixSyscallUseropLibrary<T>
An abstract library of Linux system calls, suitable for use with any processor
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractEmuUnixSyscallUseropLibrary
AbstractEmuUnixSyscallUseropLibrary.Errno, AbstractEmuUnixSyscallUseropLibrary.UnixStructuredPartNested classes/interfaces inherited from class AnnotatedEmuSyscallUseropLibrary
AnnotatedEmuSyscallUseropLibrary.EmuSyscall, AnnotatedEmuSyscallUseropLibrary.StructuredPartNested classes/interfaces inherited from class AnnotatedPcodeUseropLibrary
AnnotatedPcodeUseropLibrary.AnnotatedPcodeUseropDefinition<T>, AnnotatedPcodeUseropLibrary.FixedArgsAnnotatedPcodeUseropDefinition<T>, AnnotatedPcodeUseropLibrary.OpExecutor, AnnotatedPcodeUseropLibrary.OpLibrary, AnnotatedPcodeUseropLibrary.OpOutput, AnnotatedPcodeUseropLibrary.OpState, AnnotatedPcodeUseropLibrary.PcodeUserop, AnnotatedPcodeUseropLibrary.VariadicAnnotatedPcodeUseropDefinition<T>Nested classes/interfaces inherited from interface EmuSyscallLibrary
EmuSyscallLibrary.EmuSyscallDefinition<T>, EmuSyscallLibrary.SyscallPcodeUseropDefinition<T>Nested classes/interfaces inherited from interface PcodeUseropLibrary
PcodeUseropLibrary.EmptyPcodeUseropLibrary, PcodeUseropLibrary.PcodeUseropDefinition<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Map<AbstractEmuUnixSyscallUseropLibrary.Errno, Integer> TODO: A map from simulator-defined errno to Linux-defined errnostatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intFields inherited from class AbstractEmuUnixSyscallUseropLibrary
closedFds, descriptors, fs, intSize, userFields inherited from class AnnotatedEmuSyscallUseropLibrary
additionalArchives, CACHE_BY_CLASS, cSpec, dtMachineWord, machine, program, SYSCALL_SPACE_NAME, syscallMapFields inherited from class AnnotatedPcodeUseropLibrary
opsFields inherited from interface EmuSyscallLibrary
SYSCALL_CONVENTION_NAMEFields inherited from interface PcodeUseropLibrary
NIL -
Constructor Summary
ConstructorsConstructorDescriptionAbstractEmuLinuxSyscallUseropLibrary(PcodeMachine<T> machine, EmuUnixFileSystem<T> fs, Program program) Construct a new libraryAbstractEmuLinuxSyscallUseropLibrary(PcodeMachine<T> machine, EmuUnixFileSystem<T> fs, Program program, EmuUnixUser user) Construct a new library -
Method Summary
Modifier and TypeMethodDescriptionprotected Set<EmuUnixFileSystem.OpenFlag> convertFlags(int flags) Convert the flags as defined for this platform to flags understood by the simulatorprotected intGet the platform-specific errno value for the given simulator-defined errnoMethods inherited from class AbstractEmuUnixSyscallUseropLibrary
claimFd, createHandle, findFd, handleError, lowestFd, newStructuredPart, putDescriptor, releaseFd, returnErrno, unix_close, unix_exit, unix_group_exit, unix_open, unix_read, unix_writeMethods inherited from class AnnotatedEmuSyscallUseropLibrary
disposeAdditionalArchives, getAdditionalArchives, getSyscalls, getSyscallUserop, mapAndBindSyscalls, mapAndBindSyscalls, newBoundSyscallMethods inherited from class AnnotatedPcodeUseropLibrary
getMethodLookup, getOperandType, getUseropsMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface EmuSyscallLibrary
readSyscallNumber, syscallMethods inherited from interface PcodeUseropLibrary
compose, getSymbols, getUserops
-
Field Details
-
O_MASK_RDWR
public static final int O_MASK_RDWR- See Also:
-
O_RDONLY
public static final int O_RDONLY- See Also:
-
O_WRONLY
public static final int O_WRONLY- See Also:
-
O_RDWR
public static final int O_RDWR- See Also:
-
O_CREAT
public static final int O_CREAT- See Also:
-
O_TRUNC
public static final int O_TRUNC- See Also:
-
O_APPEND
public static final int O_APPEND- See Also:
-
ERRNOS
TODO: A map from simulator-defined errno to Linux-defined errnoTODO: These may be applicable to all Linux, not just amd64....
-
-
Constructor Details
-
AbstractEmuLinuxSyscallUseropLibrary
public AbstractEmuLinuxSyscallUseropLibrary(PcodeMachine<T> machine, EmuUnixFileSystem<T> fs, Program program) Construct a new library- Parameters:
machine- the machine emulating the hardwarefs- the file system to export to the user-space programprogram- a program containing the syscall definitions and conventions, likely the target program
-
AbstractEmuLinuxSyscallUseropLibrary
public AbstractEmuLinuxSyscallUseropLibrary(PcodeMachine<T> machine, EmuUnixFileSystem<T> fs, Program program, EmuUnixUser user) Construct a new library- Parameters:
machine- the machine emulating the hardwarefs- the file system to export to the user-space programprogram- a program containing the syscall definitions and conventions, likely the target programuser- the "current user" to simulate
-
-
Method Details
-
convertFlags
Description copied from class:AbstractEmuUnixSyscallUseropLibraryConvert the flags as defined for this platform to flags understood by the simulator- Specified by:
convertFlagsin classAbstractEmuUnixSyscallUseropLibrary<T>- Parameters:
flags- the platform-defined flags- Returns:
- the simulator-defined flags
-
getErrno
Description copied from class:AbstractEmuUnixSyscallUseropLibraryGet the platform-specific errno value for the given simulator-defined errno- Specified by:
getErrnoin classAbstractEmuUnixSyscallUseropLibrary<T>- Parameters:
err- the simulator-defined errno- Returns:
- the platform-defined errno
-