Thread (14 messages) 14 messages, 5 authors, 2014-06-17
STALE4380d
Revisions (5)
  1. resend [diff vs current]
  2. resend current
  3. v2 [diff vs current]
  4. v2 [diff vs current]
  5. v2 [diff vs current]

[PATCH RESEND 2/7] ARM: Introduce arm_get_current_stack_frame()

From: rric@kernel.org (Robert Richter)
Date: 2014-05-23 12:11:35

On 23.05.14 10:26:31, Nikolay Borisov wrote:
+#define frame_pointer(regs)				  \
+	IS_ENABLED(CONFIG_THUMB2_KERNEL) ? (regs)->ARM_r7 \
+	: (regs)->ARM_fp				  \
#ifdef CONFIG_THUMB2_KERNEL

... is better here, this is booleon, not tristate, better to read, and
no mixed c and macro statements either.
+void arm_get_current_stackframe(struct pt_regs *regs, struct stackframe *frame)
+{
+		frame->fp = frame_pointer(regs);
+		frame->sp = regs->ARM_sp;
+		frame->lr = regs->ARM_lr;
+		frame->pc = regs->ARM_pc;
+}
+EXPORT_SYMBOL_GPL(arm_get_current_stackframe);
I am wondering if this should be better implemented as inline function
as this is in the hot path.

-Robert
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help