How to test atomic access implementedvv

[复制链接]
 楼主| 社畜一枚 发表于 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

粉丝
快速回复 在线客服 返回列表 返回顶部

397

主题

401

帖子

0

粉丝
快速回复 在线客服 返回列表 返回顶部