29.01.2015 Views

Embedded Software for SoC - Grupo de Mecatrônica EESC/USP

Embedded Software for SoC - Grupo de Mecatrônica EESC/USP

Embedded Software for SoC - Grupo de Mecatrônica EESC/USP

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Introduction to Hardware Abstraction Layers <strong>for</strong> SOC 181<br />

Figure 14-3 shows an example of HAL API function <strong>for</strong> context switch,<br />

_cxt_switch(cxt_type oldcxt, cxt_type newcxt). The function can be used <strong>for</strong><br />

context switch on any processors. For a specific processor, we need to implement<br />

the body of the function. Figure 14-3 shows also the real co<strong>de</strong> of the<br />

HAL API function <strong>for</strong> ARM7 processor.<br />

Since the HAL API gives an abstraction of un<strong>de</strong>rlying HW architecture,<br />

when the OS or application SW is <strong>de</strong>signed using the HAL API, the SW co<strong>de</strong><br />

is portable as far as the HAL API can be implemented on the un<strong>de</strong>rlying HW<br />

architecture. Thus, conventionally, the HAL has been used to ease OS porting<br />

on new HW architectures.<br />

3. RELATED WORK<br />

There are similar concepts to HAL: nano-kernel and <strong>de</strong>vice driver. Nanokernel<br />

is usually <strong>de</strong>fined to be an ensemble of interrupt service routines and<br />

task stacks [4]. It serves as a foundation where a micro-kernel can be built.<br />

In this <strong>de</strong>finition, nano-kernel can be consi<strong>de</strong>red to be a part of HAL since it

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!