| M O D _ C O D E R E L O C ( )
| | | | | SOURCE: qdev_autodocs.txt 1.163 (12/09/2014) English
AMIGA - MOD_#?
----------------------------------------------------------------------------
NAME
mod_codereloc() - Puts the code and data segments in
reset-proof memory and relocates
them.
SYNOPSIS
ml = mod_codereloc(fd, flags, start, end);
struct MemList *mod_codereloc(
LONG, ULONG, ULONG, ULONG);
FUNCTION
This func. relocates the code in given type of memory
and then returns volatile MemList so that its entries
can be connected to the module header.
INPUTS
fd - Standard FileHandle as returned by 'Open()',
which allows to load standard HUNK files.
flags - Std. mem flags. Usually you will want to use
MEMF_LOCAL or MEMF_CHIP.
start - Start of memory node/region. See the macros
that define regions.
end - End of memory node/region. This can even be
set to upper bound of Amiga addressation.
RETURNS
Returns an address to MemList which references whole
seglist, splited across MemEntries or NULL if loading
failed or there is not enough memory.
BASES
SysBase, DOSBase
NOTES
In the 'ml->ml_Node.ln_Name' var. you will find the
seglist. Please do not free it with 'UnLoadSeg()' and
do not specify 'NP_FreeSeglist, TRUE' tag while making
new process or else Guru will knock yer out! To free
the segments use 'mod_codefree()'.
If you intend to load the libraries, devices or some
resources with this routine then use 'mod_codefind()'
and pass '&ml->ml_ME[0]' to locate the ROMTAG. Dont
forget to check if 'ml->ml_NumEntries > 1', and if so
then such lib. may contain some globals or bss which
may be problematic!
Warning! Returned MemList is volatile which means you
cannot use it directly in your module, you must copy
each MemEntry descriptor!
You can use this function with virtual files as well!
SEE ALSO
mod_codefree(), mod_codefind(),
mem_allocmemregion(), mem_freememregion()
EXAMPLE
None.
BUGS
None known.
----------------------------------------------------------------------------
| |
| |