All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai] at91 tsc error on AT91SAM9G20 platform
@ 2012-11-10  3:15 at91_enthus
  2012-11-10  9:10 ` Gilles Chanteperdrix
  0 siblings, 1 reply; 3+ messages in thread
From: at91_enthus @ 2012-11-10  3:15 UTC (permalink / raw)
  To: xenomai

Hi.

I'm having problems building the user space for Xenomai 2.6.1 (for
AT91SAM9G20).
Long story short, I issue the following commands:

$ ./configure CFLAGS="-march=armv4t" LDFLAGS="-march=armv4t"
--host=arm-linux-gnueabi  --enable-arm-tsc=at91

$ make DESTDIR=../xenomai_dest  install

Here's a snippet of the error messages:
******************************************
In file included from ../../../src/include/asm/xenomai/atomic.h:276,
                 from ../../../include/nucleus/system.h:26,
                 from ../../../src/include/asm/xenomai/system.h:247,
                 from ../../../include/nucleus/types.h:36,
                 from ../../../include/nucleus/thread.h:25,
                 from assert_context.c:24:
../../../src/include/asm/xenomai/syscall.h: In function '__xn_rdtsc':
../../../src/include/asm/xenomai/syscall.h:290: error: 'struct
__xn_full_tscinfo' has no member named 'tsc'
../../../src/include/asm/xenomai/syscall.h:291: error: 'struct
__xn_full_tscinfo' has no member named 'counter'
../../../src/include/asm/xenomai/syscall.h:292: error: 'struct
__xn_full_tscinfo' has no member named 'mask'
******************************************

If I don't choose TSC emulation for ARM, everything compiles fine.


Thank you.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Xenomai] at91 tsc error on AT91SAM9G20 platform
  2012-11-10  3:15 [Xenomai] at91 tsc error on AT91SAM9G20 platform at91_enthus
@ 2012-11-10  9:10 ` Gilles Chanteperdrix
  2012-11-10 15:03   ` at91_enthus
  0 siblings, 1 reply; 3+ messages in thread
From: Gilles Chanteperdrix @ 2012-11-10  9:10 UTC (permalink / raw)
  To: at91_enthus; +Cc: xenomai

On 11/10/2012 04:15 AM, at91_enthus wrote:

> Hi.
> 
> I'm having problems building the user space for Xenomai 2.6.1 (for
> AT91SAM9G20).
> Long story short, I issue the following commands:
> 
> $ ./configure CFLAGS="-march=armv4t" LDFLAGS="-march=armv4t"
> --host=arm-linux-gnueabi  --enable-arm-tsc=at91


According to this link:
http://www.atmel.com/devices/SAM9G20.aspx

The AT91SAM9G20 is based on an arm926 core, so, it is an armv5, not an 
armv4.

And if you are compiling xenomai for a recent version of the I-pipe 
patch, you do not need to pass the --enable-arm-tsc option. This option 
is made for compiling xenomai for an old kernel.

Anyway, you can try the following patch:
diff --git a/include/asm-arm/syscall.h b/include/asm-arm/syscall.h
index 5ca1bf0..8161d39 100644
--- a/include/asm-arm/syscall.h
+++ b/include/asm-arm/syscall.h
@@ -257,9 +257,9 @@ static inline unsigned long long __xn_rdtsc(void)
 	return __xn_tscinfo.kuser_tsc_get(__xn_tscinfo.kinfo.counter);
 
 #elif CONFIG_XENO_ARM_TSC_TYPE == __XN_TSC_TYPE_FREERUNNING
-	volatile unsigned long long *const tscp = __xn_tscinfo.tsc;
-	volatile unsigned *const counterp = __xn_tscinfo.counter;
-	const unsigned mask = __xn_tscinfo.mask;
+	volatile unsigned long long *const tscp = __xn_tscinfo.kinfo.tsc;
+	volatile unsigned *const counterp = __xn_tscinfo.kinfo.counter;
+	const unsigned mask = __xn_tscinfo.kinfo.mask;
 	register unsigned long long result;
 	unsigned counter;
 
@@ -272,9 +272,9 @@ static inline unsigned long long __xn_rdtsc(void)
 	return (result & ~((unsigned long long) mask)) | (counter & mask);
 
 #elif CONFIG_XENO_ARM_TSC_TYPE == __XN_TSC_TYPE_FREERUNNING_COUNTDOWN
-	volatile unsigned long long *const tscp = __xn_tscinfo.tsc;
-	volatile unsigned *const counterp = __xn_tscinfo.counter;
-	const unsigned mask = __xn_tscinfo.mask;
+	volatile unsigned long long *const tscp = __xn_tscinfo.kinfo.tsc;
+	volatile unsigned *const counterp = __xn_tscinfo.kinfo.counter;
+	const unsigned mask = __xn_tscinfo.kinfo.mask;
 	register unsigned long long result;
 	unsigned counter;
 
@@ -287,9 +287,9 @@ static inline unsigned long long __xn_rdtsc(void)
 	return (result & ~((unsigned long long) mask)) | (counter & mask);
 
 #elif CONFIG_XENO_ARM_TSC_TYPE == __XN_TSC_TYPE_FREERUNNING_FAST_WRAP
-	volatile unsigned long long *const tscp = __xn_tscinfo.tsc;
-	volatile unsigned *const counterp = __xn_tscinfo.counter;
-	const unsigned mask = __xn_tscinfo.mask;
+	volatile unsigned long long *const tscp = __xn_tscinfo.kinfo.tsc;
+	volatile unsigned *const counterp = __xn_tscinfo.kinfo.counter;
+	const unsigned mask = __xn_tscinfo.kinfo.mask;
 	register unsigned long long after, before;
 	unsigned counter;
 
@@ -305,10 +305,10 @@ static inline unsigned long long __xn_rdtsc(void)
 	return (before & ~((unsigned long long) mask)) | (counter & mask);
 
 #elif CONFIG_XENO_ARM_TSC_TYPE == __XN_TSC_TYPE_DECREMENTER
-	volatile unsigned long long *const tscp = __xn_tscinfo.tsc;
-	volatile unsigned *const counterp = __xn_tscinfo.counter;
-	volatile unsigned *const last_cntp = __xn_tscinfo.last_cnt;
-	const unsigned mask = __xn_tscinfo.mask;
+	volatile unsigned long long *const tscp = __xn_tscinfo.kinfo.tsc;
+	volatile unsigned *const counterp = __xn_tscinfo.kinfo.counter;
+	volatile unsigned *const last_cntp = __xn_tscinfo.kinfo.last_cnt;
+	const unsigned mask = __xn_tscinfo.kinfo.mask;
 	register unsigned long long after, before;
 	unsigned counter, last_cnt;
 


> If I don't choose TSC emulation for ARM, everything compiles fine.


...and if you are using a recent I-pipe patch, it is what you should do 
anyway.

-- 
                                                                Gilles.


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Xenomai] at91 tsc error on AT91SAM9G20 platform
  2012-11-10  9:10 ` Gilles Chanteperdrix
