Skip to content

Commit

Permalink
Add inline
Browse files Browse the repository at this point in the history
  • Loading branch information
wtdcode committed Feb 13, 2024
1 parent 591b562 commit a4ba7c9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions qemu/include/tcg/tcg-apple-jit.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ static inline void jit_write_protect(int enabled)
// Taken from
// https://stackoverflow.com/questions/70019553/lldb-how-to-read-the-permissions-of-a-memory-region-for-a-thread
// https://blog.svenpeter.dev/posts/m1_sprr_gxf/
static uint64_t read_sprr_perm(void)
static inline uint64_t read_sprr_perm(void)
{
uint64_t v;
__asm__ __volatile__("isb sy\n"
Expand All @@ -46,19 +46,19 @@ static uint64_t read_sprr_perm(void)
return v;
}

__attribute__((unused)) static uint8_t thread_mask()
__attribute__((unused)) static inline uint8_t thread_mask()
{
uint64_t v = read_sprr_perm();

return (v >> 20) & 3;
}

__attribute__((unused)) static bool thread_writeable()
__attribute__((unused)) static inline bool thread_writeable()
{
return thread_mask() == 3;
}

__attribute__((unused)) static bool thread_executable()
__attribute__((unused)) static inline bool thread_executable()
{
return thread_mask() == 1;
}
Expand Down

0 comments on commit a4ba7c9

Please sign in to comment.