_tyrell_
Member
Hi!
In order to add support for the Ericson chatboard in Speccyal K, I have tried to compile the kbdrv.c (Mr Spiv) example. My compiler configuration is devkit advance (gcc 3.0.2).
It cannot compile the 2 following functions, there's a syntax error.
void installIRQ( int num, void (*irq)(void) ) {
asm volatile(""
"stmdb sp!,{lr} \n"
"mov r0,%[_num] \n"
"mov r1,%[_irq] \n"
"swi #0x09 \n"
"ldmia sp!,{lr}"
:
: [_num] "r"(num), [_irq] "r"(irq)
: "r0","r1");
}
static void removeIRQ( int num ) {
asm volatile(""
"stmdb sp!,{lr} \n"
"mov r0,%[_num] \n"
"swi #0x0a \n"
"ldmia sp!,{lr}"
:
: [_num] "r"(num)
: "r0");
}
The error message :
D:\devkitadv\projects\speccyalk>make
d:/devkitadv/bin/arm-agb-elf-gcc -DLITTLE_ENDIAN -DGP32 -DLSB_FIRST -mcpu=arm9td
mi -mtune=arm9tdmi -fexpensive-optimizations -mapcs -O3 -mstructure-size-boundar
y=8 -mno-thumb-interwork -fno-builtin -fno-common -fno-exceptions -finline-funct
ions -fomit-frame-pointer -fshort-enums -ffast-math -fshort-double -fallow-singl
e-precision -ffreestanding -Id:/devkitadv/arm-agb-elf/include/gp32 -Id:/devkitad
v/arm-agb-elf/include -c kbdrv.c
kbdrv.c: In function `installIRQ':
kbdrv.c:52: parse error before '[' token
kbdrv.c: In function `removeIRQ':
kbdrv.c:67: parse error before '[' token
make: *** [kbdrv.o] Error 1
line 52 is : [_num] "r"(num), [_irq] "r"(irq)
line 67 is : [_num] "r"(num)
Thanks for telling me what I have to change in order to compile it (my gcc asm knowledge is too poor for that!).
_tyrell_
In order to add support for the Ericson chatboard in Speccyal K, I have tried to compile the kbdrv.c (Mr Spiv) example. My compiler configuration is devkit advance (gcc 3.0.2).
It cannot compile the 2 following functions, there's a syntax error.
void installIRQ( int num, void (*irq)(void) ) {
asm volatile(""
"stmdb sp!,{lr} \n"
"mov r0,%[_num] \n"
"mov r1,%[_irq] \n"
"swi #0x09 \n"
"ldmia sp!,{lr}"
:
: [_num] "r"(num), [_irq] "r"(irq)
: "r0","r1");
}
static void removeIRQ( int num ) {
asm volatile(""
"stmdb sp!,{lr} \n"
"mov r0,%[_num] \n"
"swi #0x0a \n"
"ldmia sp!,{lr}"
:
: [_num] "r"(num)
: "r0");
}
The error message :
D:\devkitadv\projects\speccyalk>make
d:/devkitadv/bin/arm-agb-elf-gcc -DLITTLE_ENDIAN -DGP32 -DLSB_FIRST -mcpu=arm9td
mi -mtune=arm9tdmi -fexpensive-optimizations -mapcs -O3 -mstructure-size-boundar
y=8 -mno-thumb-interwork -fno-builtin -fno-common -fno-exceptions -finline-funct
ions -fomit-frame-pointer -fshort-enums -ffast-math -fshort-double -fallow-singl
e-precision -ffreestanding -Id:/devkitadv/arm-agb-elf/include/gp32 -Id:/devkitad
v/arm-agb-elf/include -c kbdrv.c
kbdrv.c: In function `installIRQ':
kbdrv.c:52: parse error before '[' token
kbdrv.c: In function `removeIRQ':
kbdrv.c:67: parse error before '[' token
make: *** [kbdrv.o] Error 1
line 52 is : [_num] "r"(num), [_irq] "r"(irq)
line 67 is : [_num] "r"(num)
Thanks for telling me what I have to change in order to compile it (my gcc asm knowledge is too poor for that!).
_tyrell_