@ 2012-11-10 15:03   ` at91_enthus
  0 siblings, 0 replies; 3+ messages in thread
From: at91_enthus @ 2012-11-10 15:03 UTC (permalink / raw)
  To: xenomai

On 11/10/2012 03:10 AM, Gilles Chanteperdrix wrote:
> On 11/10/2012 04:15 AM, at91_enthus wrote:
>
>   
>> Hi.
>>
>> I'm having problems building the user space for Xenomai 2.6.1 (for
>> AT91SAM9G20).
>> Long story short, I issue the following commands:
>>
>> $ ./configure CFLAGS="-march=armv4t" LDFLAGS="-march=armv4t"
>> --host=arm-linux-gnueabi  --enable-arm-tsc=at91
>>     
>
> According to this link:
> http://www.atmel.com/devices/SAM9G20.aspx
>
> The AT91SAM9G20 is based on an arm926 core, so, it is an armv5, not an 
> armv4.
>
> And if you are compiling xenomai for a recent version of the I-pipe 
> patch, you do not need to pass the --enable-arm-tsc option. This option 
> is made for compiling xenomai for an old kernel.
>
> Anyway, you can try the following patch:
> diff --git a/include/asm-arm/syscall.h b/include/asm-arm/syscall.h
> index 5ca1bf0..8161d39 100644
> --- a/include/asm-arm/syscall.h
> +++ b/include/asm-arm/syscall.h
> @@ -257,9 +257,9 @@ static inline unsigned long long __xn_rdtsc(void)
>  	return __xn_tscinfo.kuser_tsc_get(__xn_tscinfo.kinfo.counter);
>  
>  #elif CONFIG_XENO_ARM_TSC_TYPE == __XN_TSC_TYPE_FREERUNNING
> -	volatile unsigned long long *const tscp = __xn_tscinfo.tsc;
> -	volatile unsigned *const counterp = __xn_tscinfo.counter;
> -	const unsigned mask = __xn_tscinfo.mask;
> +	volatile unsigned long long *const tscp = __xn_tscinfo.kinfo.tsc;
> +	volatile unsigned *const counterp = __xn_tscinfo.kinfo.counter;
> +	const unsigned mask = __xn_tscinfo.kinfo.mask;
>  	register unsigned long long result;
>  	unsigned counter;
>  
> @@ -272,9 +272,9 @@ static inline unsigned long long __xn_rdtsc(void)
>  	return (result & ~((unsigned long long) mask)) | (counter & mask);
>  
>  #elif CONFIG_XENO_ARM_TSC_TYPE == __XN_TSC_TYPE_FREERUNNING_COUNTDOWN
> -	volatile unsigned long long *const tscp = __xn_tscinfo.tsc;
> -	volatile unsigned *const counterp = __xn_tscinfo.counter;
> -	const unsigned mask = __xn_tscinfo.mask;
> +	volatile unsigned long long *const tscp = __xn_tscinfo.kinfo.tsc;
> +	volatile unsigned *const counterp = __xn_tscinfo.kinfo.counter;
> +	const unsigned mask = __xn_tscinfo.kinfo.mask;
>  	register unsigned long long result;
>  	unsigned counter;
>  
> @@ -287,9 +287,9 @@ static inline unsigned long long __xn_rdtsc(void)
>  	return (result & ~((unsigned long long) mask)) | (counter & mask);
>  
>  #elif CONFIG_XENO_ARM_TSC_TYPE == __XN_TSC_TYPE_FREERUNNING_FAST_WRAP
> -	volatile unsigned long long *const tscp = __xn_tscinfo.tsc;
> -	volatile unsigned *const counterp = __xn_tscinfo.counter;
> -	const unsigned mask = __xn_tscinfo.mask;
> +	volatile unsigned long long *const tscp = __xn_tscinfo.kinfo.tsc;
> +	volatile unsigned *const counterp = __xn_tscinfo.kinfo.counter;
> +	const unsigned mask = __xn_tscinfo.kinfo.mask;
>  	register unsigned long long after, before;
>  	unsigned counter;
>  
> @@ -305,10 +305,10 @@ static inline unsigned long long __xn_rdtsc(void)
>  	return (before & ~((unsigned long long) mask)) | (counter & mask);
>  
>  #elif CONFIG_XENO_ARM_TSC_TYPE == __XN_TSC_TYPE_DECREMENTER
> -	volatile unsigned long long *const tscp = __xn_tscinfo.tsc;
> -	volatile unsigned *const counterp = __xn_tscinfo.counter;
> -	volatile unsigned *const last_cntp = __xn_tscinfo.last_cnt;
> -	const unsigned mask = __xn_tscinfo.mask;
> +	volatile unsigned long long *const tscp = __xn_tscinfo.kinfo.tsc;
> +	volatile unsigned *const counterp = __xn_tscinfo.kinfo.counter;
> +	volatile unsigned *const last_cntp = __xn_tscinfo.kinfo.last_cnt;
> +	const unsigned mask = __xn_tscinfo.kinfo.mask;
>  	register unsigned long long after, before;
>  	unsigned counter, last_cnt;
>  
>
>
>   
>> If I don't choose TSC emulation for ARM, everything compiles fine.
>>     
>
> ...and if you are using a recent I-pipe patch, it is what you should do 
> anyway.
>
>   

The patch worked. Everything installed fine.

Thank you.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-11-10 15:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-10  3:15 [Xenomai] at91 tsc error on AT91SAM9G20 platform at91_enthus
2012-11-10  9:10 ` Gilles Chanteperdrix
2012-11-10 15:03   ` at91_enthus

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.