Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Arm Trusted Firmware
Commits
d01c67e0
Commit
d01c67e0
authored
Jan 12, 2015
by
danh-arm
Browse files
Merge pull request #229 from sandrine-bailleux/sb/tf-issue-273
Prevent optimisation of sysregs accessors calls
parents
ff990202
36e2fd01
Changes
1
Hide whitespace changes
Inline
Side-by-side
include/lib/aarch64/arch_helpers.h
View file @
d01c67e0
...
...
@@ -40,24 +40,24 @@
* registers
*********************************************************************/
#define _DEFINE_SYSREG_READ_FUNC(_name, _reg_name) \
static inline uint64_t read_ ## _name(void) \
{ \
uint64_t v; \
__asm__ ("mrs %0, " #_reg_name : "=r" (v)); \
return v; \
#define _DEFINE_SYSREG_READ_FUNC(_name, _reg_name)
\
static inline uint64_t read_ ## _name(void)
\
{
\
uint64_t v;
\
__asm__
volatile
("mrs %0, " #_reg_name : "=r" (v)); \
return v;
\
}
#define _DEFINE_SYSREG_WRITE_FUNC(_name, _reg_name) \
static inline void write_ ## _name(uint64_t v) \
{ \
__asm__ ("msr " #_reg_name ", %0" : : "r" (v)); \
#define _DEFINE_SYSREG_WRITE_FUNC(_name, _reg_name)
\
static inline void write_ ## _name(uint64_t v)
\
{
\
__asm__
volatile
("msr " #_reg_name ", %0" : : "r" (v)); \
}
#define _DEFINE_SYSREG_WRITE_CONST_FUNC(_name, _reg_name) \
static inline void write_ ## _name(const uint64_t v) \
{ \
__asm__ ("msr " #_reg_name ", %0" : : "i" (v)); \
static inline void write_ ## _name(const uint64_t v)
\
{
\
__asm__
volatile
("msr " #_reg_name ", %0" : : "i" (v)); \
}
/* Define read function for system register */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment