[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Compilation problem



Hmm, I thought I already answered this. Here is my answer again:

The missing variables are in the kernel itself. You have to compile the
driver as part of the kernel (i.e. store the code in e.g.
arch/cris/drivers/ and and it in the Makefile there) or as a loadable
module. There is no way for a userspace application to reach theese
variables.
 
/Mikael

-----Original Message-----
From: owner-dev-etrax@xxxxxxx.com">mailto:owner-dev-etrax@xxxxxxx.com] On
Behalf Of Nikke
Sent: Tuesday, December 07, 2004 11:58 PM
To: dev-etrax
Subject: Compilation problem


Hi

I'm trying to write a simple driver that using 2 pins on the PA port.
Pins
needs to be bi-directional, and the timing is quite crusial. The driver
is
very similar to the I2C. I have included the same libraries and created
a
makefile.. but when i try to compile it claims about the undefined
reference
to.. (see below). Included all libraries that i think should be
sufficient
for the driver..

#define __KERNEL__
#define __MODULE__

#include <linux/config.h>
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/fs.h>
#include <linux/string.h>
#include <linux/time.h>
#include <linux/ioport.h>
#include <linux/delay.h>

#include <asm/system.h>
#include <asm/svinto.h>
#include <asm/io.h>

#include "ps2.h"
#include "ps2_ioc.h"

This is what i get...

debian:~/Projects/wearable/axis/devboard_82/apps/ps2# make
gcc-cris  -isystem
/root/Projects/wearable/axis/devboard_82/target/cris-axis-linux-gnu/incl
ude 
-mlinux -mno-mul-bug-workaround -Wall -Wshadow -O2 -g   -c -o ps2.o
ps2.c
gcc-cris  -isystem
/root/Projects/wearable/axis/devboard_82/target/cris-axis-linux-gnu/incl
ude 
-mlinux -mno-mul-bug-workaround
-L/root/Projects/wearable/axis/devboard_82/
target/cris-axis-linux-gnu/lib ps2.o  -o ps2
ps2.o: In function `ps2_init':
/root/Projects/wearable/axis/devboard_82/apps/ps2/ps2.c:110: undefined
reference to `port_pa_data_shadow'
/root/Projects/wearable/axis/devboard_82/apps/ps2/ps2.c:110: undefined
reference to `loops_per_usec'
ps2.o: In function `ps2_ioctl':
/root/Projects/wearable/axis/devboard_82/apps/ps2/ps2.c:144: undefined
reference to `port_pa_dir_shadow'
ps2.o: In function `ps2_init':
/root/Projects/wearable/axis/devboard_82/apps/ps2/ps2.c:110: undefined
reference to `register_chrdev'
/root/Projects/wearable/axis/devboard_82/apps/ps2/ps2.c:110: undefined
reference to `port_pa_dir_shadow'
collect2: ld returned 1 exit status
make: *** [ps2] Error 1


i don't have any idea right now what causes this ...

Or would it be possible to use the gpio driver (timing is in 15-20 us)
??


MVH

Nikke

Retel HB