hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/arch/x86/include/asm/frame.h
....@@ -60,12 +60,26 @@
6060 #define FRAME_END "pop %" _ASM_BP "\n"
6161
6262 #ifdef CONFIG_X86_64
63
+
6364 #define ENCODE_FRAME_POINTER \
6465 "lea 1(%rsp), %rbp\n\t"
66
+
67
+static inline unsigned long encode_frame_pointer(struct pt_regs *regs)
68
+{
69
+ return (unsigned long)regs + 1;
70
+}
71
+
6572 #else /* !CONFIG_X86_64 */
73
+
6674 #define ENCODE_FRAME_POINTER \
6775 "movl %esp, %ebp\n\t" \
6876 "andl $0x7fffffff, %ebp\n\t"
77
+
78
+static inline unsigned long encode_frame_pointer(struct pt_regs *regs)
79
+{
80
+ return (unsigned long)regs & 0x7fffffff;
81
+}
82
+
6983 #endif /* CONFIG_X86_64 */
7084
7185 #endif /* __ASSEMBLY__ */
....@@ -83,6 +97,11 @@
8397
8498 #define ENCODE_FRAME_POINTER
8599
100
+static inline unsigned long encode_frame_pointer(struct pt_regs *regs)
101
+{
102
+ return 0;
103
+}
104
+
86105 #endif
87106
88107 #define FRAME_BEGIN