Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added ARM archictecture detection to avoid the native call error when RDTSC used #227

Merged
merged 1 commit into from
Feb 9, 2015

Conversation

majimenezp
Copy link
Contributor

During a development with an Arm device and using Netmq, the device send an exception related to the use of a native call using mmap and the RDTSC instructions for x86. The problem is RDTSC don't exist in the ARM instructions set(must use a cycle counter at kernel leve in linux). This happens when you implements a poller.

I applied a workaround, detecting if NetMQ is running in an Arm device, set the RSTSC delegate to a function that returns the current tick count that mono(and .Net) provides. I am planning to implement the native call in asm for the cycle counter but in this moment seems to be a little more complex for my current knowledge, but i am working on it.

The required asm calls are documented in this asm codefile:
https://github.com/prabindh/peemuperf/blob/master/v7_pmu.S

I tested the change in two devices, one is a custom Arm board with ubuntu 12.04 and the last version of mono compiled in the device. Also in a raspberry Pi.

Thanks

… RDTSC is used in linux, temporary using Enviroment.Tickcount
somdoron added a commit that referenced this pull request Feb 9, 2015
Added ARM archictecture detection to avoid the native call error when RDTSC used
@somdoron somdoron merged commit 5f342ce into zeromq:master Feb 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants