
Overview
D-2
D.1 Overview
The function of the HAL is to provide resources to the stack library functions
and allow them to operate independently of the current run–time environment.
The HAL contains the functionality required by the stack that depends directly
on the hardware in a particular environment.
D.1.1 HAL Function Types
The HAL is interspersed with two different types of functions; those that are
called from kernel layer (inside an llEnter() / llExit() pairing), and those that are
not. (For more information on the llEnter() and llExit() functions, see
section A.1.)
In order to distinguish kernel layer functions from application support func-
tions, both have been given a different naming conventions. Kernel layer func-
tions are named with an “ll” prefix, without a leading underscore, for example:
llPacketSend(), while application functions have an underscore, for example:
_llPacketInit().
D.1.2 External Calls from HAL Functions
Since HAL functions are called from the stack kernel, they are executing within
an llEnter() / llExit() pair. This means that these HAL functions can call the
stack API directly, but should not call normal application functions.
If a HAL function must call an external application function, or if it is going to
call a potentially blocking function, then it should first call llExit(). Then when
it has completed, it should call llEnter() before returning to the stack. It is im-
portant not to block while in an llEnter() / llExit() pair.