From fcbbd36ed51f80066036ba01fbd965a41675ac69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Mon, 23 Sep 2002 03:06:24 +0000 Subject: [PATCH] Fixed warnings in smp.c. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1125 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kernel/core/smp.c | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/src/kernel/core/smp.c b/src/kernel/core/smp.c index 146becd81f..402e0951a4 100644 --- a/src/kernel/core/smp.c +++ b/src/kernel/core/smp.c @@ -28,12 +28,12 @@ struct smp_msg { struct smp_msg *next; int message; - unsigned long data; - unsigned long data2; - unsigned long data3; + unsigned long data; + unsigned long data2; + unsigned long data3; void *data_ptr; int flags; - int ref_count; + int32 ref_count; volatile bool done; unsigned int proc_bitmap; int lock; @@ -60,34 +60,39 @@ static int smp_num_cpus = 1; static int smp_process_pending_ici(int curr_cpu); -void acquire_spinlock(spinlock_t *lock) +void +acquire_spinlock(spinlock_t *lock) { - if(smp_num_cpus > 1) { + if (smp_num_cpus > 1) { int curr_cpu = smp_get_current_cpu(); - if(are_interrupts_enabled()) + if (are_interrupts_enabled()) panic("acquire_spinlock: attempt to acquire lock %p with interrupts enabled\n", lock); - while(1) { - while(*lock != 0) + while (1) { + while (*lock != 0) smp_process_pending_ici(curr_cpu); - if(atomic_set(lock, 1) == 0) + if (atomic_set((int32 *)lock, 1) == 0) break; } } } -static void acquire_spinlock_nocheck(spinlock_t *lock) + +static void +acquire_spinlock_nocheck(spinlock_t *lock) { - if(smp_num_cpus > 1) { - while(1) { + if (smp_num_cpus > 1) { + while (1) { while(*lock != 0) ; - if(atomic_set(lock, 1) == 0) + if (atomic_set((int32 *)lock, 1) == 0) break; } } } -void release_spinlock(spinlock_t *lock) + +void +release_spinlock(spinlock_t *lock) { *lock = 0; } @@ -172,7 +177,9 @@ static struct smp_msg *smp_check_for_message(int curr_cpu, int *source_mailbox) return msg; } -static void smp_finish_message_processing(int curr_cpu, struct smp_msg *msg, int source_mailbox) + +static void +smp_finish_message_processing(int curr_cpu, struct smp_msg *msg, int source_mailbox) { int old_refcount;