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

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

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

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

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

real_num<br />

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

perform.<br />

Usage<br />

Thumb applications on <strong>ARM</strong> Linux use __svc_indirect_r7 to make kernel syscalls.<br />

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

Example<br />

long __svc_indirect_r7(0) \<br />

SVC_write(unsigned, int fd, const char * buf, size_t count);<br />

#define write(fd, buf, count) SVC_write(4, (fd), (buf), (count))<br />

Calling:<br />

write(fd, buf, count);<br />

compiles to SVC #0 with r0 = fd, r1 = buf, r2 = count, and r7 = 4.<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 />

• __value_in_regs<br />

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

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

4.1.18 __value_in_regs<br />

The __value_in_regs qualifier instructs the compiler to return a structure of up to four<br />

integer words in integer registers or up to four floats or doubles in floating-point<br />

registers rather than using memory.<br />

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

Syntax<br />

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

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

Non-Confidential

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

Saved successfully!

Ooh no, something went wrong!