04.01.2015 Views

RealView Compilation Tools - ARM Information Center

RealView Compilation Tools - ARM Information Center

RealView Compilation Tools - ARM Information Center

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.

Compiler-specific Features<br />

Usage<br />

This causes function invocations to be compiled inline as an AAPCS-compliant<br />

operation that behaves similarly to a normal call to a function.<br />

The __value_in_regs qualifier can be used to specify that a small structure of up to 16<br />

bytes is returned in registers, rather than by the usual structure-passing mechanism<br />

defined in the AAPCS.<br />

Example<br />

__svc(42) void terminate_1(int procnum); // terminate_1 returns no results<br />

__svc(42) int terminate_2(int procnum); // terminate_2 returns one result<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-30<br />

• __value_in_regs on page 4-20<br />

• SVC on page 4-133 in the Assembler Guide.<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 />

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

ID101213<br />

Non-Confidential,

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

Saved successfully!

Ooh no, something went wrong!