lkml.org 
[lkml]   [2010]   [Mar]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
DateMon, 22 Mar 2010 23:01:39 +0200
FromAvi Kivity <>
SubjectRe: [PATCH 2/5] jump label: base patch
On 03/22/2010 06:07 PM, Jason Baron wrote:
> base patch to implement 'jump labeling'. Based on a new 'asm goto' inline
> assembly gcc mechanism, we can now branch to labels from an 'asm goto'
> statment. This allows us to create a 'no-op' fastpath, which can subsequently
> be patched with a jump to the slowpath code. This is useful for code which
> might be rarely used, but which we'd like to be able to call, if needed.
> Tracepoints are the current usecase that these are being implemented for.
>
>
> +
> +#define JUMP_LABEL(tag, label, cond) \
> + if (unlikely(cond)) \
> + goto label;
>

Suggest wrapping with do { } while (0) to avoid problems with the
dangling semicolon or a trailing 'else' from an outer if ().
--
Do not meddle in the internals of kernels, for they are subtle and quick to panic.



\
 
 \ /
  Last update: 2010-03-22 22:05    [from the cache]
©2003-2010