lkml.org 
[lkml]   [2010]   [Jun]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 00/13] jump label v9
From
From: Jason Baron <jbaron@redhat.com>
Date: Tue, 15 Jun 2010 10:28:11 -0400

> For example, the reason I have it in the code is b/c x86 determines
> the best no-op at run-time. Are other architectures going to have to
> require this kind of functionality. Or like sparc, are we going to
> be able to generally hard-code the nops on non-x86 at compile-time?

I think most architectures will use a constant nop sequence, in fact
x86 is the only one I can think of that needs variable nop sequences.

Why not abstract this behind some asm/jump_label.h macro just like
everything else? "jump_label_text_poke_early()" or similar.
On sparc64 I would define this to:

#include <asm/system.h>

static inline void jump_label_text_poke_early(void *addr, const void *opcode, size_t len)
{
u32 new_insn = *(u32 *)opcode;
u32 *insn_p = (u32 *) addr;

*insn_p = new_insn;
flushi(insn_p);
}


\
 
 \ /
  Last update: 2010-06-15 19:15    [W:0.181 / U:0.212 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site