Cryptography Reference
In-Depth Information
Function:
output a pointer to a register
clint * get_reg_l (unsigned int reg);
Syntax:
reg
(register number)
Input:
pointer to the desired register
reg
,ifitisallocated
NULL
if the register is unallocated
Return:
clint *
get_reg_l (unsigned int reg)
{
if (!registers.created || (reg >= registers.noofregs))
{
return (clint *) NULL;
}
return registers.reg_l[reg];
}
Since the set of registers can be changed dynamically with respect to its size
and location in memory, it is not recommended that addresses of registers once
read be stored for further use. It is much to be preferred that one obtain the
register addresses afresh for each use. In the file
flint.h
are to be found several
predefined macros of the form
#define r0_l get_reg_l(0);
with the help of which the registers can be invoked, without additional syntactic
effort, by their actual current addresses. With the function
purge_reg_l()
,
introduced below, an individual register of the set can be cleared by overwriting it.
Clear a
CLINT
register of the register bank by completely
overwriting it with zeros
Function:
int purge_reg_l (unsigned int reg);
Syntax:
reg
(register number)
Input:
E_CLINT_OK
if deletion is ok
E_CLINT_NOR
if register is unallocated
Return: