Tornado API Reference : Target Server Internal Routines

tgtarch

NAME

tgtarch - target architecture information library

ROUTINES

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

DESCRIPTION

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).

INCLUDE FILES

 tgtarch.h

SEE ALSO

tgtarch, architecturedb (4), API Programmer's Guide: Object Module Loader

FILES

$(WIND_BASE)/resource/target/architecturedb


Target Server Internal Routines : Routines

targetArchitectureInit( )

NAME

targetArchitectureInit( ) - Set the target architecture related infomations.

SYNOPSIS

STATUS targetArchitectureInit
    (
    WTX_TGT_INFO * pWtxTgtInfo
    )

DESCRIPTION

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).

RETURNS

OK or ERROR if initialization fails. Failure conditions are :

 - Resource database not accessible;
 - Required parameter not found, or set with incorrect value.

FILES

$(WIND_BASE)/resource/target/architecturedb

SEE ALSO

tgtarch


Target Server Internal Routines : Routines

tgtCpuTypeGet( )

NAME

tgtCpuTypeGet( ) - Returns the target CPU type

SYNOPSIS


int tgtCpuTypeGet (void)

DESCRIPTION

This routine returns the type of the CPU of the currently attached target.

RETURNS

The CPU type (integer).

SEE ALSO

tgtarch


Target Server Internal Routines : Routines

tgtCpuNameGet( )

NAME

tgtCpuNameGet( ) - Returns the target CPU name.

SYNOPSIS


char * tgtCpuNameGet (void)

DESCRIPTION

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.

RETURNS

The CPU name (pointer to a static string).

FILES

$(WIND_BASE)/resource/target/architecturedb

SEE ALSO

tgtarch


Target Server Internal Routines : Routines

tgtSwapNeeded( )

NAME

tgtSwapNeeded( ) - Returns TRUE if host and target byte order differs.

SYNOPSIS


int tgtSwapNeeded (void)

DESCRIPTION

This routine tells if the target endianness differs from the host's one.

RETURNS

TRUE or FALSE whether the target endianess differs from host or not.

SEE ALSO

tgtarch


Target Server Internal Routines : Routines

tgtCpuFamilyGet( )

NAME

tgtCpuFamilyGet( ) - Returns the target CPU family type.

SYNOPSIS


int tgtCpuFamilyGet (void)

DESCRIPTION

This routine returns the currently attached target CPU family type. The value returned is extracted from the cpuFamily parameter in the target resource file.

RETURNS

The CPU family type (integer).

FILES

$(WIND_BASE)/resource/target/architecturedb

SEE ALSO

tgtarch


Target Server Internal Routines : Routines

tgtCpuFamilyNameGet( )

NAME

tgtCpuFamilyNameGet( ) - Returns the target CPU family name.

SYNOPSIS


char * tgtCpuFamilyNameGet (void)

DESCRIPTION

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.

RETURNS

The CPU family name (pointer to a static string).

FILES

$(WIND_BASE)/resource/target/architecturedb

SEE ALSO

tgtarch


Target Server Internal Routines : Routines

tgtCpuAlignmentGet( )

NAME

tgtCpuAlignmentGet( ) - Returns the target CPU memory aligment.

SYNOPSIS


int tgtCpuAlignmentGet (void)

DESCRIPTION

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.

RETURNS

The target memory aligment (integer).

FILES

$(WIND_BASE)/resource/target/architecturedb

SEE ALSO

tgtarch


Target Server Internal Routines : Routines

tgtLoaderOmfTypeGet( )

NAME

tgtLoaderOmfTypeGet( ) - Returns the loader Object Module Format currently used.

SYNOPSIS


char * tgtLoaderOmfTypeGet (void)

DESCRIPTION

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.

RETURNS

The Object Module Format used (pointer to a static string).

FILES

$(WIND_BASE)/resource/target/architecturedb

SEE ALSO

tgtarch


Target Server Internal Routines : Routines

tgtLoaderNameGet( )

NAME

tgtLoaderNameGet( ) - Returns the loader DLL name currently used.

SYNOPSIS


char * tgtLoaderNameGet (void)

DESCRIPTION

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.

RETURNS

The Object Module Format reader DLL name used (pointer to a static string).

SEE ALSO

tgtarch, API Programmer's Guide: Object Module Loader


Target Server Internal Routines : Routines

tgtLoaderInitRtnNameGet( )

NAME

tgtLoaderInitRtnNameGet( ) - Returns the loader initialization routine name.

SYNOPSIS


char * tgtLoaderInitRtnNameGet (void)

DESCRIPTION

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.

RETURNS

The Object Module Format reader DLL initialization routine name (pointer to a static string).

SEE ALSO

tgtarch, API Programmer's Guide: Object Module Loader

FILES

$(WIND_BASE)/resource/target/architecturedb


Target Server Internal Routines : Routines

tgtLoaderCheckRtnNameGet( )

NAME

tgtLoaderCheckRtnNameGet( ) - Returns the loader module verifier name.

SYNOPSIS


char * tgtLoaderCheckRtnNameGet (void)

DESCRIPTION

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.

RETURNS

The Object Module Format reader DLL module verifier routine name (pointer to a static string).

SEE ALSO

tgtarch, API Programmer's Guide: Object Module Loader

FILES

$(WIND_BASE)/resource/target/architecturedb


Target Server Internal Routines : Routines

tgtLoaderManageRtnNameGet( )

NAME

tgtLoaderManageRtnNameGet( ) - Returns the loader module manager routine name.

SYNOPSIS


char * tgtLoaderManageRtnNameGet (void)

DESCRIPTION

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.

RETURNS

The Object Module Format reader DLL module handling routine name (pointer to a static string).

SEE ALSO

tgtarch, API Programmer's Guide: Object Module Loader

FILES

$(WIND_BASE)/resource/target/architecturedb


Target Server Internal Routines : Routines

tgtRelocatorNameGet( )

NAME

tgtRelocatorNameGet( ) - Returns the relocator DLL name currently used.

SYNOPSIS


char * tgtRelocatorNameGet (void)

DESCRIPTION

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.

RETURNS

The Object Module Format relocator for the current target DLL name (pointer to a static string).

SEE ALSO

tgtarch, API Programmer's Guide: Object Module Loader

FILES

$(WIND_BASE)/resource/target/architecturedb


Target Server Internal Routines : Routines

tgtSegRelocatorRtnNameGet( )

NAME

tgtSegRelocatorRtnNameGet( ) - Returns the segment relocator routine name.

SYNOPSIS


char * tgtSegRelocatorRtnNameGet (void)

DESCRIPTION

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.

RETURNS

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.

SEE ALSO

tgtarch, API Programmer's Guide: Object Module Loader

FILES

$(WIND_BASE)/resource/target/architecturedb


Target Server Internal Routines : Routines

tgtModuleVerifyRtnNameGet( )

NAME

tgtModuleVerifyRtnNameGet( ) - Returns the module verifier routine name.

SYNOPSIS


char * tgtModuleVerifyRtnNameGet (void)

DESCRIPTION

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.

RETURNS

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.

SEE ALSO

tgtarch, API Programmer's Guide: Object Module Loader

FILES

$(WIND_BASE)/resource/target/architecturedb


Target Server Internal Routines : Routines

tgtRelocInitRtnNameGet( )

NAME

tgtRelocInitRtnNameGet( ) - Returns the relocator library initialization

SYNOPSIS


char * tgtRelocInitRtnNameGet (void)

DESCRIPTION

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.

RETURNS

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.

SEE ALSO

tgtarch, API Programmer's Guide: Object Module Loader

FILES

$(WIND_BASE)/resource/target/architecturedb