12.07.2015 Views

RealView 编译工具编译器参考指南 - ARM Information Center

RealView 编译工具编译器参考指南 - ARM Information Center

RealView 编译工具编译器参考指南 - ARM Information Center

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

编 译 器 特 有 的 功 能其 中 :svc_num 是 在 SVC 指 令 中 使 用 的 立 即 值 。它 是 一 个 表 达 式 , 其 计 算 结 果 为 以 下 范 围 内 的 整 数 :• 在 <strong>ARM</strong> 指 令 中 为 0 到 2 24 –1 (24 位 值 )• 在 16 位 Thumb 指 令 中 为 0-255 (8 位 值 )。real_num 是 在 r7 中 传 递 给 处 理 程 序 的 值 , 用 于 确 定 要 执 行 的 函 数 。用 法<strong>ARM</strong> Linux 上 的 Thumb 应 用 程 序 使 用 __svc_indirect_r7 进 行 内 核 系 统 调 用 。也 可 以 使 用 此 功 能 实 现 间 接 SVC。示 例long __svc_indirect_r7(0) \SVC_write(unsigned, int fd, const char * buf, size_t count);#define write(fd, buf, count) SVC_write(4, (fd), (buf), (count))调 用 :write(fd, buf, count);可 编 译 为 SVC #0, r0 = fd、 r1 = buf、 r2 = count 以 及 r7 = 4。错 误在 命 令 行 中 使 用 --cpu 选 项 指 定 不 支 持 SVC 指 令 的 <strong>ARM</strong> 体 系 结 构 版 本 或 基 于<strong>ARM</strong> 体 系 结 构 的 处 理 器 时 , 编 译 器 将 生 成 错 误 。另 请 参 阅• 第 4-19 页 的 __value_in_regs• 第 2-30 页 的 --cpu=name• 《 汇 编 器 指 南 》 中 第 4-129 页 的 SVC。<strong>ARM</strong> DUI 0348BC Copyright © 2007-2009 <strong>ARM</strong> Limited. All rights reserved. 4-19ID090708Non-Confidential, Unrestricted Access

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

Saved successfully!

Ooh no, something went wrong!