at91 tsc error on AT91SAM9G20 platform
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.
Quoted 8 lines · 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:
include/asm-arm/syscall.h +13 -13
@@ -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; registerunsigned 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; registerunsigned 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; registerunsigned 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; registerunsigned long long after, before;unsigned counter, last_cnt;
Quoted 1 line
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.
Signature · 1 line
Gilles.
Quoted 85 lines · Gilles Chanteperdrix
Quoted 9 lines · 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=at91According to this link:
http://www.atmel.com/devices/SAM9G20.aspxThe 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:
include/asm-arm/syscall.h +13
-13@@ -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; registerunsigned 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; registerunsigned 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; registerunsigned 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; registerunsigned long long after, before;unsigned counter, last_cnt;
Quoted 7 lines
Quoted 2 lines
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.