Skip to content

Commit

Permalink
[Fix] libutee: add headers for user-space to access sysregs
Browse files Browse the repository at this point in the history
On QEMU 32 bit machine, sysreg APIs aren't inlined but created as
separate functions. As we don't need to profile these APIs, mark
them as "__noprof".

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
  • Loading branch information
b49020 committed Aug 12, 2019
1 parent 60b3fc8 commit 07062e1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions scripts/arm32_sysreg.py
Expand Up @@ -69,7 +69,7 @@ def gen_read64_func(reg_name, opc1, crm, descr):
print('')
if len(descr):
print('/* ' + descr + ' */')
print('static inline uint64_t read_' + reg_name.lower() + '(void)')
print('static inline __noprof uint64_t read_' + reg_name.lower() + '(void)')
print('{')
print('\tuint64_t v;')
print('')
Expand All @@ -84,7 +84,8 @@ def gen_write64_func(reg_name, opc1, crm, descr):
print('')
if len(descr):
print('/* ' + descr + ' */')
print('static inline void write_' + reg_name.lower() + '(uint64_t v)')
print('static inline __noprof void write_' + reg_name.lower() +
'(uint64_t v)')
print('{')
print('\tasm volatile ("mcrr p15, ' + opc1 + ', %Q0, %R0, ' +
crm + '"' + ' : : "r" (v));')
Expand All @@ -95,7 +96,7 @@ def gen_read32_func(reg_name, crn, opc1, crm, opc2, descr):
print('')
if len(descr):
print('/* ' + descr + ' */')
print('static inline uint32_t read_' + reg_name.lower() + '(void)')
print('static inline __noprof uint32_t read_' + reg_name.lower() + '(void)')
print('{')
print('\tuint32_t v;')
print('')
Expand All @@ -110,7 +111,8 @@ def gen_write32_func(reg_name, crn, opc1, crm, opc2, descr):
print('')
if len(descr):
print('/* ' + descr + ' */')
print('static inline void write_' + reg_name.lower() + '(uint32_t v)')
print('static inline __noprof void write_' + reg_name.lower() +
'(uint32_t v)')
print('{')
print('\tasm volatile ("mcr p15, ' + opc1 + ', %0, ' + crn + ', ' +
crm + ', ' + opc2 + '"' + ' : : "r" (v));')
Expand Down

0 comments on commit 07062e1

Please sign in to comment.