29.12.2014 Views

RealView Compilation Tools Compiler Reference Guide - ARM ...

RealView Compilation Tools Compiler Reference Guide - ARM ...

RealView Compilation Tools Compiler Reference Guide - ARM ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Compiler</strong>-specific Features<br />

To use the indirect mechanism, your system handlers must make use of the r12 value to<br />

select the required operation.<br />

Usage<br />

You can use this feature to implement indirect SVCs.<br />

Example<br />

int __svc_indirect(0) ioctl(int svcino, int fn, void *argp);<br />

Calling:<br />

ioctl(IOCTL+4, RESET, NULL);<br />

compiles to SVC #0 with IOCTL+4 in r12.<br />

Errors<br />

When an <strong>ARM</strong> architecture variant or <strong>ARM</strong> architecture-based processor that does not<br />

support an SVC instruction is specified on the command line using the --cpu option, the<br />

compiler generates an error.<br />

See also<br />

• --cpu=name on page 2-15<br />

• __value_in_regs on page 4-19<br />

• SVC on page 4-130 in the Assembler <strong>Guide</strong>.<br />

4.1.17 __svc_indirect_r7<br />

The __svc_indirect keyword behaves like __svc_indirect, but uses r7 instead of r12.<br />

__svcindirect_r7 is a function qualifier. It affects the type of a function.<br />

Syntax<br />

__svc_indirect_r7(int svc_num)<br />

return-type function-name(int real_num[, argument-list]);<br />

Where:<br />

svc_num<br />

Is the immediate value used in the SVC instruction.<br />

It is an expression evaluating to an integer in the range:<br />

• 0 to 2 24 –1 (a 24-bit value) in an <strong>ARM</strong> instruction<br />

4-18 Copyright © 2007, 2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0348A<br />

Non-Confidential

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

Saved successfully!

Ooh no, something went wrong!