[Click] [PATCH] linux-2.6.16.13-patch

Eddie Kohler kohler at cs.ucla.edu
Sat Sep 16 23:03:59 EDT 2006


Hi Mathias,

Thanks for these!  But there's a problem.  If a kernel header is included in 
C++ we need to define "asmlinkage" as "extern "C"", so in your version "extern 
asmlinkage" compiles to "extern extern "C"", which is a syntax error.  The 
right fix is a bit more complex.  A version of both patches has been applied; 
you might want to check if this new patch works for arm.

Eddie




Mathias Jeschke wrote:
> Hello click developers,
> 
> I created a patch file to successfully compile click-cvs (>=1.5) as
> linuxmodule for the Netgear WGT634U (mips architecture):
> 
> -> First problem:
>      (*save_fp_context)(), (*restore_fp_context)() and the 32bit
>      variants will be redeclared, since your patch removes the "extern"
>      declarations!
> 
> -> Second:
>      A copy-n-paste error in 'ktime_to_timespec(' on machines,
>      like mips with:
>        !( (BITS_PER_LONG == 64) || defined(CONFIG_KTIME_SCALAR) )
>      (x86 is not affected - so nobody seems to notice that bug yet?)
> 
> 
> Please read the attached patch file and update your repository.
> 
> Regards,
> Mathias
> 
> 
> 
> ------------------------------------------------------------------------
> 
> --- click-cvs.orig/etc/linux-2.6.16.13-patch	2006-08-10 16:20:13.000000000 +0200
> +++ click-cvs/etc/linux-2.6.16.13-patch	2006-08-10 16:28:06.000000000 +0200
> @@ -1571,25 +1571,6 @@
>   	local_irq_restore(flags);
>   	return(prev);
>   }
> -diff -ru ../linux-2.6.16.13/include/asm-mips/fpu.h ./include/asm-mips/fpu.h
> ---- ../linux-2.6.16.13/include/asm-mips/fpu.h	2006-05-02 14:38:44.000000000 -0700
> -+++ ./include/asm-mips/fpu.h	2006-05-02 22:59:19.000000000 -0700
> -@@ -24,11 +24,11 @@
> - struct sigcontext;
> - struct sigcontext32;
> - 
> --extern asmlinkage int (*save_fp_context)(struct sigcontext *sc);
> --extern asmlinkage int (*restore_fp_context)(struct sigcontext *sc);
> -+asmlinkage int (*save_fp_context)(struct sigcontext *sc);
> -+asmlinkage int (*restore_fp_context)(struct sigcontext *sc);
> - 
> --extern asmlinkage int (*save_fp_context32)(struct sigcontext32 *sc);
> --extern asmlinkage int (*restore_fp_context32)(struct sigcontext32 *sc);
> -+asmlinkage int (*save_fp_context32)(struct sigcontext32 *sc);
> -+asmlinkage int (*restore_fp_context32)(struct sigcontext32 *sc);
> - 
> - extern void fpu_emulator_init_fpu(void);
> - extern void _init_fpu(void);
>  diff -ru ../linux-2.6.16.13/include/asm-mips/io.h ./include/asm-mips/io.h
>  --- ../linux-2.6.16.13/include/asm-mips/io.h	2006-05-02 14:38:44.000000000 -0700
>  +++ ./include/asm-mips/io.h	2006-05-23 08:40:44.000000000 -0700
> @@ -2841,7 +2822,7 @@
>   
>   /* convert a timespec to ktime_t format: */
>   static inline ktime_t timespec_to_ktime(struct timespec ts)
> -@@ -136,13 +142,23 @@
> +@@ -136,13 +142,24 @@
>    *   tv.sec < 0 and 0 >= tv.nsec < NSEC_PER_SEC
>    */
>   
> @@ -2852,6 +2833,7 @@
>  +#else
>  +# define KTIME_TV64(__s)		((ktime_t) { .tv64 = (__s) })
>  +# define KTIME_SEC_NSEC(__sec, __nsec)	((ktime_t) { .tv = { .sec = (__sec), .nsec = (__nsec) } })
> ++# define TIMESPEC_KTIME_SEC_NSEC(__kt)  ((struct timespec) { .tv_sec = (time_t) kt.tv.sec, .tv_nsec = (long) kt.tv.nsec })
>  +# define TIMEVAL_SEC_USEC(__sec, __usec) ((struct timeval) { .tv_sec = (__sec), .tv_usec = (__usec) })
>  +#endif
>  +
> @@ -2867,7 +2849,7 @@
>   }
>   
>   /**
> -@@ -210,8 +226,7 @@
> +@@ -210,8 +227,7 @@
>    */
>   static inline ktime_t timespec_to_ktime(const struct timespec ts)
>   {
> @@ -2877,7 +2859,7 @@
>   }
>   
>   /**
> -@@ -223,8 +238,7 @@
> +@@ -223,8 +239,7 @@
>    */
>   static inline ktime_t timeval_to_ktime(const struct timeval tv)
>   {
> @@ -2887,17 +2869,17 @@
>   }
>   
>   /**
> -@@ -236,8 +250,7 @@
> +@@ -236,8 +251,7 @@
>    */
>   static inline struct timespec ktime_to_timespec(const ktime_t kt)
>   {
>  -	return (struct timespec) { .tv_sec = (time_t) kt.tv.sec,
>  -				   .tv_nsec = (long) kt.tv.nsec };
> -+	return KTIME_SEC_NSEC((time_t) kt.tv.sec, (long) kt.tv.nsec);
> ++	return TIMESPEC_KTIME_SEC_NSEC(kt);
>   }
>   
>   /**
> -@@ -249,9 +262,8 @@
> +@@ -249,9 +263,8 @@
>    */
>   static inline struct timeval ktime_to_timeval(const ktime_t kt)
>   {
> @@ -2909,7 +2891,7 @@
>   }
>   
>   /**
> -@@ -284,8 +296,8 @@
> +@@ -284,8 +297,8 @@
>    * idea of the (in)accuracy of timers. Timer values are rounded up to
>    * this resolution values.
>    */
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click


More information about the click mailing list