Index: trunk/kernel/kern/cluster.c
===================================================================
--- trunk/kernel/kern/cluster.c	(revision 406)
+++ trunk/kernel/kern/cluster.c	(revision 407)
@@ -29,4 +29,5 @@
 #include <hal_special.h>
 #include <hal_ppm.h>
+#include <remote_fifo.h>
 #include <printk.h>
 #include <errno.h>
@@ -77,11 +78,10 @@
     // initialize cluster local parameters
 	cluster->cores_nr        = info->cores_nr;
-    cluster->cores_in_kernel = 0;
 
     // initialize the lock protecting the embedded kcm allocator
 	spinlock_init( &cluster->kcm_lock );
 
-    cluster_dmsg("\n[DMSG] %s for cluster %x enters\n",
-                 __FUNCTION__ , local_cxy );
+cluster_dmsg("\n[DBG] %s for cluster %x enters\n",
+__FUNCTION__ , local_cxy );
 
     // initialises DQDT
@@ -102,11 +102,11 @@
     }
 
-    cluster_dmsg("\n[DMSG] %s : PPM initialized in cluster %x at cycle %d\n",
-                 __FUNCTION__ , local_cxy , hal_get_cycles() );
+cluster_dmsg("\n[DBG] %s : PPM initialized in cluster %x at cycle %d\n",
+__FUNCTION__ , local_cxy , hal_get_cycles() );
 
     // initialises embedded KHM
 	khm_init( &cluster->khm );
 
-    cluster_dmsg("\n[DMSG] %s : KHM initialized in cluster %x at cycle %d\n",
+    cluster_dmsg("\n[DBG] %s : KHM initialized in cluster %x at cycle %d\n",
                  __FUNCTION__ , local_cxy , hal_get_cycles() );
 
@@ -114,5 +114,5 @@
 	kcm_init( &cluster->kcm , KMEM_KCM );
 
-    cluster_dmsg("\n[DMSG] %s : KCM initialized in cluster %x at cycle %d\n",
+    cluster_dmsg("\n[DBG] %s : KCM initialized in cluster %x at cycle %d\n",
                  __FUNCTION__ , local_cxy , hal_get_cycles() );
 
@@ -125,13 +125,13 @@
 	}
 
-    cluster_dmsg("\n[DMSG] %s : cores initialized in cluster %x at cycle %d\n",
-                 __FUNCTION__ , local_cxy , hal_get_cycles() );
+cluster_dmsg("\n[DBG] %s : cores initialized in cluster %x at cycle %d\n",
+__FUNCTION__ , local_cxy , hal_get_cycles() );
 
     // initialises RPC fifo
-	rpc_fifo_init( &cluster->rpc_fifo );
+	local_fifo_init( &cluster->rpc_fifo );
     cluster->rpc_threads = 0;
 
-    cluster_dmsg("\n[DMSG] %s : RPC fifo inialized in cluster %x at cycle %d\n",
-                 __FUNCTION__ , local_cxy , hal_get_cycles() );
+cluster_dmsg("\n[DBG] %s : RPC fifo inialized in cluster %x at cycle %d\n",
+__FUNCTION__ , local_cxy , hal_get_cycles() );
 
     // initialise pref_tbl[] in process manager
@@ -157,6 +157,6 @@
     }
 
-    cluster_dmsg("\n[DMSG] %s Process Manager initialized in cluster %x at cycle %d\n",
-                 __FUNCTION__ , local_cxy , hal_get_cycles() );
+cluster_dmsg("\n[DBG] %s Process Manager initialized in cluster %x at cycle %d\n",
+__FUNCTION__ , local_cxy , hal_get_cycles() );
 
     hal_fence();
@@ -184,18 +184,4 @@
 //  Cores related functions
 ////////////////////////////////////////////////////////////////////////////////////
-
-////////////////////////////////
-void cluster_core_kernel_enter()
-{
-    cluster_t * cluster = LOCAL_CLUSTER;
-	hal_atomic_add( &cluster->cores_in_kernel , 1 );
-}
-
-///////////////////////////////
-void cluster_core_kernel_exit()
-{
-    cluster_t * cluster = LOCAL_CLUSTER;
-	hal_atomic_add( &cluster->cores_in_kernel , -1 );
-}
 
 /////////////////////////////////
@@ -353,8 +339,9 @@
 void cluster_process_local_link( process_t * process )
 {
+    uint32_t irq_state;
     pmgr_t * pm = &LOCAL_CLUSTER->pmgr;
 
     // get lock protecting the process manager local list
-    remote_spinlock_lock( XPTR( local_cxy , &pm->local_lock ) );
+    remote_spinlock_lock_busy( XPTR( local_cxy , &pm->local_lock ) , & irq_state );
 
     xlist_add_first( XPTR( local_cxy , &pm->local_root ),
@@ -363,5 +350,5 @@
 
     // release lock protecting the process manager local list
-    remote_spinlock_unlock( XPTR( local_cxy , &pm->local_lock ) );
+    remote_spinlock_unlock_busy( XPTR( local_cxy , &pm->local_lock ) , irq_state );
 }
 
@@ -369,8 +356,9 @@
 void cluster_process_local_unlink( process_t * process )
 {
+    uint32_t irq_state;
     pmgr_t * pm = &LOCAL_CLUSTER->pmgr;
 
     // get lock protecting the process manager local list
-    remote_spinlock_lock( XPTR( local_cxy , &pm->local_lock ) );
+    remote_spinlock_lock_busy( XPTR( local_cxy , &pm->local_lock ) , &irq_state );
 
     xlist_unlink( XPTR( local_cxy , &process->local_list ) );
@@ -378,5 +366,5 @@
 
     // release lock protecting the process manager local list
-    remote_spinlock_unlock( XPTR( local_cxy , &pm->local_lock ) );
+    remote_spinlock_unlock_busy( XPTR( local_cxy , &pm->local_lock ) , irq_state );
 }
 
@@ -384,4 +372,5 @@
 void cluster_process_copies_link( process_t * process )
 {
+    uint32_t irq_state;
     pmgr_t * pm = &LOCAL_CLUSTER->pmgr;
 
@@ -401,5 +390,5 @@
 
     // get lock protecting copies_list[lpid]
-    remote_spinlock_lock( copies_lock );
+    remote_spinlock_lock_busy( copies_lock , &irq_state );
 
     xlist_add_first( copies_root , copies_entry );
@@ -407,5 +396,5 @@
 
     // release lock protecting copies_list[lpid]
-    remote_spinlock_unlock( copies_lock );
+    remote_spinlock_unlock_busy( copies_lock , irq_state );
 }
 
@@ -413,4 +402,5 @@
 void cluster_process_copies_unlink( process_t * process )
 {
+    uint32_t irq_state;
     pmgr_t * pm = &LOCAL_CLUSTER->pmgr;
 
@@ -427,5 +417,5 @@
 
     // get lock protecting copies_list[lpid]
-    remote_spinlock_lock( copies_lock );
+    remote_spinlock_lock_busy( copies_lock , &irq_state );
 
     xlist_unlink( copies_entry );
@@ -433,5 +423,5 @@
 
     // release lock protecting copies_list[lpid]
-    remote_spinlock_unlock( copies_lock );
+    remote_spinlock_unlock_busy( copies_lock , irq_state );
 }
 
