* [binutils-gdb] sframe.h: make some macros more precise
@ 2022-12-09 18:27 Indu Bhagat
0 siblings, 0 replies; only message in thread
From: Indu Bhagat @ 2022-12-09 18:27 UTC (permalink / raw)
To: bfd-cvs
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=70cfae61f4ed5db02d8daa59dc4432ff2d9302bd
commit 70cfae61f4ed5db02d8daa59dc4432ff2d9302bd
Author: Indu Bhagat <indu.bhagat@oracle.com>
Date: Fri Dec 9 10:22:31 2022 -0800
sframe.h: make some macros more precise
include/ChangeLog:
* sframe.h (SFRAME_V1_FUNC_INFO): Use specific bits only.
(SFRAME_V1_FRE_INFO): Likewise.
Diff:
---
include/sframe.h | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/include/sframe.h b/include/sframe.h
index 7e31284e4d8..7e167bf4dbe 100644
--- a/include/sframe.h
+++ b/include/sframe.h
@@ -192,10 +192,10 @@ typedef struct sframe_func_desc_entry
/* Macros to compose and decompose function info in FDE. */
#define SFRAME_V1_FUNC_INFO(fde_type, fre_enc_type) \
- (((fde_type) & 0x1) << 4 | (fre_enc_type))
+ ((((fde_type) & 0x1) << 4) | ((fre_enc_type) & 0xf))
#define SFRAME_V1_FUNC_FRE_TYPE(data) ((data) & 0xf)
-#define SFRAME_V1_FUNC_FDE_TYPE(data) ((data >> 4) & 0x1)
+#define SFRAME_V1_FUNC_FDE_TYPE(data) (((data) >> 4) & 0x1)
/* Size of stack frame offsets in an SFrame Frame Row Entry. A single
SFrame FRE has all offsets of the same size. Offset size may vary
@@ -240,7 +240,8 @@ typedef struct sframe_fre_info
/* Macros to compose and decompose FRE info. */
#define SFRAME_V1_FRE_INFO(base_reg_id, offset_num, offset_size) \
- ((offset_size << 5) | (offset_num << 1) | (base_reg_id))
+ ((((offset_size) & 0x3) << 5) | (((offset_num) & 0xf) << 1) | \
+ ((base_reg_id) & 0x1))
#define SFRAME_V1_FRE_CFA_BASE_REG_ID(data) ((data) & 0x1)
#define SFRAME_V1_FRE_OFFSET_COUNT(data) (((data) >> 1) & 0xf)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-12-09 18:27 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-09 18:27 [binutils-gdb] sframe.h: make some macros more precise Indu Bhagat
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).