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 />

typedef struct res_type<br />

{<br />

int res_1;<br />

int res_2;<br />

int res_3;<br />

int res_4;<br />

} res_type;<br />

__svc(42) __value_in_regs res_type terminate_3(int procnum);<br />

// terminate_3 returns more than<br />

// one result<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.16 __svc_indirect<br />

The __svc_indirect keyword passes an operation code to the SVC handler in r12.<br />

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

Syntax<br />

__svc_indirect(int svc_num)<br />

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

Where:<br />

svc_num<br />

real_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 />

• 0-255 (an 8-bit value) in a 16-bit Thumb instruction.<br />

Is the value passed in r12 to the handler to determine the function<br />

to perform.<br />

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

Non-Confidential

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

Saved successfully!

Ooh no, something went wrong!