[ewg] backport for kernel.h (upper_32_bits macro)

Vladimir Sokolovsky vlad at dev.mellanox.co.il
Mon Jan 21 07:50:34 PST 2008


Glenn Streiff wrote:
>> So for a typical kernel.h backport file, I'm proposing:
>>
> 
> Hmm...forgot to #define BACKPORT_KERNEL_H_2_6_22.  Try this:
> 
> diff --git a/kernel_addons/backport/2.6.9_U6/include/linux/kernel.h b/kernel_addons/backport/2.6.9_U6/include/linux/kernel.h
> index 110ecdf..1e302e8 100644
> --- a/kernel_addons/backport/2.6.9_U6/include/linux/kernel.h
> +++ b/kernel_addons/backport/2.6.9_U6/include/linux/kernel.h
> @@ -1,7 +1,14 @@
> +#ifndef BACKPORT_KERNEL_H_2_6_22
> +#define BACKPORT_KERNEL_H_2_6_22
> +
> +#include_next <linux/kernel.h>
> +
> +#define upper_32_bits(n) ((u32)(((n) >> 16) >> 16))
> +
> +#endif
>  #ifndef BACKPORT_KERNEL_H_2_6_18
>  #define BACKPORT_KERNEL_H_2_6_18
> 
> -#include_next <linux/kernel.h>
>  #include <linux/log2.h>
> 
>  #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
> 
> 
> Looks like I need to run this through ofed_makedist.sh as well.
> 
> Regards,
> 
> Glenn
> 

Hi Glenn,
Your kernel.h looks good.
As you said, you need to provide kernel.h for all directories under kernel_addons/backprort including 2.6.[20|21].

ofed_makedist.sh will not help in this case, because it is only applies patches for each backport directory and creates tgz file per backport.
You need to check the compilation on the OFA server.

Regards,
Vladimir



More information about the ewg mailing list