- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想知道在基于 ARM 的微 Controller 上编写 SVC 调用的正确方法。
到目前为止,我的理解是 ARM 有一个异常向量表,这意味着任何程序中的第一条指令都必须分支到适当的处理程序:
RESET ;Handles reset
UNDEFINED ;Undefined instructions
SVC BL SVC_Entry
PRE_ABORT ;Prefetch abort
DAT_ABORT ;Data abort
然后,每次运行 SVC 指令时,模式都会切换到管理程序,SVC 提供的编号存储在 R0 中,程序将分支到适当的处理程序:
;== Handling SVC calls ========================================================
Max_SVC EQU 1
SVC_Entry CMP R0, #Max_SVC ;Check upper limit
BHI SVC_end ;Does nothing if unknown
ADD R0, PC, R0, LSL #2 ;Calculate table address
LDR PC, [R0, #0]
Jump_table DEFW SVC_0 ;Halt
DEFW SVC_1 ;Print string
;== SVC calls ================================================================
SVC_1 B SVC_end
SVC_end MOVS PC, LR ;Exiting
所以,如果我们有这些说明:
ADR R1, string ;R1 points to the string
SVC 1 ;SVC_1 handles the printing
程序必须切换到管理员模式,将数字“1”存储在 R0 中,然后按照跳转表分支到 SVC_1,运行代码并切换回用户模式。
这是正确的吗?我这样做对吗?
到目前为止,我遇到的问题是我的编译器对此行显示“需要运算符”:
SVC BL SVC_Entry
在互联网上很难找到有关此主题的信息,我只是想知道如何在 ARM 微 Controller 上正确使用 SVC 调用。
非常感谢。
编辑:底层处理器是 ARM9,主频约为 240 MHz。这住在AT91 微 Controller 。它所在的实验室委员会已经过修改,以满足我大学的需求。
使用定制程序通过串口将代码加载到板上。该程序还允许调试。
最佳答案
如前所述,不要使用 BL 跳转到 SVC 条目,而使用 B。首先有一个例程来确定 SVC 编号。 (我的称为 SVC_dispatcher)。你在哪所大学?我将尝试彻底解释这一点,不会假设您知道多少或不知道多少。我已经输入了正确的术语,因此如果我的评论不清楚或者您想要更深入的信息,您可以通过谷歌搜索来获取更多信息。我不确定冒号的标记方法,我习惯了旧的指令集。
祝你好运
SVC_dispatcher
PUSH {LR} ; always save your LR
LDR R14, [LR, #-4] ; its been stacked, so we can it (LR is R14)
; the link register is the line after the SVC instruction
; above, we load the instruction that is one before the
; link register (#-4 preindexed load) means instruction (SVC 1) into R14.
; Use bit clear to remove the mnemonic from the 32 bit instruction,
; leaving the data (1)
BIC R14, R14, #&FF000000
SVC_entry
CMP R14, #Max_SVC
BHI SVC_unknown
ADR R1, Jump_Table ; use this format, never add to the PC
LDR PC, [R1, R14, LSL #2]
; Beware: PC can be changed by IRQs **AT ANY TIME**
Jump_Table ; you know the drill here
DEFW SVC_0
DEFW SVC_1
SVC_0 B SVC_end
SVC_1 BL printString ; consider stacking registers that printString
B SVC_end ; will corrupt
SVC_end POP {LR} ; restore link register
MOV PC, LR
关于assembly - 编写自己的SVC调用ARM汇编,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16156404/
我正在为一个简单的循环而苦苦挣扎: for kernel in ('linear','poly', 'rbf'): svm = svm.SVC(kernel=kernel, C=1)
我正在为一个简单的循环而苦苦挣扎: for kernel in ('linear','poly', 'rbf'): svm = svm.SVC(kernel=kernel, C=1)
我需要在所有资源上使用 VNET 集成,但似乎如果我已经在 app-svc 中使用它,则不需要在应用程序服务计划级别指定它。我在这里缺少什么吗? Web 应用程序工作正常,但我想也许我因为没有在服务计
我需要在所有资源上使用 VNET 集成,但似乎如果我已经在 app-svc 中使用它,则不需要在应用程序服务计划级别指定它。我在这里缺少什么吗? Web 应用程序工作正常,但我想也许我因为没有在服务计
我使用 sklearn.svm.SVC 构建支持向量分类器,如下所示。 import numpy as np from sklearn.svm import SVC svc=SVC(proba
我认为它应该是相同的,但是对于方法 decision_function() 我得到了不同的结果。而只有 decision_function_shape='ovr' 的 SVC 确实更快。 相关:Sci
是否可以设置 Activity 探针来检查是否存在单独的服务?对于一个pod中的一个应用程序以及一个单独的pod中的一个数据库,我希望该app pod检查数据库pod的活跃性,而不是检查此pod本身。
ARM SVC 处理程序以哪种模式启动? 基本上,我想知道引发 SVC 异常时 ARM 内核处于哪种模式? 似乎无法在 ARM ARM 中找到它,但我的猜测是它在 Supervisor 中启动。 最佳
我使用 SVC 文件在 WAS 托管我的服务: 但是如您所见,它没有应有的 CodeBehind Attrbiute。及其工作原理。 怎么样? http://msdn.microsoft.com/e
给定一个以 .svc 结尾且应该运行 SOAP 网络服务的 URL,我如何从中获取一些数据? 我试过: 通过网络浏览器访问它 通过 Python 的库 Zeep 访问它 通过 Microsoft 实用
假设我有一个简单的 aarch64 函数,它通过 SVC 进行系统调用,看起来像这样(iOS 目标): make_syscall: stp fp, lr, [sp, #-16]! ad
我需要将 .svc 文件添加到已添加到解决方案中的 WCF 服务库(这没有 .svc 文件)。如果我通过广告新项目(例如 test.svc)指定此文件,则这是一个安装程序文件,而不是 WCF 文件。
与 asmx 文件相比,如何进入显示服务可用方法的可视化服务页面? http://soweb.adwiza.com/person.asmx 相对 http://soweb7.adwiza.com/re
我正在处理机器学习问题,但我遇到了使用 MultiOutputClassifier 可以运行的类(class)数量限制和 SVC .特别是,当类数> 14 时,拟合失败。我按照 MultiOutput
我有一个 WPF 应用程序,它使用 WCF 服务对使用 EF4 的实体执行操作。 我的项目结构如下: 项目:实体对象 这是 edmx 文件所在的位置 项目:WCFService 引用实体对象 具有对实
我正在尝试在数据集中拟合一个简单的SVC模型。一旦运行代码,就会出现弹出窗口,提示python.exe停止工作。 这是我的代码: Xtrain, Xtest, Ytrain, Ytest = trai
我正在研究 Cortex-M4 上的上下文保存和恢复机制,以便我可以实现简单的多任务处理。我使用 arm-none-eabi-g++ 来编译这段代码。便携性目前不是问题。 当任务可以调用 yield
我正在使用带有线性内核的 SVC 分类器来训练我的模型。列车数据:42000条记录 model = SVC(probability=True) model.fit(self.featu
我下载了数据。 news = datasets.fetch_20newsgroups(subset='all', categories=['alt.atheism', 'sci.space']) ve
我正在使用 SVM 分类器进行多类分类。 我希望 svc.predict 返回结果以及其他类的概率。 我得到的结果是这样的: print(svclassifier.predict([[79,93,60
我是一名优秀的程序员,十分优秀!