Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

rdtsc() problem

Featured Replies

Hi all,

 

I have some piece of software to compile on our Armbina system (Linux odroidc2 4.19.90-meson64 #5.99 SMP PREEMPT Fri Dec 20 13:47:25 CET 2019 aarch64 GNU/Linux).

It is a C++ program, usually running on x86 machines, and has one line of code killing the compilation:

asm volatile ("rdtsc" : "=a" (low), "=d" (high));

I need to replace it by some code working with g++ on ARM64.

Anyone how can give me a hint? I tried Google, but found no reasonable solution.

 

In case, the software package is public, if you need the link to get it, please let me know.

 

Any help is appreciated.

Thanks in advance, Michael

  • Author

I finally could find some suitable solution here.

Basically it is like

 

  // System timer of ARMv8 runs at a different frequency than the CPU's.
  // The frequency is fixed, typically in the range 1-50MHz.  It can be
  // read at CNTFRQ special register.  We assume the OS has set up
  // the virtual timer properly.
  int64_t virtual_timer_value;
  asm volatile("mrs %0, cntvct_el0" : "=r"(virtual_timer_value));
  return virtual_timer_value;

It seems to return meaningful values, just in case someone else needs some similar benchmarking.

 

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.