[PVFS-users] RE: Error in compiling pvfs-kernel with gcc-3.4.X
Murali Vilayannur
vilayann at mcs.anl.gov
Wed Jul 21 15:04:04 EDT 2004
Hi,
Could you please try the attached patch and let us know if it fixes your
problem?
Thanks,
Murali
On Wed, 21 Jul 2004, E. Otto wrote:
> Hi,
> In an attempt to recompile pvfs-kernel with gcc-3.4.X, I got a bunch of
> conflicting type error from "krwsemaphore-spinlock.c" and the prototype
> definitions in rwsemaphore.h. Did any one encounter this before and
> is there a quick fix? The sample errors are shown below: The error
> occurs for all functions enclosed in the FASTCALL() macro.
> ...
> ...
> krwsemaphore-spinlock.c:46: error: conflicting types for 'init_pvfs_rwsem'
> rwsemaphore.h:47: error: previous declaration of 'init_pvfs_rwsem' was here
> krwsemaphore-spinlock.c:46: error: conflicting types for 'init_pvfs_rwsem'
> rwsemaphore.h:47: error: previous declaration of 'init_pvfs_rwsem' was here
> krwsemaphore-spinlock.c:118: error: conflicting types for '__Down_read'
> rwsemaphore.h:48: error: previous declaration of '__Down_read' was here
> krwsemaphore-spinlock.c:118: error: conflicting types for '__Down_read'
> rwsemaphore.h:48: error: previous declaration of '__Down_read' was here
> krwsemaphore-spinlock.c:161: error: conflicting types for
> '__Down_read_trylock'
> rwsemaphore.h:49: error: previous declaration of '__Down_read_trylock'
> was here
> krwsemaphore-spinlock.c:161: error: conflicting types for
> '__Down_read_trylock'
> rwsemaphore.h:49: error: previous declaration of '__Down_read_trylock'
> was here
> krwsemaphore-spinlock.c:179: error: conflicting types for
> '__Down_read_interruptible'
> rwsemaphore.h:50: error: previous declaration of
> '__Down_read_interruptible' was here
> krwsemaphore-spinlock.c:179: error: conflicting types for
> '__Down_read_interruptible'
> rwsemaphore.h:50: error: previous declaration of
> '__Down_read_interruptible' was here
> krwsemaphore-spinlock.c:239: error: conflicting types for
> '__Down_timed_read_interruptible'
> rwsemaphore.h:51: error: previous declaration of
> '__Down_timed_read_interruptible' was here
> krwsemaphore-spinlock.c:239: error: conflicting types for
> '__Down_timed_read_interruptible'
> rwsemaphore.h:51: error: previous declaration of
> '__Down_timed_read_interruptible' was here
> krwsemaphore-spinlock.c:316: error: conflicting types for '__Down_write'
> rwsemaphore.h:52: error: previous declaration of '__Down_write' was here
> _______________________________________________
> PVFS-users mailing list
> PVFS-users at www.beowulf-underground.org
> http://www.beowulf-underground.org/mailman/listinfo/pvfs-users
>
>
-------------- next part --------------
Index: krwsemaphore-spinlock.c
===================================================================
RCS file: /anoncvs/pvfs-kernel/krwsemaphore-spinlock.c,v
retrieving revision 1.2
diff -u -r1.2 krwsemaphore-spinlock.c
--- krwsemaphore-spinlock.c 30 Oct 2002 21:38:39 -0000 1.2
+++ krwsemaphore-spinlock.c 21 Jul 2004 17:41:08 -0000
@@ -42,7 +42,7 @@
/*
* initialise the semaphore
*/
-void init_pvfs_rwsem(struct pvfs_rw_semaphore *sem)
+void fastcall init_pvfs_rwsem(struct pvfs_rw_semaphore *sem)
{
sem->activity = 0;
spin_lock_init(&sem->wait_lock);
@@ -114,7 +114,7 @@
/*
* get a read lock on the semaphore
*/
-void __Down_read(struct pvfs_rw_semaphore *sem)
+void fastcall __Down_read(struct pvfs_rw_semaphore *sem)
{
struct pvfs_rwsem_waiter waiter;
struct task_struct *tsk;
@@ -157,7 +157,7 @@
/*
* trylock for reading -- returns 1 if successful, 0 if contention
*/
-int __Down_read_trylock(struct pvfs_rw_semaphore *sem)
+int fastcall __Down_read_trylock(struct pvfs_rw_semaphore *sem)
{
int ret = 0;
spin_lock(&sem->wait_lock);
@@ -175,7 +175,7 @@
* Can get interrupted though and will
* return with -EINTR.
*/
-int __Down_read_interruptible(struct pvfs_rw_semaphore *sem)
+int fastcall __Down_read_interruptible(struct pvfs_rw_semaphore *sem)
{
int result = 0;
struct pvfs_rwsem_waiter waiter;
@@ -235,7 +235,7 @@
* return with -ETIME or return 0 on success.
* timeout should be in jiffies.
*/
-int __Down_timed_read_interruptible(struct pvfs_rw_semaphore *sem, signed long timeout)
+int fastcall __Down_timed_read_interruptible(struct pvfs_rw_semaphore *sem, signed long timeout)
{
int result = 0;
struct pvfs_rwsem_waiter waiter;
@@ -312,7 +312,7 @@
* get a write lock on the semaphore
* - note that we increment the waiting count anyway to indicate an exclusive lock
*/
-void __Down_write(struct pvfs_rw_semaphore *sem)
+void fastcall __Down_write(struct pvfs_rw_semaphore *sem)
{
struct pvfs_rwsem_waiter waiter;
struct task_struct *tsk;
@@ -355,7 +355,7 @@
/*
* trylock for writing -- returns 1 if successful, 0 if contention
*/
-int __Down_write_trylock(struct pvfs_rw_semaphore *sem)
+int fastcall __Down_write_trylock(struct pvfs_rw_semaphore *sem)
{
int ret = 0;
@@ -377,7 +377,7 @@
* - note that we increment the waiting count anyway to indicate an exclusive lock
* We return -EINTR on a signal.
*/
-int __Down_write_interruptible(struct pvfs_rw_semaphore *sem)
+int fastcall __Down_write_interruptible(struct pvfs_rw_semaphore *sem)
{
int result = 0;
struct pvfs_rwsem_waiter waiter;
@@ -436,7 +436,7 @@
* We return -EINTR on a signal and -ETIME on timeout and 0 on su.
* timeout is in jiffies.
*/
-int __Down_timed_write_interruptible(struct pvfs_rw_semaphore *sem, signed long timeout)
+int fastcall __Down_timed_write_interruptible(struct pvfs_rw_semaphore *sem, signed long timeout)
{
int result = 0;
struct pvfs_rwsem_waiter waiter;
@@ -512,7 +512,7 @@
/*
* release a read lock on the semaphore
*/
-void __Up_read(struct pvfs_rw_semaphore *sem)
+void fastcall __Up_read(struct pvfs_rw_semaphore *sem)
{
spin_lock(&sem->wait_lock);
if (--sem->activity==0 && !list_empty(&sem->wait_list))
@@ -524,7 +524,7 @@
/*
* release a write lock on the semaphore
*/
-void __Up_write(struct pvfs_rw_semaphore *sem)
+void fastcall __Up_write(struct pvfs_rw_semaphore *sem)
{
spin_lock(&sem->wait_lock);
sem->activity = 0;
Index: rwsemaphore.h
===================================================================
RCS file: /anoncvs/pvfs-kernel/rwsemaphore.h,v
retrieving revision 1.2
diff -u -r1.2 rwsemaphore.h
--- rwsemaphore.h 30 Oct 2002 21:38:39 -0000 1.2
+++ rwsemaphore.h 21 Jul 2004 17:41:08 -0000
@@ -44,6 +44,14 @@
#define DECLARE_PVFS_RWSEM(name) \
struct pvfs_rw_semaphore name = __PVFS_RWSEM_INITIALIZER(name)
+#ifndef fastcall
+#ifdef __i386__
+#define fastcall __attribute__((regparm(3)))
+#else
+#define fastcall
+#endif
+#endif
+
extern void FASTCALL(init_pvfs_rwsem(struct pvfs_rw_semaphore *sem));
extern void FASTCALL(__Down_read(struct pvfs_rw_semaphore *sem));
extern int FASTCALL(__Down_read_trylock(struct pvfs_rw_semaphore *sem));
More information about the PVFS-users
mailing list