Tornado API Reference : Target Server Internal Routines
tgtarch - target architecture information library
targetArchitectureInit( ) - Set the target architecture related infomations.
tgtCpuTypeGet( ) - Returns the target CPU type
tgtCpuNameGet( ) - Returns the target CPU name.
tgtSwapNeeded( ) - Returns TRUE if host and target byte order differs.
tgtCpuFamilyGet( ) - Returns the target CPU family type.
tgtCpuFamilyNameGet( ) - Returns the target CPU family name.
tgtCpuAlignmentGet( ) - Returns the target CPU memory aligment.
tgtLoaderOmfTypeGet( ) - Returns the loader Object Module Format currently used.
tgtLoaderNameGet( ) - Returns the loader DLL name currently used.
tgtLoaderInitRtnNameGet( ) - Returns the loader initialization routine name.
tgtLoaderCheckRtnNameGet( ) - Returns the loader module verifier name.
tgtLoaderManageRtnNameGet( ) - Returns the loader module manager routine name.
tgtRelocatorNameGet( ) - Returns the relocator DLL name currently used.
tgtSegRelocatorRtnNameGet( ) - Returns the segment relocator routine name.
tgtModuleVerifyRtnNameGet( ) - Returns the module verifier routine name.
tgtRelocInitRtnNameGet( ) - Returns the relocator library initialization
This library contains functions used by the target server modules to get target architecture informations. Those information are stored in a resource file : $(WIND_BASE)/resource/target/architecturedb which describes all informations related to a CPU/CPU family. Those informations are :
- cpuname
- represents the CPU name (string)
- cpuFamily
- represents the CPU family (integer)
- cpuFamilyName
- represents the CPU family name (string).
- Memory alignment
- represents the memory alignment for this CPU.
- Object File Type
- represents the Object Module Formats supported for this CPU.
- Leading Character
- is the leading char for the symbols.
- Thumbing
- tells if thumbing mode is enabled (used for ARM processors).
tgtarch.h
tgtarch, architecturedb (4), API Programmer's Guide: Object Module Loader
$(WIND_BASE)/resource/target/architecturedb
targetArchitectureInit( ) - Set the target architecture related infomations.
STATUS targetArchitectureInit ( WTX_TGT_INFO * pWtxTgtInfo )
This routine parses the architecturedb file to get all the parameters : It goes to the section [CPU_<CPU_Id>] where <CPU_Id> is extracted from the given WTX_TGT_INFO parameter. Takes the cpuname and cpuFamilyName parameters.
Then it goes to the section [<cpuFamilyName>] to get all the remaining informations : cpuFamily, Object File Type, Memory alignment, Leading Character.
The other parameters are used to build CPU specific DLL names (see tgtLoaderxxxGet, tgtRelocatorxxGet, tgtDisassemblerxxxGet routines).
OK or ERROR if initialization fails. Failure conditions are :
- Resource database not accessible;
- Required parameter not found, or set with incorrect value.
$(WIND_BASE)/resource/target/architecturedb
tgtCpuTypeGet( ) - Returns the target CPU type
int tgtCpuTypeGet (void)
This routine returns the type of the CPU of the currently attached target.
The CPU type (integer).
tgtCpuNameGet( ) - Returns the target CPU name.
char * tgtCpuNameGet (void)
This routine returns the ASCII name of the CPU on the currently attached target. The value returned is extracted from the cpuname parameter in the target resource file.
The CPU name (pointer to a static string).
$(WIND_BASE)/resource/target/architecturedb
tgtSwapNeeded( ) - Returns TRUE if host and target byte order differs.
int tgtSwapNeeded (void)
This routine tells if the target endianness differs from the host's one.
TRUE or FALSE whether the target endianess differs from host or not.
tgtCpuFamilyGet( ) - Returns the target CPU family type.
int tgtCpuFamilyGet (void)
This routine returns the currently attached target CPU family type. The value returned is extracted from the cpuFamily parameter in the target resource file.
The CPU family type (integer).
$(WIND_BASE)/resource/target/architecturedb
tgtCpuFamilyNameGet( ) - Returns the target CPU family name.
char * tgtCpuFamilyNameGet (void)
This routine returns the ASCII name of the CPU family on the currently attached target. This value is extracted from the cpuFamilyName parameter in the target resource file.
The CPU family name (pointer to a static string).
$(WIND_BASE)/resource/target/architecturedb
tgtCpuAlignmentGet( ) - Returns the target CPU memory aligment.
int tgtCpuAlignmentGet (void)
This routine returns the memory alignment for the attached target. The value returned is extracted from the Memory alignment parameter in the target resource file.
The target memory aligment (integer).
$(WIND_BASE)/resource/target/architecturedb
tgtLoaderOmfTypeGet( ) - Returns the loader Object Module Format currently used.
char * tgtLoaderOmfTypeGet (void)
This routine returns the ASCII name of the Object Module Format currently used. This value is extracted from the Object File Type parameter in the target resource file.
The Object Module Format used (pointer to a static string).
$(WIND_BASE)/resource/target/architecturedb
tgtLoaderNameGet( ) - Returns the loader DLL name currently used.
char * tgtLoaderNameGet (void)
This routine returns the reader name of the Object File Type currently used. This value is built from the Object Module Format currently used. It has the following structure : load<Omfname>, where <Omfname> represents the Object Module Format currently used for this target. The first character for the Object Module Format is uppercase, and the others lowercase. For instance, the a.out loader name will be loadAout.
The Object Module Format reader DLL name used (pointer to a static string).
tgtarch, API Programmer's Guide: Object Module Loader
tgtLoaderInitRtnNameGet( ) - Returns the loader initialization routine name.
char * tgtLoaderInitRtnNameGet (void)
This routine returns the Object Module Format reader initialization routine name. This value is built from the Object File Type currently used. It has the following structure : load<Omfname>Init, where <Omfname> represents the Object Module Format currently used for this target. The first character for the Object Module Format is uppercase, and the others lowercase. For instance, the a.out loader initialization routine name will be loadAoutInit.
The Object Module Format reader DLL initialization routine name (pointer to a static string).
tgtarch, API Programmer's Guide: Object Module Loader
$(WIND_BASE)/resource/target/architecturedb
tgtLoaderCheckRtnNameGet( ) - Returns the loader module verifier name.
char * tgtLoaderCheckRtnNameGet (void)
This routine returns the Object Module Format reader module verifier routine name. This value is built from the Object File Type currently used. It has the following structure : load<Omfname>FmtCheck, where <Omfname> represents the Object Module Format currently used for this target. The first character for the Object Module Format is uppercase, and the others lowercase. For instance, the a.out loader module verifier routine name will be loadAoutFmtCheck.
The Object Module Format reader DLL module verifier routine name (pointer to a static string).
tgtarch, API Programmer's Guide: Object Module Loader
$(WIND_BASE)/resource/target/architecturedb
tgtLoaderManageRtnNameGet( ) - Returns the loader module manager routine name.
char * tgtLoaderManageRtnNameGet (void)
This routine returns the Object Module Format reader module handling routine name of the Object Module Format currently used. This value is built from the Object Module Format currently used. It has the following structure : load<Omfname>FmtManage, where <Omfname> represents the Object Module Format currently used for this target. The first character for the Object Module Format is uppercase, and the others lowercase. For instance, the a.out loader module manager routine name will be loadAoutFmtManage.
The Object Module Format reader DLL module handling routine name (pointer to a static string).
tgtarch, API Programmer's Guide: Object Module Loader
$(WIND_BASE)/resource/target/architecturedb
tgtRelocatorNameGet( ) - Returns the relocator DLL name currently used.
char * tgtRelocatorNameGet (void)
This routine returns the Object Module Format relocator DLL name for the currently used target. This value is built from the Object Module Format currently used plus the CPU extention name. It has the following structure : <Omfname><ExtentionName>, where <Omfname> represents the Object File Type currently used for this target. All the character for the Object File Type are lowercase. <ExtentionName> represents the parameter found in the architecturedb file. For instance, the a.out loader for MC68XX0 Family will be : aout68k. 68k is taken from the ExtentionName in the MC680X0 section.
This routine is used by the Object Module Format reader to dynamically load the proper CPU relocator.
The Object Module Format relocator for the current target DLL name (pointer to a static string).
tgtarch, API Programmer's Guide: Object Module Loader
$(WIND_BASE)/resource/target/architecturedb
tgtSegRelocatorRtnNameGet( ) - Returns the segment relocator routine name.
char * tgtSegRelocatorRtnNameGet (void)
This routine returns the name of the segment relocator routine that the relocator should export. It has the following structure : <Omfname><ExtentionName>SegReloc, where <Omfname> represents the Object File Type currently used for this target. All the character for the Object File Type are lowercase. <ExtentionName> represents the parameter found in the architecturedb file. For instance, the a.out loader for MC68XX0 Family segment relocator routine name will be : aout68kSegReloc. 68k is taken from the ExtentionName in the MC680X0 section.
The segment relocator routine name (pointer to a static string).
This routine is used by the Object Module Format reader to dynamically load the proper CPU relocator.
tgtarch, API Programmer's Guide: Object Module Loader
$(WIND_BASE)/resource/target/architecturedb
tgtModuleVerifyRtnNameGet( ) - Returns the module verifier routine name.
char * tgtModuleVerifyRtnNameGet (void)
This routine returns the name of the module verifier routine that the relocator should export. It has the following structure : <Omfname><ExtentionName>ModuleVerify, where <Omfname> represents the Object Module Format currently used for this target. All the character for the Object Module Format are lowercase. <ExtentionName> represents the parameter found in the architecturedb file. For instance, the a.out loader for MC68XX0 Family module verifier routine name will be : aout68kModuleVerify. 68k is taken from the ExtentionName in the MC680X0 section.
The module verifier routine name (pointer to a static string).
This routine is used by the Object Module Format reader to dynamically load the proper CPU relocator.
tgtarch, API Programmer's Guide: Object Module Loader
$(WIND_BASE)/resource/target/architecturedb
tgtRelocInitRtnNameGet( ) - Returns the relocator library initialization
char * tgtRelocInitRtnNameGet (void)
routine name.
This routine returns the name of the initialization routine that the relocator can export. It has the following structure : <Omfname><ExtentionName>RelocInit, where <Omfname> represents the Object File Type currently used for this target. All the character for the Object File Type are lowercase. <ExtentionName> represents the parameter found in the architecturedb file. For instance, the a.out loader for MC68XX0 Family module verifier routine name will be : aout68kRelocInit. 68k is taken from the ExtentionName in the MC680X0 section.
The relocator library initialization routine name (pointer to a static string).
This routine is used by the Object Module Format reader to dynamically load the proper CPU relocator. If the relocator exports this routine it will be run after the Object Module Format reader has loaded the relocator.
tgtarch, API Programmer's Guide: Object Module Loader
$(WIND_BASE)/resource/target/architecturedb