打印

How to test atomic access implementedvv

[复制链接]
204|0
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
社畜一枚|  楼主 | 2018-9-9 09:32 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
Hi there,
i have several inline assembly functions wrapped in C.
They implement atomic / read-modfy-write style
Compare And Swap
Increment
Decrement
Lock Semaphore
Creating a  good case Test i got done.
But now i am struggling to produce a reliable and reproducible bad case test. I want to test the \"exclusive store failed\" paths in all functions.
Is there any way i can induce a Fail to the exclusive store upon the exclusive load?
Testing by Debugger to manually manipulate the Program Counter could be a way, but I prefer to
Id prefer to manipulate something in Memory to have a \"minimal\" effect...
My initial Tests to first:
simply halt execution between load and store exclusive,
then:
accessing RAM via debugger,
did not result in a failing Store Exclusive....
Is there some approach to this?
My Plan-B is to Brute Force it, by repeatedly calling the functions and trying to generate a lot IRQs to interrupt in the critical moment.
But that seems hardly reliable and reproducible....

使用特权

评论回复

相关帖子

发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

397

主题

401

帖子

0

粉丝