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

Note<br />

In C++, if a virtual function qualified with the __softfp keyword is to be overridden, the<br />

overriding function must also be declared as __softfp. If the functions do not match, the<br />

compiler generates an error.<br />

See also<br />

• --fpu=name on page 2-42<br />

• #pragma [no_]softfp_linkage on page 4-59<br />

• Floating-point linkage on page 4-33 in the <strong>Compiler</strong> User <strong>Guide</strong>.<br />

4.1.15 __svc<br />

The __svc keyword declares a SuperVisor Call (SVC) function taking up to four<br />

integer-like arguments and returning up to four results in a value_in_regs structure.<br />

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

Syntax<br />

__svc(int svc_num) return-type function-name([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 />

• 0-255 (an 8-bit value) in a 16-bit Thumb instruction.<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 />

4-16 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!